The exercise-1 editor asks you to write a recursive method. These six ask what makes the recursion terminate, and what the machine is actually doing while it waits.
Applied Practice
6 questions · scenario driven · every answer is recorded for your teacher
Question 1 of 6Analyze
A recursive method has a correct base case but the recursive call passes the same argument it received.
What happens?
Correct. Correct. A base case is necessary but not sufficient; progress toward it is the other half.
Incorrect. It does not terminate at all.
Incorrect. The compiler cannot tell whether an argument makes progress.
Incorrect. The base case is never reached, so it is never returned.
Question 2 of 6Apply
A factorial method is written with the recursive case return n * fact(n - 1); and no base case at all.
What is the result for fact(5)?
Incorrect. Multiplying by fact(-1) never resolves, so no value is ever produced.
Incorrect. Missing base cases are a logic error, not a compile error.
Incorrect. Reaching 120 requires something to stop the descent at 1 or 0.
Correct. Correct. Nothing about reaching 0 stops a recursion; only an explicit base case does.
Question 3 of 6Analyze
A recursive method is called with a large input and the program stops with StackOverflowError.
What does that indicate?
Incorrect. The data size matters only through how deep it drives the recursion.
Incorrect. It never returned any value; it ran out of room first.
Correct. Correct, and it is why deep recursion is sometimes rewritten as a loop.
Incorrect. The call stack lives in memory and is unrelated to disk.
Question 4 of 6Apply
A method computes the sum of an array recursively.
Which pair of cases is correct?
Incorrect. The recursive case makes no progress, so it never reaches the base.
Correct. Correct: the range shrinks by exactly one element per call and the empty range terminates it.
Incorrect. Returning a length is not a sum, and the recursive case is unspecified.
Incorrect. The base is fine but the recursive case does not shrink the range.
Question 5 of 6Evaluate
A student claims any recursive method can be rewritten as a loop, and vice versa.
Is that accurate?
Correct. Correct. Clarity and stack depth are the real trade-offs, not capability.
Incorrect. Neither form is more powerful than the other.
Incorrect. Recursion is usually slower, carrying call overhead a loop avoids.
Incorrect. Anything recursive can be done iteratively, sometimes with an explicit stack.
Question 6 of 6Analyze
A recursive method prints its argument BEFORE the recursive call; a second prints AFTER it.
How do their outputs relate for the same input?
Incorrect. It prints once per call, the same number of times as the first.
Incorrect. Every level prints; only the timing changes.
Incorrect. The ordering differs, which is the entire point of the comparison.
Correct. Correct, and this is the clearest demonstration that pending calls resume in reverse order.
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed.
Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Typically responds within 24 hours
✓
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
34.8% of Tanner’s CSP students score 5s. The national average is 9.6%.
I’m a Student
I’m a Teacher
✓Free AP CSP Big Ideas cheat sheet (PDF)
✓Daily practice questions covering all 5 Big Ideas
✓Create Task tips that actually work — from a real AP teacher
✓Free class codes with student progress tracking
✓3 full practice exams + Top 100 questions for your class
✓Create Task guidance and pseudocode reference sheets
Which AP CS exams are you prepping for?
✓
You’re in!
Your Big Ideas cheat sheet is on its way.
No thanks, I’ll figure it out myself
Avg student improvement: 2+ score levels | Real AP teacher, not just a tutor
AP Cybersecurity — National Launch 2026–27
Get Early Access to AP Cyber
AP Cyber launches nationally fall 2026. Get in early to help shape the course — start free with Unit 1 and the free teacher gradebook.
✓
You’re in — you’re on the AP Cyber early-access list!
Tanner will follow up personally within 48 hours. Your feedback will directly shape what gets built.
Step 1 of 4
Early Access — Limited Spots
Who are you?
Are you a teacher or a student?
I’m a Teacher
I’m a Student
Free to start — Unit 1 and the teacher gradebook are always free, no credit card.
Founding teachers unlock all 5 units and get direct input on what we build.
Not interested right now
Step 2 of 4
Your School
Tell us about your class
Other AP CS courses you teach
Your Situation
Tell us about yourself
Step 3 of 4
Classroom Needs
What does your classroom need? (select all that apply)
How You Study
What would help you most? (select all that apply)
Step 4 of 4
Almost Done
Where should we send your early-access details?
Free gradebook + Unit 1 | Your feedback shapes the course | Built by a real AP teacher