lowkey
← All guides

How to practice LeetCode without looking at the solution

Updated November 30, 2026 · 6 min read

Most people who grind LeetCode and still freeze in interviews have the same habit. They try a problem for a few minutes, get stuck, open the solution, nod along, and move on. It feels like learning because the solution makes sense when you read it. But understanding an answer and producing one are different skills, and the interview only tests the second one.

This guide is a routine for practicing in a way that builds the second skill. It's not about never looking at a solution. It's about looking at the smallest amount of help you need, as late as you reasonably can, and then making sure the problem actually sticks.

Why reading the solution feels useful but isn't

When you read a solution, your brain does recognition: you see each step and agree it's correct. In an interview you need recall and search: you have to come up with the step yourself, out of many possible steps, under a bit of pressure. Recognition is much easier, so it gives you a false sense of progress.

The struggle before you find the idea is the part that trains you. Every time you try a wrong approach and figure out why it's wrong, you're building the instincts that let you recognize a sliding window or a monotonic stack the next time. If you skip straight to the answer, you skip that.

Set a timebox before you start

Unlimited struggle isn't the goal either. Spending two hours on a problem you were never going to crack is a bad trade. Pick your limits before you start, so you're not deciding when you're frustrated:

  • Easy: about 15 minutes before you take any help.
  • Medium: about 25 to 30 minutes.
  • Hard: about 40 minutes, and it's fine to skip hards entirely until mediums feel comfortable.

The clock is for the "no progress" state. If you're actively trying an idea and learning something, keep going. If you've been staring at the same blank editor for ten minutes, that's when the timebox matters.

Use a hint ladder instead of the full solution

When the timebox runs out, don't jump to the editorial. Climb down a ladder of help, one rung at a time, and go back to solving after each rung:

  1. Reread the constraints. The input size often tells you the target complexity. If n is up to 10^5, you probably need O(n log n) or better. If n is 20, exponential is probably fine.
  2. Look at the topic tags. Knowing it's "hash table" or "binary search" is a small hint that often unlocks the whole thing.
  3. Get one hint about the idea. LeetCode's own hints, a friend, or a discussion post title. One sentence, not a walkthrough.
  4. Read only the first paragraph of the approach. Stop before any code, close the tab, and try to write it yourself.
  5. Read the full solution. If you get here, that's fine, but the problem now goes on your redo list (more on that below).

Most of the time you'll get unstuck at rung two or three. And when you solve it from there, it counts as yours, because you did the part that matters.

Do the thinking on paper first

A lot of "I'm stuck" is actually "I started typing too early." Before you write code, spend five minutes on this:

  • Write two or three small inputs and their expected outputs by hand.
  • Solve one of them manually and notice what your hands are doing. That's usually the algorithm.
  • Write the brute force in one sentence, even if it's slow.
  • Say what's slow about the brute force. That's the thing you're trying to fix.

For example, on "Two Sum" the brute force is "check every pair," which is O(n^2). What's slow is that for each number you search the whole array for its partner. The fix is to make that search fast, which points straight at a hash map. You got to the answer by asking what's slow, not by remembering it.

After you solve it, make it stick

Getting Accepted is halfway. The other half is making sure you could do it again in two weeks. Spend five minutes after each problem on this:

  • Write a one-line takeaway. Not the solution, the trigger. For example: "sorted array plus pair target means two pointers from both ends."
  • Note what got you stuck. Was it the idea, an edge case, or off-by-one indexing? Patterns in this list tell you what to practice.
  • Tag it for a redo if you needed rung four or five of the ladder.

Redo problems on a schedule

Redoing is where most of the learning actually locks in, and almost nobody does it. Keep a simple list (a spreadsheet works) of problems you needed real help on. Redo each one from a blank editor about three days later, then again about a week after that. If you solve it cleanly both times, take it off the list.

A good rule of thumb: if you can solve a problem from scratch a week after you first saw it, in about the time an interview would give you, you've learned it. If you can only explain the solution, you haven't yet.

Practice like it's the real thing, sometimes

Once a week, do a problem the way an interview runs it. Set a 35 to 45 minute timer, talk through your thinking out loud (yes, even alone), and don't run the code until you think it's correct. That last part matters: on LeetCode you can hit Run fifty times, but in most interviews you're expected to reason about correctness yourself. If you want a structured plan around all this, the 4-week prep plan puts it on a calendar.

The short version

  • Decide your timebox before you start.
  • When you're stuck, take the smallest hint that could help, then go back to solving.
  • Work small examples by hand before typing.
  • Write a one-line takeaway after every problem.
  • Redo the ones you needed help on, a few days later and again a week later.