Fiveable

💻AP Computer Science A Review

QR code for AP Computer Science A practice questions

FRQ 1 – Methods and Control Structures

💻AP Computer Science A
Review

FRQ 1 – Methods and Control Structures

Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examWritten by the Fiveable Content Team • Last updated September 2025
💻AP Computer Science A
Unit & Topic Study Guides
Pep mascot

Overview

  • FRQ1 is worth 7 points (7 out of 25 total FRQ points, nearly 13% of your free-response score)
  • Budget about 20-22 minutes (out of 90 minutes for all four FRQs)
  • This is typically the most straightforward FRQ - can often finish in 15 minutes and bank time for harder questions

You can expect this format: you'll get a partially completed class with some methods already written for you. Part (a) usually asks you to write a constructor or a method that uses helper methods, and it's worth 4 points. Part (b) asks you to write another method, typically involving String manipulation or basic array/ArrayList work, worth 3 points. They give you the method headers - you just fill in the body.

Strategy Deep Dive

Here's a systematic approach that consistently earns full points. The key is understanding that FRQ1 isn't really testing your ability to write complex algorithms - it's testing whether you can follow directions precisely and use provided tools effectively.

Start by reading the complete problem before coding. This is crucial for several reasons. The biggest mistake students make is diving into part (a) without reading part (b). Sometimes part (b) gives you hints about what your instance variables should be named or how the class is supposed to work overall. More importantly, understanding both parts helps you see the bigger picture of what the class is trying to accomplish. You might realize that a variable you're tracking in part (a) will be crucial for part (b), which affects how you name and structure things.

When you see a helper method like getNextWord in the example, that's the test makers basically screaming "USE THIS METHOD!" They're testing whether you can work with existing code, not whether you can reinvent the wheel. The graders literally have a point allocated for "calls the helper method appropriately." Free point if you just use what they give you.

When implementing loops, pay attention to your termination conditions. In the MessageBuilder example, they tell you getNextWord returns null when there are no more words. That's your loop condition right there: while (w != null). Don't overthink it. They're not trying to trick you - they're trying to see if you can put in place a straightforward algorithm.

String manipulation in part (b) requires precision with method usage: substring(start, end) does NOT include the character at the end index. I've seen so many people mess this up. Also, indexOf returns -1 when it can't find something, not null or 0. These are the kinds of details that separate a 6/7 from a 7/7.

Rubric Breakdown

What the rubric actually means, using the MessageBuilder example:

Part (a) - 4 points total:

Point 1: "Calls getNextWord on the value of startingWord" This is literally just checking if you wrote something like getNextWord(startingWord) somewhere in your code. But here's the catch - they also check that you didn't make any incorrect calls. So if you call getNextWord() with no parameter or getNextWord(message) when you should use the most recent word, you lose this point.

Point 2: "Loops until no more words remaining" They want to see a loop that keeps going until getNextWord returns null. The key phrase in the rubric is "incorrect comparison to null" - make sure you use != null or == null, not .equals(null). Null isn't an object, so you can't call methods on it.

Point 3: "Increments a count of the number of words accessed" You need a counter that goes up each time you process a word. The beautiful thing? The rubric says you can still get this point even if you forget to assign it to numWords at the end. So even if you just have int count = 1; and increment it in your loop, you get this point. But obviously, do assign it to numWords for the algorithm point.

Point 4: "Algorithm point" This is where they check if your overall solution works. You need to build the message correctly (starting word + space + next word + space + next word...), and assign the right count to numWords. The rubric specifically mentions not having extra spaces before the first word or after the last word. So don't initialize message as " " - that's a classic way to lose this point.

Key insight: The algorithm point is often still available even if you made small errors elsewhere. I've seen solutions that called getNextWord slightly wrong but still got the algorithm point because the overall logic was sound. Don't give up if you know you messed up one part.

Part (b) - 3 points total:

