AP Computer Science A Exam Guide and Review
AP Computer Science A Exam Guide and Review
- 63-page guide
- 4 course units
- 3-hour exam
AP Computer Science A asks you to read and develop Java code, track object state, choose legal control flow, design classes, and work safely with Strings, arrays, ArrayList objects, and two-dimensional arrays. This page turns the book into a compact study route while keeping the full guide available as the included PDF.
- Know the format. Budget 90 minutes for 42 multiple-choice questions and 90 minutes for four free-response questions.
- Trace before coding. Record inputs, state changes, loop bounds, and returned values separately.
- Write complete Java. Include every requested header, mutation, boundary guard, and return path.
- Use the reference wisely. The exam supplies a Java Quick Reference, but you still need to know Java syntax and behavior.
Review the units in their published order
The percentages below are ranges for the multiple-choice section, not shares of the whole exam and not promised question counts. Use them to balance practice, then keep every unit in mixed review because its Java decisions support later work.
Three hours split evenly between reading and writing code
The multiple-choice section rewards precise tracing and rule-based elimination. Every free-response question assesses Develop Code, so a response must turn the stated requirements into complete Java rather than only predict output.
| Complete exam | 3 hours |
|---|---|
| Multiple choice | 42 questions · 90 minutes · 55% of the exam score |
| Free response | 4 questions · 90 minutes · 45% of the exam score |
| Role | Points | What a complete response must coordinate |
|---|---|---|
| Methods and Control Structures | 7 | Helper calls, selection or iteration, state updates, and returns |
| Class Design | 7 | Class header, private fields, constructor, public method, and valid behavior on every path |
| Data Analysis with ArrayList | 5 | Legal traversal, accessors, conditions, accumulation, and a computed result |
| 2D Array | 6 | Row-column traversal, element processing, tracked state, and the requested return |
Official exam information (as of 2026-08-12): College Board AP Computer Science A exam page. Check the official page again before test day because administration details can change.
Find the earliest complete run
- Step 1At index 0, false resets run to 0.
- Step 2Indices 1, 2, and 3 raise run to 1, 2, and 3.
- Step 3The run ends at index 3, so the start is 3 - 3 + 1 = 1.
- Step 4The success return occurs before index 4; the failure sentinel is never reached.
public class Main {
static int firstRun(boolean[] open, int need) {
int run = 0;
for (int i = 0; i < open.length; i++) {
run = open[i] ? run + 1 : 0;
if (run == need) return i - need + 1;
}
return -1;
}
public static void main(String[] args) {
boolean[] a = {false, true, true, true, false};
System.out.println(firstRun(a, 3));
}
}The loop stores the length of the current consecutive run. A false element resets that state. When the run first reaches the required length, the current index is the end of the run, so subtracting the needed length and adding one converts the end position to the starting position. The failure value appears only after the complete scan.
| Index | Value | run after update | Decision |
|---|---|---|---|
| 0 | false | 0 | Keep scanning |
| 1 | true | 1 | Keep scanning |
| 2 | true | 2 | Keep scanning |
| 3 | true | 3 | Return 3 - 3 + 1 = 1 |
An empty array executes the loop zero times and returns -1. A run that finishes at the final array position still succeeds. The conversion is end index - needed length + 1, not end index - needed length. The method reads the supplied array without replacing it or changing its elements.
| Author-created practice check | Model element | Common error | Author-created credit (not official AP credit) |
|---|---|---|---|
| Traversal | Visits indices 0 through open.length - 1 | Uses <= open.length or omits the final index | 1 point when present |
| Run state | Increments on true and resets on false | Never resets after a break | 1 point when present |
| Success | Returns the earliest converted start | Returns the ending index | 1 point when present |
| Failure | Returns -1 only after the full scan | Returns -1 after the first false | 1 point when present |
This table is an independently written practice checklist, not an official AP scoring guide. Use it to point to the exact code that supplies each behavior, then test the method with an empty array, a run at the beginning, a run at the end, and an input with no complete run.
Fourteen terms to use precisely
These definitions come from the book’s unit glossary pages. Connect each word to code: identify the receiver of a call, the lifetime of state, the legal index interval, and whether an assignment copies a primitive value or creates another reference to the same object.
- object
- A class instance that holds state and can receive method calls.
- method
- Named behavior called with a receiver or through a class when static.
- receiver
- The object written before the dot in an instance-method call.
- argument
- A value or expression supplied to a method parameter.
- return value
- The result sent from a non-void method to its caller.
- String
- An object representing a sequence of characters.
- substring
- A contiguous portion selected with an inclusive start and exclusive end.
- instance state
- Field values belonging to one object at a particular time.
- reference
- A value that identifies an object rather than copying its contents.
- alias
- A second variable that refers to the same mutable object.
- selection
- A condition-controlled choice among execution paths.
- iteration
- Repeated execution while a loop condition permits it.
- array
- A fixed-length indexed container accessed with brackets.
- ArrayList
- A resizable indexed list accessed through methods such as get and add.
What to expect and how to use this guide
How is the AP Computer Science A exam organized?
The exam lasts 3 hours. The 42-question multiple-choice section lasts 90 minutes and contributes 55%; the four-question free-response section lasts 90 minutes and contributes 45%.
What are the free-response question roles?
The roles are Methods and Control Structures, Class Design, Data Analysis with ArrayList, and Two-Dimensional Array.
What skill is required across the free-response section?
All 4 free-response questions assess Develop Code, so practice turning requirements into complete methods and classes rather than only predicting output.
How many units are in AP Computer Science A?
The course has four units: Using Objects and Methods, Selection and Iteration, Class Creation, and Data Collections.
What do the unit weighting ranges describe?
They describe each unit's share of the multiple-choice section. Use the ranges to balance practice without treating them as exact question counts.
How should I check free-response code?
Trace the method requirements, state changes, loop bounds, and return behavior. Then test normal, boundary, and empty-data cases against the prompt.
Is a Java Quick Reference provided during the exam?
Yes. The exam provides a Java Quick Reference in both sections, but it does not teach the language for you. You still need to know Java syntax, loop and array rules, and when to use == or equals.
Are official multiple-choice questions included in the publicly available materials?
No. The publicly available materials used for this guide contain no officially released AP Computer Science A multiple-choice questions. The book's multiple-choice structure pages explain the official framework; they are not past exam questions.
Are the Java programs copied from past exam questions?
No. Every setting, value, and runnable program is independently written for this guide.
Use four passes to turn tracing into reliable code
Pass 1: map the exam and units. Learn the two 90-minute sections, then use the published multiple-choice ranges to balance the four units. Keep a short mixed set in every session so earlier object and control-flow skills remain available when you reach classes and collections.
Pass 2: trace before you write. For every short program, record the receiver, arguments, returned value, side effects, loop interval, and each state update. Stop at the moment the question asks about; an extra imagined iteration is a common reason a plausible answer becomes wrong.
Pass 3: build complete responses. Translate the prompt into inputs, persistent state, required mutations, and output. Write the requested class or method in full, then test empty data, first and final positions, an absent target, consecutive matches, repeated calls, and shared references.
Pass 4: audit with the real exam tools. Practice locating a method signature on the Java Quick Reference, but also practice without looking up language rules that the sheet does not teach. Finish timed work by checking syntax, bounds, state, and return behavior in that order.
Official course information (as of 2026-08-12): College Board AP Computer Science A course page.