---
title: "AP Computer Science A ArrayList FRQ Practice"
description: "26 Data Analysis with ArrayList questions written in the AP format, each scored part by part."
canonical: "https://fiveable.me/ap-comp-sci-a/frqs/arraylist"
type: "frq-type-practice"
subject: "AP Computer Science A"
---

# AP Computer Science A ArrayList FRQ Practice

## What the ArrayList FRQ asks

Data Analysis with ArrayList is FRQ 3 on the AP Computer Science A exam. You write one method that loops through an ArrayList of objects, filters them by one or more conditions, and returns a result like a count, sum, average, or maximum.

- **90 min**: for all four FRQs
- **5 points**: the fewest of the four FRQs
- **45%**: of your score, for all four FRQs

| Part | What it asks | Points |
| --- | --- | --- |
| A: One method | Five one-point checks, such as traversing the list, conditions on its objects, tracking a result, and the return value | 5 |

## How ArrayList FRQ practice works

1. **Read the full question.** The provided classes, the ArrayList, 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 5.** 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)
- [Temperature averaging with conditional filtering criteria](/ap-comp-sci-a/frq-practice?id=696fff71186db24911b37789&type=frq-3-data-analysis-with-arraylist)
- [Weather data filtering and average calculation](/ap-comp-sci-a/frq-practice?id=698a7802f06ff587401ec912&type=frq-3-data-analysis-with-arraylist)
- [Average pages by genre in collection](/ap-comp-sci-a/frq-practice?id=698a7850f06ff587401ec915&type=frq-3-data-analysis-with-arraylist)
- [Weather data filtering and averaging calculations](/ap-comp-sci-a/frq-practice?id=698a78abf06ff587401ec918&type=frq-3-data-analysis-with-arraylist)
- [Weather data filtering by precipitation threshold](/ap-comp-sci-a/frq-practice?id=698a790af06ff587401ec91a&type=frq-3-data-analysis-with-arraylist)
- [Object filtering and average price calculation](/ap-comp-sci-a/frq-practice?id=698a796df06ff587401ec91f&type=frq-3-data-analysis-with-arraylist)
- [Average temperature filtering by precipitation threshold](/ap-comp-sci-a/frq-practice?id=698a79cef06ff587401ec922&type=frq-3-data-analysis-with-arraylist)
- [Verified product reviews with minimum comment length](/ap-comp-sci-a/frq-practice?id=698a7a18f06ff587401ec926&type=frq-3-data-analysis-with-arraylist)
- [Express order costs by target zip code](/ap-comp-sci-a/frq-practice?id=698a7a63f06ff587401ec929&type=frq-3-data-analysis-with-arraylist)
- [Taxable items filtering and receipt calculation](/ap-comp-sci-a/frq-practice?id=698a7b40f06ff587401ec92f&type=frq-3-data-analysis-with-arraylist)
- [Average movie ratings by genre filtering](/ap-comp-sci-a/frq-practice?id=698a7b99f06ff587401ec931&type=frq-3-data-analysis-with-arraylist)
- [Student project finalist scores by subject](/ap-comp-sci-a/frq-practice?id=698a7bdcf06ff587401ec934&type=frq-3-data-analysis-with-arraylist)
- [Average duration of open rides with minimum threshold](/ap-comp-sci-a/frq-practice?id=698a7c36f06ff587401ec938&type=frq-3-data-analysis-with-arraylist)
- [Product filtering and discounted price generation](/ap-comp-sci-a/frq-practice?id=698a7ca6f06ff587401ec93a&type=frq-3-data-analysis-with-arraylist)
- [Stock price fluctuation detection and alerts](/ap-comp-sci-a/frq-practice?id=698a7d09f06ff587401ec93e&type=frq-3-data-analysis-with-arraylist)
- [Student honor roll average calculation with attendance criteria](/ap-comp-sci-a/frq-practice?id=698a7d49f06ff587401ec941&type=frq-3-data-analysis-with-arraylist)
- [Average duration of non-explicit songs above rating threshold](/ap-comp-sci-a/frq-practice?id=698a7da0f06ff587401ec944&type=frq-3-data-analysis-with-arraylist)
- [Flight cost calculation with duration constraints](/ap-comp-sci-a/frq-practice?id=698a7de1f06ff587401ec947&type=frq-3-data-analysis-with-arraylist)
- [Average pages calculation for genre-matched books](/ap-comp-sci-a/frq-practice?id=698a7e27f06ff587401ec94b&type=frq-3-data-analysis-with-arraylist)
- [Recurring donation amount filtering and averaging](/ap-comp-sci-a/frq-practice?id=698a7e79f06ff587401ec94d&type=frq-3-data-analysis-with-arraylist)
- [Filtering workouts by type and distance criteria](/ap-comp-sci-a/frq-practice?id=6a8fa1631d29f427d08615ac&type=frq-3-data-analysis-with-arraylist)
- [Sensor data threshold detection and alert generation](/ap-comp-sci-a/frq-practice?id=6a95bdacbe7dace4a055e1d5&type=frq-3-data-analysis-with-arraylist)
- [Grouping consecutive sensor readings by identifier](/ap-comp-sci-a/frq-practice?id=6a95ca1fac65e35e5ad67fca&type=frq-3-data-analysis-with-arraylist)
- [Sequential data validation and non-decreasing sequence enforcement](/ap-comp-sci-a/frq-practice?id=6a95cc28475322569b209bb7&type=frq-3-data-analysis-with-arraylist)
- [Data smoothing through interpolation of outlier gaps](/ap-comp-sci-a/frq-practice?id=6a95ccb4475322569b209bbf&type=frq-3-data-analysis-with-arraylist)
- [Sequential spam detection and paired message removal](/ap-comp-sci-a/frq-practice?id=6a95cdb9475322569b209bca&type=frq-3-data-analysis-with-arraylist)

