You Keep Forgetting LeetCode Solutions. Spaced Repetition Fixes That.

May 25, 20267 min read
interview-prepleetcodedsacareer
You Keep Forgetting LeetCode Solutions. Spaced Repetition Fixes That.
TL;DR
  • The fluency illusion makes reading editorials feel like learning when it isn't
  • The forgetting curve drops retention to 10-20% within a week without reinforcement
  • Re-reading triggers recognition, not recall; practice testing ranked highest across 105 studies
  • Active recall means closing the solution and writing it from memory from scratch
  • Spaced repetition schedules reviews at 1 day, 3 days, 1 week, and 2 weeks after solving
  • Re-deriving from first principles builds understanding; re-reading only builds familiarity
  • 50 mastered problems beats shallowly solving 300 and forgetting 280 of them

Four days after the editorial clicked, you're staring at a blank screen. You remember the problem. You remember it having something to do with a hash map. You cannot write the solution.

This happens to almost everyone. Most people diagnose it as a personal failing ("I'm just bad at memorizing things") and respond by reading more editorials. That's the wrong diagnosis, and it's definitely the wrong treatment.

"I Get It" Is Not the Same as "I Know It"

Here's the scenario. You watch a YouTube walkthrough of Trapping Rain Water. The presenter builds up from brute force, introduces the two-pointer insight, and it all clicks beautifully. You think: yes, I've got this. You close the tab.

Three days later someone asks you about it in a mock interview. You remember it involves two pointers. You think there's something about max heights. You stare at the whiteboard and produce a quadratic solution that definitely doesn't trap any rain.

When you read an editorial and follow the logic step by step, your brain does something sneaky. The explanation flows. Each step follows from the last. It feels almost obvious in retrospect. That ease gets misread as learning.

Cognitive psychologists call this the fluency illusion: smooth processing feels like understanding, and understanding feels like retention. You're not building a memory, you're riding someone else's reasoning. The solution belongs to the author. You're just along for the ride.

Your brain is following, not leading. Following requires no durable trace. The moment the page closes, there's nothing to hold onto. You experienced someone else's thought. You didn't have one.

This is why you can re-read an editorial you've seen five times and still fail to produce the code from scratch. The editorial keeps doing the thinking for you, and your brain is very happy to let it.

How Fast It Actually Disappears

Hermann Ebbinghaus studied memory in the 1880s by testing himself on nonsense syllables. He memorized hundreds of them, then waited varying amounts of time and tested recall. The forgetting curve he plotted has been replicated so many times it's practically a law: without reinforcement, you lose roughly half of new information within a day or two, and most of the rest within a week.

One thing worth dwelling on: this research is 140 years old. We've had 140 years to apply it to studying and have mostly chosen not to.

His subjects were memorizing random syllables. You're trying to internalize a non-obvious algorithmic insight. It goes faster.

One pass through a solution gives you maybe 10-20% retention after a week. Your folder of "solved" problems isn't a useful asset. It's a graveyard of first exposures. Two hundred tombstones that say "understood once, 2024."

The forgetting isn't a character flaw. It's how memory works under conditions of passive exposure. The curve is steep because you gave your brain no reason to hold onto the information. Nothing retrieved it. Nothing forced an encoding. It was stored in RAM and then the machine rebooted.

Re-Reading Doesn't Fix This

The instinct is to go back and re-read the solution. Reasonable, except it doesn't work, and the reason is almost insultingly simple.

Re-reading the solution is smooth. Familiar. The explanation makes the same obvious-in-retrospect sense it made the first time. That fluency hits again. Your brain says: yes, we know this. Box checked. Moving on.

But recognition and recall are different operations. You can recognize a face without knowing the person's name. You can recognize a sorting algorithm without being able to implement it under pressure. Recognition tells you the memory exists somewhere. Recall is being able to produce it on demand, from scratch, with an interviewer watching you.

