solulubeta
Sign in
Recursion & Memo / See it, then write it
01.04 · Practice set

Trace the Output

15 predict-the-output questions on recursive Java code, every answer checked by running it: the before/after order, return values, accumulators, base-case bugs and how Java passes arrays and ints.

23 min Free

Placement tests often ask “what does this print?” about recursive code. Write one line per call, indented by depth, and fill in the results on the way back up (see How Java Runs Recursion). Don’t guess from the shape of the code.

Every answer here was checked by running the code in Java.

Mark this as done when you are finished.

Item 4 of 44 · updated 2026-10-13