---
title: "AP Computer Science A 2D Array FRQ Practice"
description: "26 2D Array questions written in the AP format, each scored part by part."
canonical: "https://fiveable.me/ap-comp-sci-a/frqs/2d-array"
type: "frq-type-practice"
subject: "AP Computer Science A"
---

# AP Computer Science A 2D Array FRQ Practice

## 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 | What it asks | Points |
| --- | --- | --- |
| A: One method | Six one-point checks, such as row and column traversal, element access, comparisons, counting, and the return value | 6 |

## How 2D Array FRQ practice works

1. **Read the full question.** The class, the 2D array, and the method you write, laid out the way the exam shows them.
2. **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.
3. **Submit for a score out of 6.** Your response is scored against the scoring guidelines written for that question. Your first score is included.

## All 26 questions

### Unit 4: Data Collections (26)
- [Two-dimensional array column minimum calculation](/ap-comp-sci-a/frq-practice?id=696809bdb2e1f5f8340cbd99&type=frq-4-2d-array)
- [Column with most matching category items](/ap-comp-sci-a/frq-practice?id=698a77f7f06ff587401ec910&type=frq-4-2d-array)
- [Array row searching and maximum value identification](/ap-comp-sci-a/frq-practice?id=698a7840f06ff587401ec914&type=frq-4-2d-array)
- [Theater seating availability by tier level](/ap-comp-sci-a/frq-practice?id=698a78a2f06ff587401ec917&type=frq-4-2d-array)
- [Two-dimensional array terrain type frequency](/ap-comp-sci-a/frq-practice?id=698a790cf06ff587401ec91b&type=frq-4-2d-array)
- [Two-dimensional array column brightness comparison](/ap-comp-sci-a/frq-practice?id=698a796cf06ff587401ec91e&type=frq-4-2d-array)
- [Row with maximum heavy boxes](/ap-comp-sci-a/frq-practice?id=698a79bff06ff587401ec921&type=frq-4-2d-array)
- [Gem board column analysis by type frequency](/ap-comp-sci-a/frq-practice?id=698a7a0ef06ff587401ec924&type=frq-4-2d-array)
- [Array iteration and conditional row matching logic](/ap-comp-sci-a/frq-practice?id=698a7a54f06ff587401ec928&type=frq-4-2d-array)
- [Library shelf indexing by genre frequency](/ap-comp-sci-a/frq-practice?id=698a7aa5f06ff587401ec92b&type=frq-4-2d-array)
- [Grid column enemy type frequency comparison](/ap-comp-sci-a/frq-practice?id=698a7b0af06ff587401ec92c&type=frq-4-2d-array)
- [Grid sensor network alert threshold analysis](/ap-comp-sci-a/frq-practice?id=698a7b4ff06ff587401ec930&type=frq-4-2d-array)
- [2D array traversal and row maximum calculation](/ap-comp-sci-a/frq-practice?id=698a7ba5f06ff587401ec932&type=frq-4-2d-array)
- [2D array row search for product category frequency](/ap-comp-sci-a/frq-practice?id=698a7c1cf06ff587401ec936&type=frq-4-2d-array)
- [2D array traversal, row weight calculation](/ap-comp-sci-a/frq-practice?id=698a7cfbf06ff587401ec93d&type=frq-4-2d-array)
- [Student seating arrangement by grade level distribution](/ap-comp-sci-a/frq-practice?id=698a7d59f06ff587401ec942&type=frq-4-2d-array)
- [Array iteration, conditional logic, crop yield comparison](/ap-comp-sci-a/frq-practice?id=698a7dbcf06ff587401ec946&type=frq-4-2d-array)
- [Column frequency analysis and index retrieval](/ap-comp-sci-a/frq-practice?id=698a7e10f06ff587401ec94a&type=frq-4-2d-array)
- [Row index with most matching items](/ap-comp-sci-a/frq-practice?id=698a7e56f06ff587401ec94c&type=frq-4-2d-array)
- [Column with most product occurrences](/ap-comp-sci-a/frq-practice?id=698a7ebef06ff587401ec950&type=frq-4-2d-array)
- [Row index with highest crop yield total](/ap-comp-sci-a/frq-practice?id=6a8fa1e17916c23402a7825b&type=frq-4-2d-array)
- [Grid column containing most artifact occurrences](/ap-comp-sci-a/frq-practice?id=6a95bc7dc47cb06e5537dffc&type=frq-4-2d-array)
- [Row-major adjacent-pair search and reference exchange](/ap-comp-sci-a/frq-practice?id=6a95cfcb796870612d4becff&type=frq-4-2d-array)
- [In-place cyclic rotation of a selected 2D column interval](/ap-comp-sci-a/frq-practice?id=6a95d021796870612d4bed06&type=frq-4-2d-array)
- [Conditional in-place reversal of 2D array rows](/ap-comp-sci-a/frq-practice?id=6a95d09efb74cd0d671872fc&type=frq-4-2d-array)
- [Overlapping uniform 2-by-2 neighborhood detection](/ap-comp-sci-a/frq-practice?id=6a95d0b7fb74cd0d671872ff&type=frq-4-2d-array)

## Sample question

**Two-dimensional array column minimum calculation**

Opening Text: 4. 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.

Helper Class Code:
  Language: java
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.
}

Main Class Code:
  Language: java
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.
}

Array Access Note: 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.

Task Description: 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.

Grid Visualization Intro: Suppose seats has the following contents, where each cell shows the Student name and their absence count in parentheses:

Grid Visualization:
  Headers: 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)

Expected Behavior:
  - 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.

Completion Instruction: Write the columnWithFewestAbsences method below.

Method Signature Block:
  Language: java
/**
 * 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()

## Questions

**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.

## Related

- [2D Array FRQ exam guide](/ap-comp-sci-a/ap-computer-science-a-exam/ap-comp-sci-a-frq-4-2d-array/study-guide/ap-comp-sci-a-frq-4-2d-array)
- [AP Computer Science A Methods FRQ practice](/ap-comp-sci-a/frqs/methods-and-control-structures)
- [AP Computer Science A Class Design FRQ practice](/ap-comp-sci-a/frqs/class-design)
- [AP Computer Science A ArrayList FRQ practice](/ap-comp-sci-a/frqs/arraylist)
- [AP Computer Science A FRQs](/ap-comp-sci-a/frqs)
- Any question by id: the `get_frq` tool on the [Fiveable MCP server](/mcp/docs)

## About This Document

Canonical Fiveable pages are available as Markdown at the same path plus `.md`.

- [llms.txt](https://fiveable.me/llms.txt): index of Fiveable's sections and URL patterns
- [llms-full.txt](https://fiveable.me/llms-full.txt): complete subject and unit listing
- [MCP server](https://fiveable.me/mcp): call Fiveable as tools instead of fetching pages (`https://fiveable.me/api/mcp`)
- [MCP server for AP teachers](https://fiveable.me/mcp/teachers): a teacher's classes, assignments and AP-rubric grading (`https://fiveable.me/api/mcp/teacher`)