A 2010 meta-analysis of 105 studies rated re-reading near the bottom of effective study techniques. Practice testing, the act of forcing yourself to retrieve something from scratch, ranked at the top by a wide margin.

Research published in Science backs this up with specific numbers: active retrieval combined with spacing produced 150% better long-term retention compared to restudying. Not 15%. 150%.

And yet the re-read instinct is almost universal, probably because it's comfortable. The discomfort of not knowing is replaced, briefly, by the relief of recognition. The relief feels like progress. It is not progress. You just watched the editorial again.

Animation of someone grinding relentlessly at LeetCode, going in circles

Re-reading the same solution at 11pm, deeply convinced that this time it is sticking.

The Actual Fix: Active Recall and Spaced Repetition

Active recall means closing the solution and writing one from memory. Not summarizing it. Not reading it one more time. Not even looking at your own old code. Opening a blank editor and writing the function from scratch.

This is uncomfortable. That discomfort is the whole mechanism. The act of failing to retrieve something, then struggling to recover it, is what encodes the memory. The difficulty isn't a sign that you're doing it wrong. It's the sign that you're doing it at all.

Spaced repetition is the scheduling layer on top. After you solve a problem with genuine understanding, you review it:

  • Tomorrow
  • In three days
  • In a week
  • In two weeks

Each successful recall flattens the forgetting curve. The interval grows. Eventually the trace is deep enough to survive without reinforcement. You've turned a first exposure into something closer to fluency.

You don't need Anki for this. A spreadsheet works. A text file works. The system is: mark the date you solved each problem, block 20 minutes twice a week to reattempt old problems cold, and don't peek at the solution until you've given it a genuine attempt.

That last part is the one people skip. They make the spreadsheet. They never use it.

Re-Derive, Don't Re-Read

When you do come back to a problem, the goal is not to remember the solution. The goal is to reconstruct the reasoning.

Take Two Sum. The rote answer is "use a hash map." That's trivia. The reasoning is: you need to check, for each number, whether a specific other number exists. A naive approach checks every pair, which is quadratic. If you could look up any number in constant time, you'd reduce it to a single pass. A hash map is the data structure that offers constant-time lookup, so you trade O(n) space for O(n) time savings. Done.

If you can reconstruct that argument without looking, you actually know it. If you can't, you found the gap before the interview did.

This matters enormously for variants. If someone gives you Three Sum, pattern matching against "Two Sum = hash map" doesn't get you anywhere. Understanding why Two Sum uses a hash map, and what that buys you, does. Understanding survives novelty. Recognition collapses under it.

Re-reading builds familiarity. Re-deriving builds understanding. Only one of those is useful when the interviewer asks: "can you walk me through why you chose that approach?"

Solving More Problems Isn't the Answer

The grind instinct is to solve 300 problems and move on. New problem every day, always forward, never back. The solved count keeps going up.

But a problem solved once and never revisited contributes almost nothing after a week. Mastering 50 problems with proper review beats shallowly touching 300 and forgetting 280 of them.

This is uncomfortable because the number feels like progress. 47 problems. 112 problems. 300 problems. The counter goes up. But if 250 of those problems have decayed out of accessible memory, the count is theater. You're not tracking knowledge. You're tracking first exposures.

The good news is this reframe makes the whole project more manageable. You don't need to solve every problem on LeetCode. You need to deeply own a small set of core patterns and review them until they're actually stable. That's a finite and achievable goal.

Struggling to reconstruct a solution you "already solved" isn't failure. It's the retrieval practice doing exactly what it's supposed to do. The difficulty is the signal. Trust it.

The interview tests retrieval under pressure. Your prep should train exactly that. If you're looking for more ways your practice might be miscalibrated, you're probably practicing LeetCode wrong in other ways too.

SpaceComplexity runs realistic voice-based mock interviews that force retrieval rather than recognition. Close the editorial. Open the interview. That's where the real practice happens.