Amazon, Google, Adobe and Goldman Sachs all ask Trapping Rain Water. You solved it in the spring. You remember the picture: a row of bars, water pooling in the dips. You remember it was two pointers, one at each end, each carrying a running max.
Then an interviewer gives you [3, 1, 2, 0, 4, 0, 2]. You put a pointer on each end and stop. One of them moves first. There was a rule for which one, and a reason the rule was safe, and neither will come back.
You kept the name of the trick and the rough shape of the code. You lost one sentence: the reason it works. In a live round, that sentence is what gets you from the prompt to the code.
What you actually forget about a LeetCode solution
Here is the sentence for Trapping Rain Water. The water over any bar rises to the shorter of two walls: the tallest bar on its left and the tallest bar on its right. So if the left side's tallest bar so far is 3 and the right side has already shown you a 4, the bar under the left pointer holds water up to 3, whatever sits between them. Subtract the bar's own height and that's its water. You don't need the exact wall on the far side, only proof that it's at least as tall. The side with the lower max is settled, so that side moves.
With that sentence, the code is a few lines you can write cold, and on [3, 1, 2, 0, 4, 0, 2] it gives 8. Without it, you're choosing a pointer at random and hoping the tests agree.
Every problem you've solved works like this. Merge Intervals is "sort by start, then each interval either extends the last one you kept or starts a new one." Course Schedule is "every course can be finished unless the prerequisites form a cycle." The code is the part you can rebuild. The reason is the part you lose first, because you only ever said it to yourself once and the code sat on the screen for the whole solve.
How to tell whether you still know a problem
Recognizing a solution and knowing it feel the same until an interview separates them. A quick check you can run on any problem you've solved:
- Read the prompt and say the reason out loud in one or two sentences, before you touch the keyboard.
- Write the solution in an empty editor, without your old submission open in another tab.
- Run the tests. Count it only if they pass inside 20 minutes with nothing looked up.
If step 1 stalls, you don't have the problem, however familiar the code looked when you scrolled past it. Run the check on ten problems from your first month and count how many pass.
Why rereading, notes and more problems don't bring it back
Rereading your accepted solution feels like knowing it, because every line looks right. That's recognition. The interview asks for recall, from a blank editor, and reading never practices that.
Memorizing the code holds until the interviewer changes one thing: return the water over each bar instead of the total, or do it on a 2D grid. Code without its reason has nothing to adapt with.
Writing notes gets closer. A good note holds the reason, but it holds it on paper, and the night before your onsite you'll be rereading that note, which is the first fix again.
Solving a new problem every night feels like progress, and it is, for the new problem. The one from week one got its last look in week one. A problem library will hand you a new one every night for as long as you like; it won't bring week one back (how Firecode differs from LeetCode).
Re-solving the whole list the week before sounds thorough until you do the sum: 150 problems at 20 minutes each is 50 hours, in the one week you most need sleep. You get through a fraction and walk in with the rest untouched.
What keeps a solution until interview day
What works is simple to say and hard to do alone. The problem comes back. You face it cold, from an empty editor, mixed in with problems on other topics so the list can't hint at the pattern. You rebuild it from the reason. And it comes back right before the reason was about to fade, because pulling a memory back just as it slips is what makes it last longer the next time. (The research behind this is in spaced repetition for coding interviews.)
The catch is the timing. "Right before it fades" is a different day for every problem, and for every person. The Trapping Rain Water you wrote cleanly in nine minutes can wait. The Course Schedule you scraped through after peeking at a hint needs to come back soon. Tracking that across 150 problems means 150 dates, and every solve moves one of them. That's a ledger you update every night, in the evenings you meant to spend solving.
Keeping 150 solutions until your onsite comes down to timing, and timing is the one part of this nobody can keep up with by hand.
Firecode's adaptive learning engine takes the timing off your hands. It learns from every solve and brings each problem back when you need it, so the reason behind each solution is still there on interview day.
You open your session on an ordinary Tuesday and Trapping Rain Water is waiting between a heap problem and a new tree problem, in an empty editor with the tests ready, just as the rule about which pointer moves was starting to blur. If the reason won't come back, Firebot nudges you one hint at a time, and on many problems a drawn walkthrough shows the pointers moving over the bars until you could explain it out loud to an interviewer. The engine also adapts to your level, so the new problems it adds are ones you can actually learn from.
Trapping Rain Water is one of 1,500+ real interview questions on Firecode, built by ex-Meta, X and LinkedIn engineers who've built loops and conducted thousands of interviews. 50,000+ engineers have prepared with Firecode, and at about 22 minutes a day the median offer comes after 173 problems. If you're short on evenings, here's how that fits around a full-time job.
If you've already forgotten most of what you solved
This is the common case, and starting over from problem one is the slowest way out of it. Those problems aren't wasted. Something you solved once comes back much faster the second time, even when it feels gone. What you need is to see them again in the right order, the ones nearest to fading first, mixed with new ones so the patterns keep growing.
The engine does this from day one: it starts from your level, and every session from there brings back the right problems for that day. A problem you blank on in week one is one you'll write cold a few weeks later.
Frequently asked questions
How do I remember LeetCode solutions?
Remember the reason each solution works, in one or two sentences, and rebuild the code from it in an empty editor each time the problem comes back. Bring each problem back right before you'd forget it, mixed in with other topics. Firecode's adaptive learning engine does that timing for you, giving you the right problem at the right time, the right number of times.
Is it normal to forget LeetCode problems a few weeks after solving them?
Yes. Almost everyone does, because one solve leaves a memory that fades within weeks unless the problem comes back. The code itself is rarely what goes first. It's the one-line reason the approach works, which is what you need to rebuild it under pressure.
Should I re-solve LeetCode problems I've already done?
Yes, from an empty editor and without your old submission open, and at the right moments rather than all at once. Re-solving 150 problems at 20 minutes each in the week before an interview is 50 hours. Firecode's learning engine brings each solved problem back on the day it needs to come back.
How do I know if I really understand a LeetCode solution?
Read the prompt and explain in one or two sentences why the approach works, before writing any code. Then write it in an empty editor and pass the tests in about 20 minutes without looking anything up. If you can't say the reason, you recognize the solution but don't know it yet.
Do notes help me remember LeetCode solutions?
Notes help when they capture the reason a solution works rather than the code. Reading them back is still rereading, though, which builds familiarity instead of recall. What keeps a solution is rebuilding it from memory when it comes back. Firecode brings each problem back in an empty editor, so every review is a rebuild.
I've forgotten most of the problems I solved. Should I start over?
No. Problems you've solved once come back faster the second time, even when they feel gone. See them again in order of how close each one is to fading, mixed with new problems. Firecode's learning engine starts from your level and builds that order into every session.
How many LeetCode problems do I need to remember for an interview?
Enough to cover the common patterns, and fewer than most people expect if you keep every one. On Firecode, at about 22 minutes a day, the median offer comes after 173 problems.