• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar

JavaTutorOnline

1-on-1 Online Java Training by a Senior Software Engineer

  • Home
  • AP CSA
    • FRQ Practice
      • Arrays
      • ArrayList
      • Strings
      • 2D Arrays
  • Courses
  • Tutorials
    • Java
    • Servlets
    • Struts
    • Spring
    • Webservice
  • FAQ
  • Testimonials
  • Blog
  • CONTACT US

AP Computer Science A Mixed FRQ Practice

AP Computer Science A Mixed Topic FRQ Practice Banner

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)

Hard – Exam Level
Problem Setup:

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.

Approach:
  • Instantiate a new, empty ArrayList<String> to store matching names.
  • Iterate through the roster list using an enhanced for-loop.
  • For each Student, retrieve their scores array using getScores().
  • Traverse the 1D array. As soon as a score satisfies score >= minScore, add the student’s name to the result list and break the inner loop to avoid duplicate entries.
Java Solution:
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;
}
Common Exam Mistakes:
  • Forgetting the break statement, which causes a student’s name to be added multiple times if they have more than one qualifying score.
  • Trying to directly access s.scores instead of calling the accessor method s.getScores().
  • Forgetting to instantiate new ArrayList<String>() before the loop.

Mixed FRQ 2 — Theater Reservation Grid (2D Arrays + ArrayList + Strings)

Hard – Exam Level
Problem Setup:

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, or null if available.
  • public void cancelReservation() — resets the seat to available (sets customer name to null).

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.

Approach:
  • 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 potential null values safely).
  • If a match is found, invoke cancelReservation() and increment the counter.
Java Solution:
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;
}
Common Exam Mistakes:
  • Comparing strings using == instead of .equals().
  • Calling getCustomerName().equals(...) without checking for null, leading to a NullPointerException. Calling customerName.equals(...) avoids this.
  • Using incorrect row/column boundaries in nested loops (e.g., using seatingChart.length for columns).

Mixed FRQ 3 — E-Commerce Inventory (Inheritance + Polymorphism + ArrayList)

Hard – Exam Level
Problem Setup:

An inventory system contains a base class Item and a subclass DiscountedItem.

  • Item has a method public double getPrice().
  • DiscountedItem extends Item and has an additional method public 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.

Approach:
  • Initialize an accumulator variable double totalSavings = 0.0.
  • Traverse itemList using an enhanced for-loop.
  • Use the instanceof operator to check if an Item is an instance of DiscountedItem.
  • Cast the Item object to DiscountedItem to call getDiscountAmount() and add it to the running total.
Java Solution:
public double calculateTotalSavings() {
    double totalSavings = 0.0;
    
    for (Item item : itemList) {
        if (item instanceof DiscountedItem) {
            DiscountedItem dItem = (DiscountedItem) item;
            totalSavings += dItem.getDiscountAmount();
        }
    }
    
    return totalSavings;
}
Common Exam Mistakes:
  • Attempting to call item.getDiscountAmount() directly on an Item reference without casting (causes a compilation error).
  • Casting to DiscountedItem without checking instanceof first, which causes a ClassCastException for 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

  • Arrays FRQ Practice
  • ArrayList FRQ Practice
  • Strings FRQ Practice
  • 2D Arrays FRQ Practice

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/

Primary Sidebar

Mr Chinmay

Chinmay Patel
Online Java Tutor-Demo Class

Phone & Whatsapp +919853166385
javatution@gmail.com

Recent Posts

  • Learn Java in One Day: 1-on-1 Private Crash Course
  • Constructor in Java and Overloaded Constructor Example Program
  • Important Interview Questions on Java Multithreading
  • React Spring Boot Web Services Integration
  • Spring Boot RESTful Web Services Example
  • Top Spring MVC Interview Questions and Answers for Developers
  • Top Spring Core Interview Questions and Answers for Developers
  • Host Java Web Apps for Free on Mobile with Tomcat and Termux
  • How to Deploy Java Web Application on Aws EC2 with Elastic IP
  • Simple Jsp Servlet Jdbc User Registration using Tomcat Mysql and Eclipse

Additional Resources

  • AP Computer Science A Summer Prep
Copyright © 2026 JavaTutorOnline