2024 AP CSA FRQ 4: GridPath Solution + Rubric
⚠ May 2026 exam uses a NEW point structure — tap for details ▾
This page shows the original 2024 FRQ 4, which the College Board scored on a 9-point rubric. The May 2026 exam uses a NEW point distribution and structure — the patterns and traps on this page still apply, but expect different point values and formats on test day.
FRQ 1: 7 points (2 parts: Part A 4pts + Part B 3pts) — Methods & Control Structures
FRQ 2: 7 points (single part) — Class Design
FRQ 3: 5 points (single part) — Data Analysis with ArrayList
FRQ 4: 6 points (single part) — 2D Array
Total Section II: 25 points = 45% of exam score. Only Question 1 has two parts on the 2026 exam; Questions 2, 3, and 4 each have a single part.
Sources: Official College Board CED, Exam Overview (page 145) · Skylight Publishing CED Sample FR Solutions (page 161 reference)
2024 AP CSA FRQ 4: GridPath — Complete Solution & Rubric
Step-by-step solution to 2024 AP CSA FRQ 4 (GridPath) with the official 9-point rubric, common mistakes that cost points, and a built-in 22-minute practice timer. Written by an AP Computer Science teacher whose students earn 5s at more than 2x the national rate.
The Official 2024 FRQ 4 Question
The complete prompt is in the PDF below. Use the recap above the editor to keep the key requirements in mind while you write your response.
The PDF cannot be embedded on this device.
Open Prompt PDF in New TabWrite Your Part A Response: getNextLoc
Read the prompt above and write your responses in the editors below — Part A in the first, Part B in the second. The real AP exam in Bluebook gives you the prompt and separate response areas per part with no requirement summary or hints. Practice like that here. When you’re done with both parts, click Reveal Solution & Scoring Rubric below to compare your code against the official rubric.
Write Your Part B Response: sumPath
Ready to self-grade? Compare your code against the official 9-point rubric below. AP FRQs are graded by trained human readers, so we don’t auto-score — you’ll learn more by checking your work against the rubric criteria yourself.
What the Prompt Was Asking
Before reading the solution, check whether your response covered each of these requirements:
Write: public Location getNextLoc(int row, int col) — Part A; public int sumPath(int row, int col) — Part B
Required behavior:
- Part A getNextLoc: return the Location of the smaller of two neighbors (right or below). Four cases: bottom row (must go right), rightmost column (must go down), otherwise compare grid[row+1][col] vs grid[row][col+1] and return the smaller. Use new Location(r, c) — never access grid out of bounds.
- Part B sumPath: initialize sum to 0 (or to grid[row][col]). Loop while NOT at the bottom-right corner using OR (||), not AND (&&). Inside the loop: add grid[row][col] to sum, call getNextLoc(row, col), update row and col with loc.getRow() and loc.getCol().
- Part B sum boundary: must include BOTH the starting cell AND the bottom-right cell in the total. The cleanest pattern adds grid[row][col] inside the loop and adds grid[row][col] one final time after the loop exits at the bottom-right.
How to Write the GridPath Methods Step-by-Step
// Sample solution adapted from official scoring guidelines
// 2024 AP CSA FRQ 4: GridPath (worth 9 points)
public Location getNextLoc(int row, int col) {
// Boundary case 1: last row, must move right
if (row == grid.length - 1) {
return new Location(row, col + 1);
}
// Boundary case 2: last column, must move down
if (col == grid[0].length - 1) {
return new Location(row + 1, col);
}
// Both neighbors exist: return the smaller
if (grid[row + 1][col] < grid[row][col + 1]) {
return new Location(row + 1, col);
}
return new Location(row, col + 1);
}
public int sumPath(int row, int col) {
int sum = 0;
// Continue while NOT at bottom-right corner; use OR (||), not AND (&&)
while (row < grid.length - 1 || col < grid[0].length - 1) {
sum += grid[row][col];
Location next = getNextLoc(row, col);
row = next.getRow();
col = next.getCol();
}
// Add the final (bottom-right) cell after exiting the loop
return sum + grid[row][col];
}
Official 9-Point Scoring Rubric for GridPath
| Pts | Criterion |
|---|---|
| +1 | Guards against out-of-bounds access (does not access grid outside valid indices) |
| +1 | Accesses elements at grid[row + 1][col] and grid[row][col + 1]
|
| +1 | Returns appropriate Location in all four cases (algorithm, Part A) |
| +1 | Initializes sum to 0 (or to a grid element); increments only with grid values |
| +1 | Traverses via successive getNextLoc calls without bounds errors |
| +1 | Calls getNextLoc as instance method (no class-name qualifier) |
| +1 | Calls getRow() and getCol() on Location objects |
| +1 | Accesses grid elements at positions derived from getNextLoc
|
| +1 | Sum includes BOTH the first and last cells visited (algorithm, Part B) |
Common Mistakes That Cost Points on FRQ 4
FAQs About 2024 AP CSA FRQ 4
What does 2024 AP CSA FRQ 4 GridPath test?
GridPath tests writing two methods that traverse a 2D int array in an unusual diagonal-pattern: getNextLoc returns a Location representing the smaller of the right-or-below neighbor (with boundary guards), and sumPath follows successive getNextLoc calls from a starting cell to the bottom-right corner, accumulating the sum of every visited cell. The hardest single point is Point 9: the sum must include BOTH the first and last cells visited — Sample 4A in the Chief Reader commentary lost this point for omitting the starting cell.
How many points is FRQ 4 worth?
9 points, awarded across the rubric criteria. FRQ 4 makes up about 11% of the AP CSA exam score.
What is the most common mistake on 2024 FRQ 4 GridPath?
Calling getNextLoc on the bottom-right corner, violating its precondition. Sample 4B in the official commentary lost Point 5 because the loop continued until reaching the bottom-right and THEN called getNextLoc on that position. The fix is to use OR (||) in the loop condition: while (row < grid.length - 1 || col < grid[0].length - 1) — exit BEFORE the bottom-right is reached, then add the final cell after the loop.
How long should I spend on FRQ 4?
Aim for 22 minutes per FRQ. The AP CSA free-response section is 90 minutes for 4 questions, so 22 minutes per question leaves a 2-minute buffer to review.
Is GridPath still relevant for the 2026 AP CSA exam?
Yes. The current AP CSA 4-unit curriculum still tests 2D array traversal with nested loops, so GridPath is excellent practice for the 2026 exam format.
Where can I find the official scoring guidelines?
College Board publishes the official scoring guidelines as a PDF on AP Central. The rubric on this page mirrors those criteria. You can download the official scoring guidelines here.
Related AP CSA FRQs to Practice Next
If you found GridPath useful, work through these next to lock in the same Java concepts:
- See all four 2024 AP CSA FRQs — finish the complete exam under timed conditions
- Browse 2D array traversal with nested loops FRQs across every year — the same skill, multiple exams
- Open the full FRQ archive (2004–2025) — every released question with solutions
- Read the AP CSA FRQ strategy guide — how to attack each FRQ type for full credit
- Return to the AP CSA hub — all study guides, practice tests, and tutoring options
Why 2024 FRQ 4 Still Matters for the 2026 AP CSA Exam
The 2026 AP CSA curriculum reorganized the topic list into 4 units, but the FRQ types stayed the same. 2024 FRQ 4 (GridPath) tests 2D array traversal with nested loops, which is still a core part of the exam. Practicing this question prepares you for the Bluebook digital test format and builds the muscle memory you need for the exam on Friday, May 15, 2026.
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.
Prefer email? Reach me directly at [email protected]