2D Array FRQ Patterns for AP CSA: How FRQ 4 Works (2026)
2D Array FRQ Patterns for AP CSA: How FRQ 4 Works
FRQ 4 on the AP CSA exam is always a 2D array problem. This page breaks down the recurring patterns, shows you how to earn maximum points, and gives you the step-by-step approach that works every time.
📄 On This Page
📋 FRQ 4 Structure
FRQ 4 typically has 2 parts:
- Part (a): Process individual rows or columns (row sum, row max, count per row)
- Part (b): Use Part (a) results across the full matrix (find which row has the highest sum, compare columns)
Part (b) almost always calls Part (a). If you get Part (a) wrong, you can still earn full credit on Part (b) by calling Part (a) correctly and using its result properly.
Even if your Part (a) is wrong, write Part (b) assuming Part (a) works. The rubric scores Part (b) independently. Call your Part (a) method and use its return value. You can earn 4-5 points on Part (b) with a broken Part (a).
🔍 The 4 Core Patterns
Pattern 1: Row-Based Processing
Process each row independently, often returning an array of results.
// Return array of row sums
public int[] allRowSums()
{
int[] sums = new int[grid.length];
for (int r = 0; r < grid.length; r++)
{
for (int c = 0; c < grid[r].length; c++)
{
sums[r] += grid[r][c];
}
}
return sums;
}
Pattern 2: Find the Row/Column Meeting a Condition
Use row processing, then scan results for the best one.
// Which row has the largest sum?
public int rowWithMaxSum()
{
int[] sums = allRowSums(); // call Part (a)
int maxIdx = 0;
for (int i = 1; i < sums.length; i++)
{
if (sums[i] > sums[maxIdx])
{
maxIdx = i;
}
}
return maxIdx;
}
Pattern 3: Neighbor Checking
Check elements above, below, left, right. Must guard against going out of bounds.
// Is grid[r][c] greater than all its neighbors?
public boolean isLocalMax(int r, int c)
{
int val = grid[r][c];
if (r > 0 && grid[r-1][c] >= val) return false;
if (r < grid.length-1 && grid[r+1][c] >= val) return false;
if (c > 0 && grid[r][c-1] >= val) return false;
if (c < grid[r].length-1 && grid[r][c+1] >= val) return false;
return true;
}
Pattern 4: Counting Elements Meeting a Condition
// Count elements in a specific row that are above average
public int countAboveAvg(int row, double avg)
{
int count = 0;
for (int c = 0; c < grid[row].length; c++)
{
if (grid[row][c] > avg)
{
count++;
}
}
return count;
}
🛠 Step-by-Step Approach
- Read Part (a) first. Identify what single-row or single-column operation it wants.
- Write the inner loop. This processes one row or column.
- Wrap in outer loop if needed. Some Part (a) methods only process one row (passed as parameter).
- Read Part (b). It almost certainly calls Part (a). Identify what it does with the result.
- Call Part (a) in Part (b). Do NOT copy-paste Part (a) code. Call the method.
💰 Scoring Rubric Tips
FRQ 4 rubrics consistently award points for:
-
Correct loop bounds (1-2 pts) —
grid.lengthfor rows,grid[r].lengthfor columns -
Accessing elements correctly (1 pt) —
grid[r][c]with both indices - Applying the condition (1-2 pts) — the if statement inside the loop
- Accumulating/returning the result (1 pt) — sum, count, or boolean
- Calling Part (a) in Part (b) (1 pt) — do not rewrite the logic
✏ Practice Questions
grid[r][c] has a neighbor above it, which bounds check is correct?matrix?I. Part (b) should call Part (a) as a helper method.
II. If Part (a) is wrong, Part (b) automatically gets zero points.
III. Part (b) typically operates on the results returned by Part (a).
int[] with the sum of each row. Part (b) returns the index of the row with the smallest sum. If two rows tie, it returns the smaller index. What is the correct comparison in Part (b)?❓ Frequently Asked Questions
Is FRQ 4 always a 2D array problem?
Yes. On the 2026 AP CSA exam, FRQ 4 always involves a 2D array. The problem typically requires nested loop traversal, processing rows or columns, and applying conditions to elements.
How is FRQ 4 scored?
FRQ 4 is worth 9 points. Points are awarded for correct loop bounds, accessing elements properly, applying the condition, accumulating or modifying values, and returning the correct result. Partial credit is common.
What patterns show up most on FRQ 4?
The most common patterns are: processing each row independently (like finding the row with the highest sum), checking neighbors, counting elements meeting a condition, and modifying a subregion of the matrix.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
tanner@apcsexamprep.com
Courses
AP CSA, CSP, & Cybersecurity
Response Time
Within 24 hours
Prefer email? Reach me directly at tanner@apcsexamprep.com