Why Do I Keep Forgetting LeetCode Solutions? (And How to Fix It)
You solved the problem yesterday, but today your mind is blank. Understand why this happens and what you can do about it.
It is 11 PM. You just spent two hours understanding the elegant solution to "Longest Substring Without Repeating Characters." The sliding window technique finally clicked. You close your laptop, satisfied.
Three days later, you encounter the same problem. Your mind is blank. The sliding window idea feels foreign. You check the solution and think: "Right, I knew that."
This is not a sign of low intelligence. This is completely normal human memory behavior. The question is not "why am I forgetting?" but rather "why do I expect to remember without a strategy?"
The Recognition vs Recall Problem
When you see a solution and think "I knew that," you are experiencing recognition. Your brain can identify the solution as correct because it seems familiar. But recognition is not the same as recall.
Recognition is passive: you see the answer and your brain says "yes, that looks right."
Recall is active: you produce the answer from scratch, with no cues.
In an interview, you need recall. Nobody is going to show you four options and ask which one is correct. You need to generate the solution from an empty whiteboard.
Learning phase: Memory is forming
Initial Learning
You study a solution and understand it. Both recognition and recall are high immediately after.
Your Brain Is Working As Designed
In 1885, German psychologist Hermann Ebbinghaus ran a brutal experiment on himself. He memorized hundreds of nonsense syllables (like "DAX" or "BUP") and tested how quickly he forgot them. What he discovered—the "Ebbinghaus Forgetting Curve"—shocked the scientific community and remains one of the most replicated findings in cognitive psychology.
The Ebbinghaus Forgetting Curve: The Numbers
- Within 20 minutes, you forget ~42% of new information.
- Within 1 hour, you forget ~56%.
- Within 1 day, you forget ~67%.
- Within 6 days, you forget ~75%.
This is not a character flaw. This is the baseline performance of the human brain.
The forgetting curve is not a bug—it is a feature. Your brain is constantly making decisions about what to keep and what to discard. The criteria are simple:
- Recency: When did I last use this information?
- Frequency: How often have I needed this?
- Emotional weight: Was this tied to something important?
A LeetCode solution you studied once, three days ago, fails all three criteria. Your brain quite sensibly deprioritizes it. The good news? Ebbinghaus also discovered that each review strengthens the memory trace, making it decay slower. This is the scientific foundation of spaced repetition.
The Three Reasons You Keep Forgetting
1. No Strategic Review
Most engineers study a problem, understand it, and move on. They do not schedule deliberate reviews. Without revisiting the material at optimal intervals, the memory trace weakens until it is effectively gone.
2. Passive Learning
Reading a solution is easy. Producing it from scratch is hard. Many engineers default to passive learning—watching videos, reading explanations—because it feels productive. But passive learning primarily builds recognition, not recall.
3. No Pattern Recognition
When you learn problems in isolation, each one feels like a new thing to remember. When you learn patterns, many problems collapse into variations of the same idea. Two Sum, 3Sum, and 4Sum are all the same pattern with slight modifications. (See our guide on how to remember patterns).
The Fix: Active Recall + Spaced Repetition
The solution is not to study harder. It is to study smarter using two complementary techniques:
The Protocol
Learn the pattern, not just the problem
Understand why the solution works, not just how.
Test yourself before checking
Try to recall the approach before looking at any hints.
Schedule reviews at increasing intervals
Use our Spaced Repetition Protocol (1 day → 3 days → 1 week → 2 weeks).
Connect to other problems
Link the pattern to other problems that use the same technique.
// Connection Note Example:
"3Sum is just Two Sum with a fixed variable. I sort the array first, iterate through 'i', and then run Two Sum (using two pointers) on the remaining subarray."
Example: A 10-Minute Review Session for "Two Sum"
What does a spaced repetition review session actually look like in practice? Here is a concrete example you can follow:
- Start with the problem statement only. Open "Two Sum" and read the prompt. Do NOT scroll to the solution.
- Ask yourself the "Pattern Trigger" questions:
- "Am I looking for a pair/sum?" → Yes.
- "Is there a way to avoid a nested loop?" → Yes, with a hash map.
- Write out the approach in pseudocode (or explain it aloud). Do not type code yet. "I will iterate through the array once, storing each number and its index in a hash map. For each number, I check if `target - num` already exists in the map."
- Implement from scratch. Now, with a blank editor, code the solution. Time yourself. You should be able to complete "Two Sum" in under 5 minutes.
- Compare and reflect. Did you remember the edge cases (e.g., not using the same element twice)? If you made errors, write a brief note on what you forgot.
This process forces active recall—you are producing knowledge, not just consuming it. This struggle, even if brief, is what strengthens the memory trace.
Stop Blaming Yourself
Forgetting is not a character flaw. It is a biological inevitability that can be overcome with the right system. The engineers who seem to remember everything are not smarter—they have better study habits.
The most important shift is from seeing studying as a one-time event to seeing it as an ongoing process. You do not "finish" learning a pattern. You maintain it through strategic review until it becomes second nature.
Key Takeaway
You are not forgetting because you are bad at algorithms. You are forgetting because you have not built a system that works with your brain instead of against it.
How TerminalTales Solves This
TerminalTales integrates spaced repetition directly into the learning experience:
- Automatic review scheduling — The system tracks what you have learned and surfaces it for review at optimal intervals.
- Active recall prompts — You are asked to produce patterns before seeing solutions, building true recall ability.
- Pattern grouping — Problems are taught as variations of core patterns, reducing the mental load.
You do not need another LeetCode subscription. You need a system that respects how memory actually works.
Master DSA with Story-Driven Learning
TerminalTales combines an immersive narrative with spaced repetition to help you actually remember what you learn. Start with 3 free chapters.
Start Learning Free