Recursion is the topic that quietly decides how comfortable students feel walking into the AP CS A exam. It shows up in free-response questions almost every year, and it's one of the few areas where memorizing a template doesn't help, because each problem needs its own base case and recursive step.
1. Sum of digits. Given an integer, return the sum of its digits recursively. This is the simplest place to practice identifying a base case and reducing the problem size on each call.
2. Reverse a string. Write a recursive method that reverses a String without using loops. It forces you to think about what happens on the way back up the call stack, not just on the way down.
3. Power function. Implement power(base, exponent) recursively. Once this feels easy, try the faster version that halves the exponent each call. Comparing the two is a good way to understand recursive efficiency, which shows up on the exam.
4. Array search variants. Write recursive methods to find the maximum value in an array, and separately, to count how many times a value appears. Arrays and recursion together are a common exam pairing.
5. Simple 2D grid traversal. A recursive method that counts paths from one corner of a grid to another, moving only right or down. This is harder, and it's close to the level of the hardest free-response recursion questions.
Work through these on paper before typing anything. Trace the call stack by hand for at least one of them. Students who can draw what's happening usually do better under exam pressure than students who only know the pattern.