AP Computer Science A 2D Array FRQ Practice
26 2D Array questions written in the AP format. Pick one, read the full question, and write your Java method.
Your first scored response is included. A plan unlocks unlimited scoring.
26 questions
sorted by unit
Two-dimensional array column minimum calculation
Unit 4: Data Collections
- This question involves managing a classroom seating chart represented by a two-dimensional array of Student objects. The seating chart tracks student attendance, where each Student object maintains a record of their total absences. You will write a method in the SeatingChart class to analyze attendance patterns across the classroom.
public class Student
{
/** Returns the number of times this student has been absent. */
public int getAbsenceCount()
{ /* implementation not shown */ }
// There may be instance variables, constructors, and methods that are not shown.
}public class SeatingChart
{
/** The two-dimensional array of student objects representing the seating chart. */
private Student[][] seats;
/**
* Returns the index of the column with the fewest total absences.
* If there is a tie, returns the lowest index.
* Precondition: seats contains at least one row and one column.
* seats contains no null references.
*/
public int columnWithFewestAbsences()
{ /* to be implemented */ }
// There may be instance variables, constructors, and methods that are not shown.
}When an element of the two-dimensional array seats is accessed, the first index is used to specify the row and the second index is used to specify the column.
Write the columnWithFewestAbsences method, which identifies the column in the seating chart with the lowest total number of absences among all students in that column. The method should traverse the 2D array to calculate the total absences for each column and return the index of the column with the minimum total. If multiple columns have the same minimum total, return the smallest index among them.
Suppose seats has the following contents, where each cell shows the Student name and their absence count in parentheses:
Row | 0 | 1 | 2 |
|---|---|---|---|
0 | Alex (2) | Ben (0) | Cathy (5) |
1 | Dana (3) | Eva (1) | Fred (0) |
2 | Gina (1) | Hank (4) | Iris (2) |
Call: columnWithFewestAbsences()
Expected Return: should return 1
Explanation: Column 0 total: 2+3+1 = 6. Column 1 total: 0+1+4 = 5. Column 2 total: 5+0+2 = 7. The minimum total is 5, which corresponds to column index 1.
Write the columnWithFewestAbsences method below.
/**
* Returns the index of the column with the fewest total absences.
* If there is a tie, returns the lowest index.
* Precondition: seats contains at least one row and one column.
* seats contains no null references.
*/
public int columnWithFewestAbsences()What the 2D Array FRQ asks
The 2D Array question is FRQ 4 on the AP Computer Science A exam. You write one method that traverses a 2D array, usually of objects, row by row or column by column, and analyzes or changes the data in the grid.
- 90 min
- for all four FRQs
- 6 points
- of the section’s 25
- 45%
- of your score, for all four FRQs
Part A: One method
Six one-point checks, such as row and column traversal, element access, comparisons, counting, and the return value
6 pts
How 2D Array FRQ practice works
Each question follows the exam’s format, from the full prompt to a score on every part.
Read the full question
The class, the 2D array, and the method you write, laid out the way the exam shows them.
Write on a 23-minute timer
A pace that fits all four questions into the 90-minute section. Pause it or turn it off, and your response saves as you go.
Submit for a score out of 6
Your response is scored against the scoring guidelines written for that question. Your first score is included.
Feedback on every part
A summary at the top tells you what to work on next. Below it, each part shows whether you earned the point and what the scoring guidelines were looking for.
Detailed Feedback
Part A: 1/1 point
Earned the point. You correctly used a `for` loop to traverse all rows of the `shelves` 2D array.
Part A: 1/1 point
Earned the point. You correctly used a nested `for` loop to traverse all columns within each row of the `shelves` array.
Part A: 0/1 point
Did not earn the point. While you correctly used `>` to compare the current row's count to the maximum count (`genreCount`), you updated the maximum count using `genreCount += count;` instead of `genreCount = count;`. This accumulates the counts rather than storing the true maximum, which will lead to incorrect results if a later row has a higher count than the previous max but lower than the accumulated sum.
Questions about the 2D Array FRQ
How many responses can I get scored?
You can read every question without a plan. Your first scored response is included. A plan unlocks unlimited scoring.
Which index comes first in a 2D array?
The row. Write arr[row][col] every time, even when your outer loop walks the columns.
How is FRQ 4 different from FRQ 3?
FRQ 4 works with a 2D array, usually with nested loops, and is worth 6 points. FRQ 3 works with an ArrayList and is worth 5.
Can I type Java in the editor?
Yes. Type your code the way you would on the digital exam. The Java Quick Reference is available while you write.
Are these real College Board questions?
No. We wrote them in the AP format, with the same single method to write, and wrote scoring guidelines for each one.
More AP Computer Science A practice
Methods FRQ practice
Methods and Control Structures questions with the full class and both parts.
Class Design FRQ practice
Class Design questions with the full specification and examples table.
ArrayList FRQ practice
ArrayList questions with the provided classes and the method to write.
AP Computer Science A FRQs
Every FRQ type for AP Computer Science A, with practice for each.
Write your first 2D Array FRQ
Pick one from the list, or let us choose for you.
Teaching AP Computer Science A? Assign these 2D Array FRQs to your class

