Overview
- FRQ4 is worth 6 points out of 25 total FRQ points (about 24% of free-response score, roughly 11% of total exam score)
- Budget approximately 22-23 minutes during the 90-minute FRQ section
- Always involves 2D array manipulation problems
What to expect: FRQ4 always involves a 2D array manipulation problem. You'll be given a class that maintains a 2D array as an instance variable, and you'll need to write a method that processes this array in some specific way. The problem typically involves traversing the entire array, counting or finding specific elements, or analyzing patterns across rows and columns. You'll work with objects stored in the array (not just primitives), which means you'll be calling methods on array elements to access their data.
Strategy Deep Dive
Success with 2D arrays comes from understanding traversal patterns at a conceptual level, not just memorizing syntax. The most effective approach includes:
Understanding Row vs Column Traversal
A fundamental principle: in Java 2D arrays, the first index is ALWAYS the row, and the second index is ALWAYS the column. Think of it as array[row][col]. This is backwards from how we typically say coordinates in math class (where we say x,y), but it makes sense if you think about how arrays are stored in memory.
The key insight: Java implements 2D arrays as "arrays of arrays." When you declare int[][] grid = new int[3][4], you're really creating an array of 3 elements, where each element is itself an array of 4 integers. This is why grid.length gives you the number of rows (3), and grid[0].length gives you the number of columns (4). Understanding this structure transforms row/column indexing from memorization into logical comprehension.
When you traverse row-by-row (the most common pattern), your outer loop iterates through rows and your inner loop iterates through columns:
</>Javafor (int row = 0; row < array.length; row++) { for (int col = 0; col < array[0].length; col++) { // Process array[row][col] } }
A frequent source of errors: when you need to traverse column-by-column (like in the Schedule example), you flip the loops. The outer loop becomes columns, and the inner loop becomes rows:
</>Javafor (int col = 0; col < array[0].length; col++) { for (int row = 0; row < array.length; row++) { // Process array[row][col] - notice row/col order stays the same! } }
The reason this works is that you're changing which dimension you're "holding constant" while iterating through the other. When counting occurrences in each column (like the Schedule problem), you want to finish counting everything in column 0 before moving to column 1.
The Psychology of Array Bounds
Test makers love to test whether you understand array bounds, and there's a calculated reason for this obsession. For a 2D array called arr:
arr.lengthgives you the number of rowsarr[0].lengthgives you the number of columns (assuming at least one row exists)
They'll often put this in the conditions: "Assume the array has at least one row and one column." This is your green light to use arr[0].length without worrying about null pointer exceptions. The underlying reason: they're testing whether you understand that 2D arrays can be "jagged" (rows of different lengths) in Java, even though AP CSA only uses rectangular arrays. By explicitly stating this precondition, they're both simplifying the problem and testing whether you know when it's safe to access arr[0]. It's a subtle way of checking if you truly understand the structure of 2D arrays in Java.
Working with Objects in Arrays
Unlike 1D array problems where you might work with primitives, 2D array FRQs almost always store objects. This means you'll be calling methods on array elements. The pattern looks like:
</>Javaif (array[row][col].someMethod().equals(target)) { // Do something }
Notice the method chaining here. You access the element, call a method on it, then often need to use .equals() for String comparisons (never use == for Strings!).
Rubric Breakdown
What the graders are actually looking for in each rubric point, using the Schedule problem as our model:
Point 1: Accessing all elements (1 point) This point is about demonstrating you can traverse the entire 2D array without going out of bounds. The graders want to see both loops with correct bounds checking. Even if your logic inside the loops is wrong, you can still earn this point for correct traversal.
Grading insight: If you're not sure about your algorithm, at least write out the proper nested loop structure. It's literally free points if you get the bounds right.
Point 2: Calling methods on array elements (1 point)
You need to show you understand that elements in the array are objects with methods. In the Schedule example, this means calling getStatus() on an Appointment object. Students often forget the parentheses or try to access fields directly (like .status instead of .getStatus()). Remember: in AP CS A, instance variables are private, so you must use getter methods.
Point 3: Comparing values correctly (1 point)
This is where String comparison trips people up. If you're comparing Strings (which is common), you MUST use .equals(). Using == to compare Strings is an automatic loss of this point. The graders are specifically trained to look for this mistake.
Points 4-5: Algorithm putting in place (2 points) These points test whether you can put in place the core algorithm correctly. For counting problems, this usually means:
- Initializing a counter before your inner loop
- Resetting the counter for each new row/column
- Properly accumulating values
Students often forget to reset counters when moving to a new column. If you're counting occurrences in each column, you need to set count back to 0 before processing each new column. Forgetting this is a classic mistake that costs both algorithm points.
Point 6: Returning the correct result (1 point) The final point is for returning the right value. Common mistakes include:
- Returning the count instead of the index
- Forgetting to track which column/row had the minimum/maximum
- Not initializing your tracking variables properly
For finding minimum/maximum problems, you need to track both the value (like the count) AND the location (like the column index). Initialize your minimum to a sensibly high value (like the number of rows if counting) and your index to 0.
FRQ4 Common Patterns
FRQ4 problems follow specific patterns that keep showing up like clockwork. These aren't random - they're deliberately chosen to test specific understanding gaps that many students have.
Column Processing Unlike FRQ3 which often focuses on row operations with ArrayLists, FRQ4 frequently asks you to process columns. This tests whether you truly understand 2D array traversal beyond the basic row-by-row pattern. The reason this is so common is fascinating: in most programming contexts, we naturally think row-by-row (like reading text), but many real-world applications require column analysis (think spreadsheets, game boards, or scheduling grids). The test makers know that students who only memorized one traversal pattern will struggle here.
Conditional Counting You'll often need to count elements that meet specific criteria. The condition usually involves calling a method on the array element and comparing the result to a parameter.
Finding Minimum/Maximum "Find the row/column with the most/fewest/highest/lowest..." is a classic pattern. This requires tracking both the extreme value and its location throughout your traversal.
Working with Object Arrays The array always contains objects (like Appointment, Tile, or Card objects), never just primitives. You'll need to call getter methods to access the data you need.
Time Management Reality
The 22-minute time limit requires focused execution. With proper preparation and a clear strategy, it's entirely manageable.
Minutes 0-3: Understanding the problem Read the class structure carefully. Identify what's stored in the 2D array and what methods you can call on those objects. Look at the examples - they often clarify edge cases. Reading FRQ4 requires juggling multiple concepts from other FRQs because you're juggling more mental pieces: the 2D array structure, the objects inside it, and the methods you can call on those objects. Don't rush this. A solid understanding here prevents costly mistakes later.
Minutes 3-5: Planning your approach Decide whether you need row-wise or column-wise traversal. Sketch out your algorithm in comments or pseudocode. This is where you decide on your loop structure.
Minutes 5-15: Writing the solution This is your main coding time. Start with the method header (it's given, so just copy it exactly). Write your loop structure first, then fill in the logic.
Minutes 15-20: Testing with the example Walk through your code with the provided example. This is crucial - the example is specifically designed to catch common errors. If your code doesn't produce the expected output for the example, you have a bug.
Minutes 20-22: Final review
Check for common errors: using == instead of .equals() for Strings, off-by-one errors in loops, forgetting to return a value. Make sure you're returning the right thing (index vs. count is a common confusion).
If you're running short on time, remember that partial credit is your friend. A correct loop structure with some method calls can earn you 2-3 points even if your algorithm isn't perfect. Never leave it blank - show the graders you understand 2D arrays even if you can't complete the algorithm.
The key to feeling comfortable with the time limit is practice. Once you've done 5-10 2D array problems, the patterns become automatic and you'll find yourself finishing with time to spare. The stress comes from uncertainty, not from the actual difficulty of the problem.
FRQ4 ultimately tests deep understanding of array concepts. Column traversal, object manipulation, and index tracking aren't just hoops to jump through. They're testing whether you can work with data structures in the flexible, thoughtful way that real programming requires. Master this question, and you're not just earning 6 points - you're proving you can handle complex data manipulation. That's a skill that will serve you well beyond any exam.