2025 AP CSA FRQ 4: SumOrSameGame Solution + Rubric

May 2026 exam uses a NEW point structure — tap for details

This page shows the original 2025 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)

2025 AP CSA FRQ 4: SumOrSameGame — Complete Solution & Rubric

Step-by-step solution to 2025 AP CSA FRQ 4 (SumOrSameGame) 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.

Year: 2025 Question: 4 of 4 Points: 9 Topics: 2D Array, Nested Loops Difficulty: Hard
Recommended pace: 22:00 per FRQ 22:00

The Official 2025 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 Tab

Write Your Part A Response: SumOrSameGame (constructor)

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.

SumOrSameGame (constructor).java Tab indents | Enter auto-indents | Brackets auto-close
Drag bottom-right corner to resize editor ⇲

Write Your Part B Response: clearPair

clearPair.java Tab indents | Enter auto-indents | Brackets auto-close
Drag bottom-right corner to resize editor ⇲

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 SumOrSameGame(int numRows, int numCols) — Part A; public boolean clearPair(int row, int col) — Part B

Required behavior:

  • Part A: initialize the instance variable puzzle (drop the type!) as a new int[numRows][numCols], then nested-loop through every cell and assign (int)(Math.random() * 9) + 1 to fill with uniform random values in [1, 9].
  • Part B: starting at the given (row, col), nested-loop through cells with currRow >= row. Guard against pairing the cell with itself. For each candidate, test if values match OR sum to 10.
  • Part B return logic: on first match, set BOTH cells (the original and the matched) to 0, then return true. After exhausting all positions with no match, return false. Returning false from inside the loop on a single non-match is wrong.

Sample Solution & Rubric

Verified solution coming soon. See the official College Board scoring guidelines for the complete solution and 9-point rubric. The prompt, common mistakes, and key insight on this page are still accurate — only the worked sample solution and per-point rubric breakdown are pending verification.
// Verified solution coming soon
//
// While we finalize this solution against the official
// 2025 College Board scoring guidelines, please refer to
// the primary source (linked above) for the complete worked
// solution and rubric breakdown.
//
// In the meantime, the prompt, common mistakes, sample
// solutions from past students, and the key insight below
// will help you understand what the question is testing
// and how to avoid the most common point losses.
//
// Last updated: April 27, 2026

Official 9-Point Scoring Rubric for SumOrSameGame

Pts Criterion
? Verified rubric coming soon. See official College Board scoring guidelines for the complete 9-point rubric breakdown for this FRQ.

Common Mistakes That Cost Points on FRQ 4

Mistake 1: Declaring puzzle as a local variable inside the constructor instead of initializing the instance variable. Sample 4B in the official commentary lost Point 1 because int[][] puzzle = new int[numRows][numCols]; shadows the instance variable. Drop the type declaration: puzzle = new int[numRows][numCols];. The constructor INITIALIZES the existing instance variable; it does not redeclare it. This shadowing error appeared in 2025 Q2, Q3, and Q4 — fix it everywhere.
Mistake 2: Missing the (int) cast on the Math.random formula. Sample 4A in the official commentary lost Point 3 because (Math.random()*9)+1 returns a double, not an int. The correct formula is (int)(Math.random() * 9) + 1 — the cast comes BEFORE adding 1, so it casts the multiplication result first, then shifts the range from [0, 8] to [1, 9]. Always wrap the entire Math.random expression (including multiplier) in (int)(...).
Mistake 3: Wrong multiplier in the Math.random formula — using 8 (gives [1, 8]) or 10 (gives [1, 10]) instead of 9 (gives [1, 9]). Sample 4B lost Point 3 with (int)(Math.random()*8)+1 and Sample 4C lost Point 3 with (int)(Math.random() * 10) + 1, both per the official commentary. The pattern (int)(Math.random() * range) + min uses range = COUNT of possible values, not max. For values 1 through 9, count is 9.
Mistake 4: Missing the self-pairing guard. Sample 4B in the official commentary lost Point 6 because the response 'does not contain any code that prevents comparing puzzle[row][col] with itself.' Without the guard if (currRow != row || currCol != col), the very first iteration matches the cell against itself and incorrectly returns true. Always add the self-pairing guard before the value comparison.
Mistake 5: Returning false too early — exiting the loop on the first non-match instead of after exhausting all positions. Sample 4C in the official commentary lost Point 9 because 'the response returns false from the loop prematurely when a match is not immediately found.' Return false only AFTER both nested loops complete with no match found. Inside the loop, only return true (on match); never return false until you have checked every position.
Key Insight: The SumOrSameGame problem teaches the standard 2D-array search pattern: nested loops over rows and columns, guarded comparison at each cell, return true on first match, return false only after exhausting the search space. Two structural traps consistently cost points: returning false too early (inside the loop instead of after both loops complete) and missing the self-pairing guard. Both come from the same root cause — students think of the search as 'check this one element' instead of 'scan all elements until a match or until exhaustion.' A second insight specific to Class Writing FRQs: the SumOrSameGame constructor follows the exact same instance-variable-initialization pattern as Round (Q3) and SignedText (Q2). Writing int[][] puzzle = new int[numRows][numCols]; creates a local variable that shadows the instance variable, leaving puzzle null forever. This shadowing error appeared in Sample 4B, Sample 4C (Q4), and Sample 3C (Q3) — meaning a student who internalizes 'constructors initialize, never re-declare' can avoid one of the most common rubric losses on every Class Writing FRQ across the 2025 exam.

FAQs About 2025 AP CSA FRQ 4

What does 2025 AP CSA FRQ 4 SumOrSameGame test?

SumOrSameGame tests writing a constructor that builds a 2D int array filled with random values in [1, 9] and a clearPair method that searches for a matching element (same value OR summing to 10) at row >= row, sets both elements to 0, and returns a boolean. The hardest single point is Point 9: the algorithm must return true only when a pair is cleared and false only after exhausting all positions.

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 2025 FRQ 4 SumOrSameGame?

Forgetting the (int) cast on the Math.random formula. Sample 4A in the official commentary lost Point 3 with puzzle[i][j] = (Math.random()*9)+1; — without the cast, the random value is a double, not the required int in [1, 9]. The correct formula is (int)(Math.random() * 9) + 1. This same pattern appears across multiple AP CSA FRQs that ask for random integer generation; memorizing the structure (int)(Math.random() * count) + min prevents the error.

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 SumOrSameGame 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 SumOrSameGame 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 SumOrSameGame useful, work through these next to lock in the same Java concepts:

Why 2025 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. 2025 FRQ 4 (SumOrSameGame) 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.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]