## Sample question

**Temperature averaging with conditional filtering criteria**

Opening Text: 3. The DailyReading class represents weather data collected on a single day. A partial declaration of the DailyReading class is shown below.

Helper Class Code:
  Language: java
public class DailyReading
{
 /**
 * Returns the temperature in degrees Fahrenheit
 */
 public double getTemperature()
 { /* implementation not shown */ }

 /**
 * Returns the wind speed in miles per hour
 */
 public double getWindSpeed()
 { /* implementation not shown */ }

 /**
 * Returns true if rain was recorded, false otherwise
 */
 public boolean isRaining()
 { /* implementation not shown */ }

 /* There may be instance variables, constructors, and
 methods that are not shown. */
}

Main Class Code:
  Language: java
public class WeatherStation
{
 /** The list of daily weather readings */
 private ArrayList<DailyReading> readings;

 /**
 * Returns the average temperature of readings that meet the specified criteria.
 * Precondition: minWind >= 0.0
 * Postcondition: Returns the average temperature of readings where:
 * - The wind speed is greater than or equal to minWind
 * - AND (requireRain is false OR isRaining() is true)
 * Returns 0.0 if no readings meet the criteria.
 */
 public double averageTempWithCondition(boolean requireRain, double minWind)
 { /* to be implemented */ }

 /* There may be instance variables, constructors, and methods
 that are not shown. */
}

Task Description: Write the WeatherStation method averageTempWithCondition. This method calculates and returns the average temperature of the valid readings in the readings list. A reading is considered valid if it meets the wind speed requirement (at least minWind) and the rain requirement (if requireRain is true, the reading must be raining; if requireRain is false, the rain status does not matter).

Data Table Intro: Suppose readings contains the following five DailyReading objects.

Data Table:
  Headers: Index | 0 | 1 | 2 | 3 | 4
  Temperature | 70.0 | 80.0 | 60.0 | 90.0 | 65.0
  Wind Speed | 10.0 | 5.0 | 15.0 | 20.0 | 12.0
  Is Raining | true | false | true | false | true

Example Call:
  - Call: averageTempWithCondition(true, 11.0)
  - Return Value: 62.5
  - Explanation: The method considers only readings where isRaining() is true AND wind speed is >= 11.0. Index 0 fails the wind condition (10.0 < 11.0). Index 1 and 3 fail the rain condition. Index 2 (Wind 15.0, Rain true) and Index 4 (Wind 12.0, Rain true) are valid. The average of their temperatures (60.0 and 65.0) is 62.5.

Completion Instruction: Complete method averageTempWithCondition.

Method Signature Block:
  Language: java
/**
 * Returns the average temperature of readings that meet the specified criteria.
 * Precondition: minWind >= 0.0
 * Postcondition: Returns the average temperature of readings where:
 * - The wind speed is greater than or equal to minWind
 * - AND (requireRain is false OR isRaining() is true)
 * Returns 0.0 if no readings meet the criteria.
 */
public double averageTempWithCondition(boolean requireRain, double minWind)

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

**Can I use brackets to get elements from the list?**

No. This question uses an ArrayList, so access elements with get() and size(), or an enhanced for loop. Bracket syntax only works on arrays.

**Do I build the ArrayList myself?**

No. The question gives you the list, as an instance variable or a parameter. You loop through it, call methods on its objects, and return the result.

**How is FRQ 3 different from FRQ 4?**

FRQ 3 works with an ArrayList and is worth 5 points. FRQ 4 works with a 2D array, usually with nested loops, and is worth 6.

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

## Related

- [ArrayList FRQ exam guide](/ap-comp-sci-a/ap-computer-science-a-exam/ap-comp-sci-a-frq-3-data-analysis-with-arraylist/study-guide/ap-comp-sci-a-frq-3-data-analysis-with-arraylist)
- [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 2D Array FRQ practice](/ap-comp-sci-a/frqs/2d-array)
- [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`)
