Most students studying programming default to passive review: re-reading textbook chapters, re-watching a tutorial, or scrolling back through lecture slides. This feels productive because the material feels familiar the second time — but familiarity is not the same as being able to produce the answer from memory, which is what an exam or a coding interview actually demands.
Active recall flips this: instead of reviewing material, you force yourself to reproduce it from memory first, then check where you were wrong. For programming specifically, this means closing your notes and trying to write a function from scratch, explain what a piece of code does line by line, or answer "what would this loop output" before running it.
A simple routine: after learning a new concept (say, recursion), close the material and write down, from memory, what the concept is, when you'd use it, and a short example. Only then compare against your notes. The gap between what you wrote and what's correct tells you exactly what to review — which is far more efficient than re-reading everything.
For exam prep specifically, past questions work better than notes for this reason: they force recall under conditions similar to the actual test, rather than passive recognition.
Spacing matters as much as the recall itself. Reviewing the same topic once a day for four days beats cramming it for the same total time in one sitting, because each retrieval attempt after a gap strengthens memory more than reviewing something still fresh in your mind.
A practical weekly loop: learn a new topic, attempt a recall exercise on it the next day, again after three days, and again after a week. If you consistently get it right without looking, you've moved it to long-term memory and can space it out further.