
The Free Response section of the AP Computer Science A exam rarely tests concepts in isolation. Questions 3 and 4 specifically evaluate your ability to combine multiple concepts—such as traversing 1D Arrays inside an ArrayList of custom Objects, or navigating 2D Arrays using dynamic class methods.
This page provides exam-level Mixed Topic FRQ practice questions designed to prepare you for the true difficulty and layout of the official AP Exam.
Why Practice Mixed Topic FRQs?
- Simulates Real AP Questions: Reflects the exact structure of Questions 3 & 4 on the AP CSA exam.
- Tests Object Encapsulation: Teaches you to call getter methods rather than illegally accessing private fields.
- Combines Data Structures: Integrates fixed-length Arrays, dynamic ArrayLists, and 2D Grids.
- Sharpens Tracing Skills: Helps you avoid off-by-one and null pointer errors across complex object structures.
Mixed FRQ 1 — Student Gradebook (ArrayList + Arrays + Objects)
A school gradebook system uses a Student class to represent individual student performance. Each Student object stores a student’s name and a 1D array of their exam scores (int[] scores).
The Student class provides the following methods:
public int[] getScores()— returns the array of exam scores.public String getName()— returns the student’s name.
Write the Gradebook method getTopPerformers(ArrayList<Student> roster, int minScore). This method returns a new ArrayList<String> containing the names of all students who have at least one exam score greater than or equal to minScore.
- Instantiate a new, empty
ArrayList<String>to store matching names. - Iterate through the
rosterlist using an enhanced for-loop. - For each
Student, retrieve theirscoresarray usinggetScores(). - Traverse the 1D array. As soon as a score satisfies
score >= minScore, add the student’s name to the result list andbreakthe inner loop to avoid duplicate entries.
public ArrayList<String> getTopPerformers(ArrayList<Student> roster, int minScore) {
ArrayList<String> result = new ArrayList<String>();
for (Student s : roster) {
int[] scores = s.getScores();
for (int score : scores) {
if (score >= minScore) {
result.add(s.getName());
break; // Stop checking this student's remaining scores to prevent duplicates
}
}
}
return result;
}- Forgetting the
breakstatement, which causes a student’s name to be added multiple times if they have more than one qualifying score. - Trying to directly access
s.scoresinstead of calling the accessor methods.getScores(). - Forgetting to instantiate
new ArrayList<String>()before the loop.
Mixed FRQ 2 — Theater Reservation Grid (2D Arrays + ArrayList + Strings)
A seating reservation system maintains a 2D array of Seat objects representing a theater layout (Seat[][] seatingChart). The Seat class has the following methods:
public String getCustomerName()— returns the name of the person who reserved the seat, ornullif available.public void cancelReservation()— resets the seat to available (sets customer name tonull).
Write the Theater method cancelCustomerBookings(String customerName). The method must search the entire seatingChart grid, call cancelReservation() on every seat booked under customerName, and return the total number of canceled seats.
- Initialize a counter variable to
0. - Use nested for-loops (row-major order) to traverse the 2D array
seatingChart. - Check if the seat is occupied by comparing
getCustomerName()using.equals()(handling potentialnullvalues safely). - If a match is found, invoke
cancelReservation()and increment the counter.
public int cancelCustomerBookings(String customerName) {
int canceledCount = 0;
for (int r = 0; r < seatingChart.length; r++) {
for (int c = 0; c < seatingChart[r].length; c++) {
Seat currentSeat = seatingChart[r][c];
// Check that seat exists and customer name matches safely
if (currentSeat != null && customerName.equals(currentSeat.getCustomerName())) {
currentSeat.cancelReservation();
canceledCount++;
}
}
}
return canceledCount;
}- Comparing strings using
==instead of.equals(). - Calling
getCustomerName().equals(...)without checking fornull, leading to aNullPointerException. CallingcustomerName.equals(...)avoids this. - Using incorrect row/column boundaries in nested loops (e.g., using
seatingChart.lengthfor columns).
Mixed FRQ 3 — E-Commerce Inventory (Inheritance + Polymorphism + ArrayList)
An inventory system contains a base class Item and a subclass DiscountedItem.
Itemhas a methodpublic double getPrice().DiscountedItemextendsItemand has an additional methodpublic double getDiscountAmount().
An Inventory class maintains an ArrayList<Item> itemList containing a mixture of regular Item objects and DiscountedItem objects.
Write the Inventory method calculateTotalSavings(), which traverses itemList and returns the total dollar amount saved across all discounted items in the inventory.
- Initialize an accumulator variable
double totalSavings = 0.0. - Traverse
itemListusing an enhanced for-loop. - Use the
instanceofoperator to check if anItemis an instance ofDiscountedItem. - Cast the
Itemobject toDiscountedItemto callgetDiscountAmount()and add it to the running total.
public double calculateTotalSavings() {
double totalSavings = 0.0;
for (Item item : itemList) {
if (item instanceof DiscountedItem) {
DiscountedItem dItem = (DiscountedItem) item;
totalSavings += dItem.getDiscountAmount();
}
}
return totalSavings;
}- Attempting to call
item.getDiscountAmount()directly on anItemreference without casting (causes a compilation error). - Casting to
DiscountedItemwithout checkinginstanceoffirst, which causes aClassCastExceptionfor regular items.
Frequently Asked Questions
Q: What are Mixed Topic FRQs on the AP Computer Science A Exam?
A: Mixed Topic FRQs are AP CSA exam-style Free Response Questions that test multiple Java concepts simultaneously—such as manipulating 1D Arrays inside an ArrayList of custom Objects, or traversing 2D Arrays using class methods.
Q: Why are multi-topic questions critical for AP CSA Question 3 and Question 4?
A: Questions 3 and 4 on the official AP CSA exam rarely test concepts in isolation. They evaluate a student’s ability to navigate object encapsulation, array bounds, and loop structures in a single cohesive problem.
Related FRQ Practice Resources
Need Guided Help With AP Computer Science A?
Mastering multi-concept FRQs requires clear debugging strategies and hands-on guidance. If you want 1-on-1 tutoring support to prepare for your exam, explore our specialized training program:
AP Computer Science A Online Tutoring Program
https://www.javatutoronline.com/training-courses/ap-computer-science-tutor/