Point 5: "Loop accesses all necessary parts of message" You need some kind of loop that will look at the whole message string. This could be going through character by character, or finding spaces and jumping between them. The graders are flexible here - they just want to see that your loop structure would eventually look at everything it needs to.

Point 6: "Identifies a letter that appears after a space" This is checking your String method usage. Can you correctly find where spaces are and then get the character after them? Common mistakes include off-by-one errors with substring or forgetting that the first word doesn't have a space before it.

Point 7: "Algorithm point" Your method needs to return the right abbreviation. But Keep in mind's crucial from the rubric: you CANNOT modify message or numWords. If you accidentally write message = message.substring(...), you just lost this point. Make a copy with String temp = message; if you need to manipulate it.

Common FRQ1 Patterns

Common patterns across FRQ1 problems include themes that keep showing up year after year. Once you recognize these patterns, you'll feel like you've seen the question before, even when the context is completely new.

Constructor Questions: When they ask for a constructor, it almost always involves (1) initializing instance variables from parameters, (2) using a helper method in a loop to build up some data structure, and (3) counting something along the way. The MessageBuilder is a perfect example - initialize message, loop with getNextWord, count words. What's interesting is why this pattern exists: the College Board wants to test whether you can initialize an object's state by processing external data, which is a fundamental object-oriented programming skill. They're not just checking if you can write a constructor - they're checking if you understand that constructors often do more than just assign parameters to instance variables.

String Manipulation: Part (b) frequently involves either building a new string from an existing one (like making an abbreviation) or searching through a string for a pattern. They love testing indexOf, substring, and string concatenation. Pro tip: when you see "each word is separated by a single space," that's your cue to look for spaces as delimiters.

Using Helper Methods: When they provide a helper method, they've basically given you half the algorithm. Your job is just to call it correctly in a loop. These helper methods often return null or -1 or some sentinel value when they're "done" - that's always your loop termination condition.

Postcondition Requirements: Look for postconditions that say things like "message is unchanged." This is tested in the algorithm point. Make copies of any data you need to modify.

Time Management Reality

Begin with 3-4 minutes of careful reading and understanding what both parts are asking. This feels long - almost uncomfortably long when you're anxious to start coding - but it's worth it. During this time, you're not just reading; you're actively processing. You're identifying the helper methods, understanding the examples, and forming a mental model of the solution.

Then you spend about 8-10 minutes on part (a) - writing the code, double-checking your loop logic, making sure you're using the helper method correctly. This should feel careful, not rushed. If you find yourself frantically coding, you didn't spend enough time understanding the problem. The actual code for part (a) is usually only 5-10 lines, so most of this time is thinking and verifying, not typing.

Part (b) gets about 6-8 minutes. This often feels faster because you're warmed up and familiar with the class structure. You should have 2-3 minutes left to review your work. This review time is crucial - it's when you catch those small errors that cost points, like forgetting to assign a value to an instance variable or having an extra space in your output string.

Students who manage time well often finish FRQ1 in about 17 minutes, which provides crucial extra time for later questions. That extra time was golden for FRQ4 (2D arrays), which always takes longer than you think. If you're spending more than 25 minutes on FRQ1, you're either overthinking it or you're not solid on your basic control structures. This is supposed to be the warm-up question.

A final note on time management: if you're stuck on part (a), skip to part (b). They're independent, and part (b) is often easier. I've seen people waste 15 minutes trying to perfect part (a) when they could have grabbed those 3 points from part (b) in 5 minutes. Points are points - doesn't matter where they come from.

Remember, FRQ1 is designed to be accessible. If your solution feels overly complicated, you're probably overthinking it. Trust the helper methods they give you, use straightforward loop logic, and watch those String method details.

What makes FRQ1 manageable is its predictable structure. Once you recognize the patterns, you can approach each new problem with a clear strategy, methodically working through your solution while knowing exactly what the graders expect. That confidence you build here will carry you through the harder questions. You've got this!