# AP Computer Science A: The Array and ArrayList Questions That Decide Your Score
AP Computer Science A has a 5-rate around 24-27%. The exam tests Java programming — not computer science theory. If you can write clean Java code that handles arrays, ArrayLists, and 2D arrays, you're positioned for a 5.
Exam Structure
3 hours: 40 MCQs (90 min) and 4 FRQs (90 min). The FRQs require you to write Java code by hand. One FRQ is always about array/ArrayList manipulation. One always involves writing a class. The other two typically cover 2D arrays and interfaces/inheritance.
The Java Subset You Must Know
AP CSA uses a limited subset of Java. You need:
You do NOT need: try/catch, file I/O, Scanner, generics beyond ArrayList, lambda expressions, or data structures beyond arrays/ArrayLists.
The FRQ Patterns
**Array/ArrayList FRQ**: You'll traverse an array or ArrayList and perform operations — filtering, transforming, or searching. Common tasks: remove elements that meet a condition (careful with index shifting when removing from ArrayList during traversal), find the longest consecutive sequence, or compute a running total.
**Class Writing FRQ**: You'll implement a class with instance variables, constructors, and methods. Follow encapsulation: private instance variables, public methods. The specifications tell you exactly what to write.
**2D Array FRQ**: Nested loops. Row-major traversal vs. column-major. Common tasks: find the row with the largest sum, check for a pattern, or modify a grid.
The #1 Mistake
Off-by-one errors in array traversal. Arrays are 0-indexed, length is the count (last index = length - 1). When removing from an ArrayList in a loop, traverse backwards to avoid skipping elements.
**Drill**: Write a method that takes an ArrayList<Integer> and removes all values less than the average. Handle the size change during removal. Test it mentally with [3, 7, 2, 8, 1, 9]. Time: 10 minutes.
Take the free AP Computer Science A diagnostic at quantumlearningmachines.com/free-diagnostic?exam=ap-csa — 15 minutes, no signup.