← All posts
DSAInterviews

How to Actually Practice LeetCode: The 30-Minute Method

Stop staring at one problem for hours. Cap every attempt at 30 minutes, learn the approach, then prove it stuck with spaced repetition.

4 min read AI-generated

The most common way people practice LeetCode is also the worst one. Open a problem, stare at it for two hours, give up, read the solution, feel bad, repeat. You burn a whole evening and learn one problem.

The fix is a hard time limit and a schedule for coming back.

The rule: 30 minutes, no exceptions

Set a timer. Then follow the same eight steps for every problem.

  1. Read it carefully. Write down the inputs, outputs, and constraints.
  2. Name the pattern. Two pointer? Sliding window? HashMap? BFS/DFS? Say it out loud.
  3. Try your approach. Code it up and talk through your thinking, even if you're alone.
  4. Hit 30 minutes? Stop coding. This is the step that matters. No shame. Move on to step 5.
  5. Read the approach, not the code. What pattern does it use, and why does it work? A NeetCode video is great for the intuition.
  6. Close everything and implement it yourself. No peeking. Write your own code from the idea you just learned.
  7. Analyze it. State time and space complexity, and explain why this approach is optimal.
  8. Log the pattern. Pattern name, problem, confidence level.

Step 4 is the whole trick. Past 30 minutes you're usually not learning, you're just stuck. Looking at the approach and rebuilding it yourself teaches more than another hour of guessing.

Solving it once means nothing

You need to prove you can do it again without help. I use a three-touch schedule:

WhenWhat
Day 1First attempt, using the 30-minute method.
Day 3Try again with no notes. Can you recall the approach and implement it?
Day 7Final check. Nail it and it's locked in. Miss it and restart the cycle.

If you can solve it on Day 7 cold, you actually learned the pattern.

Track patterns, not problem counts

Keep a simple tracker in Notion or a spreadsheet. One row per pattern, with the key insight and a status: Strong, Learning, or Weak. Then spend about 80% of your time on whatever isn't Strong yet.

PatternKey insight
Two PointerSorted arrays, shrink from both ends
Sliding WindowContiguous subarray or substring, expand and shrink
HashMapO(1) lookups, complements, frequency counts
BFS / DFSTrees and graphs, level-order vs. depth-first
Binary SearchSorted data, shrinking the search space
BacktrackingAll combinations or permutations, prune early
Dynamic ProgrammingOverlapping subproblems, optimal substructure
GreedyLocal optimum is the global optimum, usually sort first
Heap / PQTop-K, merging sorted lists, scheduling
StackMatching brackets, monotonic stack, undo

What to practice, in what order

Don't grind random problems. Use a curated list. Blind 75 is the shorter starting point. NeetCode 150 is the full version, organized by pattern, with a video for every problem. Grind 75 builds a schedule around how many hours you have.

Build the foundation before the hard stuff:

  • Easy topics: arrays, strings, hashmaps, two pointers, stacks, linked lists, binary search.
  • Medium: sliding window, trees (BFS/DFS), graphs, backtracking, heaps, intervals, greedy.
  • Hard: dynamic programming, tries, segment trees, union find, topological sort, bit manipulation.

Rough time targets once you're warmed up: about 15 minutes for an Easy, 25 for a Medium, 40 for a Hard.

Mindset

  • Not solving a problem isn't failure. It's data. Now you know what to study.
  • Understanding why beats memorizing how. If you can explain it to someone, you know it.
  • Two problems a day beats ten on Saturday.
  • Easy problems aren't beneath you. They drill patterns that show up in mediums and hards.
  • Talk out loud while you solve. Interviews require it, so practice it from day one.

A tutor that won't just give you the answer

I built a Claude Code skill, interview-prep, that acts like a tutor for this. It gives hints instead of answers, makes you explain your thinking, and catches logic errors so you get to the solution yourself.

Drafted by AI from my notes and guides, reviewed by me.