AP CSA FRQ 3 and 4: ArrayList and 2D Array Strategy
A practical guide to AP CSA FRQ 3 and 4: pick the traversal first, avoid index-shift mistakes, and check the edge cases before you move on.
Read it to name the pattern, then practice while it is still fresh.
Prepared by Askiras editorial team . These guides stay short on purpose: one pattern, one worked example, one clear next step into practice. How we build guides.
FRQ 3 and FRQ 4 are where AP CSA stops forgiving vague thinking
Students often feel decent about arrays and ArrayList in class, then lose control of them on the exam.
That usually happens for one reason: they know the topic, but they do not have a reliable traversal plan.
FRQ 3 and FRQ 4 reward students who can decide:
- what order to visit the data
- whether the structure is being read or changed
- which dimension or index actually matters
Once that is clear, the questions get much simpler.
Start with the classic ArrayList trap
Suppose you want to remove negative numbers from a list.
A shaky version looks like this:
for (int i = 0; i < list.size(); i++) {
if (list.get(i) < 0) {
list.remove(i);
}
}
That looks reasonable. It is also dangerous.
Because once an element is removed, the remaining elements shift left.
Then the loop increments i, and the next element can get skipped.
That is one of the central AP CSA collection lessons: when the structure changes, your traversal logic has to change with it.
What FRQ 3 and FRQ 4 usually ask for
FRQ 3: Data Analysis with ArrayList
This question usually wants you to:
- traverse the list
- inspect values or objects
- add, update, or remove in a controlled way
- build or return a result that matches the spec
FRQ 4: 2D Array
This question usually wants you to:
- traverse a grid
- compute or update a value
- use row and column indexes correctly
- return or modify exactly what the prompt asks for
Neither question is mostly about advanced theory. Both are mostly about execution discipline.
FRQ 3 protocol: decide read-only or mutation first
Before writing code for an ArrayList FRQ, ask:
Is this method only reading the list, or is it changing the list?
That one decision shapes the whole loop.
If the list is read-only
You can often use:
- an indexed
forloop - or an enhanced
forloop
This is common for:
- counting
- summing
- finding a maximum
- building a separate answer
If the list is being changed
Slow down.
Now you need to think about:
- insertion
- removal
- replacement
- index shifting
This is where an indexed loop is usually safer.
Know the method behaviors cold
A lot of FRQ 3 mistakes come from fuzzy ArrayList method knowledge.
You should be clear on these:
add(value)appendsadd(index, value)insertsget(index)readsset(index, value)replacesremove(index)deletes and shifts later elementssize()gives the number of elements
If you blur add and set, or forget what remove does to indexes, the rest of the logic usually collapses.
A strong FRQ 3 example mindset
Suppose the prompt wants:
- remove every score below 60
The first thing to decide is not the if statement.
It is the traversal.
A safer structure is:
for (int i = list.size() - 1; i >= 0; i--) {
if (list.get(i) < 60) {
list.remove(i);
}
}
Why backward?
Because removing an item does not disturb the still-unvisited part of the list.
That is the kind of reasoning AP CSA wants to see.
FRQ 4 protocol: name the dimensions before you code
For 2D arrays, say this out loud:
grid.lengthis the number of rowsgrid[0].lengthis the number of columns
If you do not lock that in first, row-column mistakes become much more likely.
Then ask:
- Am I moving row by row?
- Am I moving column by column?
- Do I need every cell, one row, one column, or one pattern like a diagonal?
That tells you what the loops should look like.
The standard FRQ 4 shape
A lot of 2D array FRQs are really just one of these jobs:
- sum or count part of the grid
- check a condition across rows or columns
- update selected cells
- build a return value from a traversal
For example:
int total = 0;
for (int r = 0; r < grid.length; r++) {
for (int c = 0; c < grid[r].length; c++) {
total += grid[r][c];
}
}
return total;
That is row-major traversal. The points usually disappear when students put one piece in the wrong place.
The biggest FRQ 4 mistakes
Mixing up rows and columns
Using grid.length when you need the column count is one of the most common AP CSA misses.
Returning too early
Students accidentally place return total; inside the outer loop.
Then the method exits after the first row.
Updating the wrong cell
They understand the broad task but write grid[c][r] when the traversal was built around grid[r][c].
These are usually control problems, not knowledge problems.
Use the prompt examples as test cases
Before you move on, ask:
- What happens if the list is empty?
- What happens if two removable items are next to each other?
- What happens if the matching value is in the first or last position?
- What happens if the grid has one row?
- What happens if the target is in the final column?
You do not need a full test suite. You do need one or two mental test cases before leaving the question.
A clean checklist for FRQ 3 and FRQ 4
Use this when the page gets noisy.
- identify what the method must return or change
- identify the data structure
- choose the traversal order before writing the body
- write the loop skeleton
- fill in the condition or accumulator
- check one edge case
That checklist handles a lot of AP CSA collection work.
What to review after practice
If you miss a collection FRQ, do not just say:
- “Need more practice.”
Be more exact.
Say:
- I used a forward loop while removing.
- I forgot
size()and wrotelength. - I used the row count as the column bound.
- I returned from inside the traversal.
- I wrote
addwhen the task neededset.
Those are repairable mistakes.
The real edge in FRQ 3 and FRQ 4
You do not need a clever trick. You need a stable method.
If you can choose the right traversal, control the indexes, and verify one edge case before moving on, these two questions stop feeling like chaos and start feeling like a procedure.
Frequently asked questions
Can I use an enhanced for-loop when removing from an ArrayList on AP CSA?
That is usually a bad idea. If the task removes or inserts elements, an indexed loop is usually safer because you need control over positions and shifting.
How do I avoid mixing up rows and columns in a 2D array FRQ?
Say the dimensions out loud: `grid.length` is rows, `grid[0].length` is columns. Then decide whether the outer loop should move by row or by column before you start writing the body.
Are ArrayList and 2D array FRQs worth extra study time?
Yes. They sit inside the data collections part of AP CSA, which carries the most weight in the current public course framework and appears directly in FRQ 3 and FRQ 4.
Continue the cluster
Other guides at Askiras
If you are also prepping another exam, these short guides cover the same "name the pattern, then practice" approach.