AP Computer Science A · Exam guide
AP Computer Science A FRQ Guide: The Four Coding Questions and the 9-Point Rubric
Section II of the AP Computer Science A exam is four coding questions in 90 minutes, and it counts for 45 percent of your score. Each question is scored out of 9, and the four always come in the same order. Because the same skills are tested every year, you can practice each type until the pattern feels familiar.
The four questions, in order
| Question | Type | What you write |
|---|---|---|
| 1 | Methods and control structures | A method that uses loops, conditions, and calls to other methods. |
| 2 | Class design | A complete class: instance variables, a constructor, and methods. |
| 3 | Data analysis with ArrayList | Methods that process an ArrayList of objects. |
| 4 | 2D array | Methods that process a two-dimensional array. |
| Total | 36 |
Unit 4, data collections, carries the most weight on the exam, and the ArrayList and 2D array questions are both from it.
How each question is scored (9 points)
| Row | Points | What earns it |
|---|---|---|
| Correctness of the algorithm | 6 | Six one-point pieces: declares the needed variables; loops over the correct range; tests the stated condition; updates the right variable on each pass; handles edge cases; returns the right value at the right time. |
| Use of the Java API and syntax | 2 | One point for using the given methods and the ArrayList and array syntax correctly; one for Java that would compile, with matching headers and declared variables. |
| Program design and encapsulation | 1 | Uses the class's own methods and keeps data private, as the question's design requires. |
| Total | 9 |
A worked method
Write a method that counts how many values in an array are multiples of k.
public static int countMultiples(int[] nums, int k)
{
int count = 0;
for (int n : nums)
{
if (n % k == 0)
{
count++;
}
}
return count;
}
| Point | Where it appears |
|---|---|
| Declares and initializes the accumulator | int count = 0; |
| Loops over the correct range | the enhanced for loop visits every element |
| Tests the stated condition | n % k == 0 |
| Updates on each qualifying pass | count++; |
| Returns the right value at the right time | return count; after the loop, not inside it |
Habits that protect points
- Read the method header and use it exactly. Do not change the name, parameters or return type.
- Call the methods the question gives you instead of rewriting them.
- Write the return statement after the loop unless the question asks you to stop early.
- Use length with no parentheses for an array, size() for an ArrayList, and grid[row][col] with the row first.
- Write something for every part. A partial algorithm still earns the pieces it has.
Common mistakes
- Returning inside the loop and leaving after the first element.
- Running a loop one step too far or too short, causing an out-of-bounds error.
- Removing from an ArrayList while moving forward through it, which skips elements.
- Mixing up rows and columns in a 2D array.
- Using a variable that was never declared.
Frequently asked questions
How many free-response questions are on AP Computer Science A?
Four, each scored out of 9, in 90 minutes. They are 45 percent of the exam score.
Do I have to write code that compiles?
Yes, as far as you can. One point per question depends on writing valid Java, but small syntax slips are treated gently.
Do comments matter?
No. Credit comes from the code, not from comments.
Can I use my own helper methods?
Yes, if you write them correctly, but calling the methods the question provides is safer.
Where can I find the official scoring rules?
Exam formats change a little from year to year, so check the current course and exam description on the College Board site before test day.
Keep practicing
The AP Computer Science A course has eight free-response prompts, two of each exam type, each with a coding space, the scoring notes, and the canonical solution explained point by point. These free lessons also build the skills the free-response section tests:
See the AP Computer Science A course Free lessons and lesson list
Other free-response guides:
AP is a registered trademark of the College Board, which is not affiliated with and does not endorse this site. This guide is our own explanation of the question types and scoring. For the official scoring guidelines, see the College Board.