AP CSA FRQ Guide
2024 FRQ 3: WordChecker
Write two methods that analyze an ArrayList of words. One checks whether each word contains the previous word. The other returns a new list of words that start with a target after removing that starting target.
Skills Tested
What this FRQ is really practicing
Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.
Starter Approach
How to begin without copying a solution
- 1Part A: traverse wordList from the second element and compare each word with the previous word.
- 2Return false as soon as a word does not contain the previous word; otherwise return true.
- 3Part B: create a new ArrayList<String> without changing wordList.
- 4Add words that start with target after removing the starting occurrence of target.
Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Defines isWordChain with boolean return type.
Part A returns true or false.
Traverses from index 1 through the end of wordList.
Each word should be compared with the previous word.
Uses get to access current and previous ArrayList elements.
ArrayList uses get(index), not bracket syntax.
Checks whether the current word contains the previous word.
indexOf(previous) != -1 is the usual pattern.
Returns false when the chain condition fails.
The failure return belongs inside the loop.
Returns true after all comparisons pass.
The true return should happen after the loop completes.
Defines createList with ArrayList<String> return type and a String parameter.
Part B returns a new list.
Creates a new ArrayList<String> result list.
Do not modify wordList.
Practice Links
