The 10 LeetCode Problems to Solve When Returning to Coding Interview Prep

- Ten problems beats fifty when returning after a break: the goal is re-activation, not coverage, so one clean problem per major pattern family is enough to restart
- Seven easies come first: confidence rebuilds the signal-to-pattern connection before complexity tests it, so the list is intentionally front-loaded
- Two Sum re-loads the hash map model: the "store what you've seen to check later" mental model powers anagram detection, subarray sum, and a dozen other patterns
- Write your binary search template by hand: every rotated array or search-on-answer problem inherits your base template's boundary choices, so the off-by-one bugs need to be gone before you move on
- Climbing Stairs three ways: writing the same DP recurrence top-down, bottom-up with a table, and bottom-up with two variables re-trains the direction instinct that fades fastest after a break
- Cold re-solve the three mediums last: if LeetCode 3, 200, or 56 is still hard after the brush-up, that pattern needs a full review before you continue
Returning to coding interview prep after a break has a specific feeling. You remember the concept. You understand the idea. You open a blank editor, crack your knuckles, and... nothing comes out. The pattern is in there somewhere. The syntax is not. Your hands start typing a nested loop on a problem that needs a hash map. You know exactly what brute force looks like and exactly why it's wrong. That's what's coming out anyway.
Ten problems fixes this faster than fifty would. The goal right now isn't to learn. It's to re-activate. You need one clean solution per major pattern family, worked through with your hands, and the recognition instinct starts coming back on its own.
Do them in order. Don't look up solutions until you've tried for twenty minutes.
One Problem Per Pattern: Your Coding Interview Prep Restart
These ten problems touch hash maps, stacks, greedy single-pass logic, linked list pointer mechanics, sliding window, binary search, tree recursion, graph traversal, dynamic programming, and interval sorting. Ten pattern families, one problem each.
A clean brush-up isn't about completeness. It's about re-igniting the signal-to-pattern connection. You'll know it's working when you start reading a problem description and feel something before you know what to do.
| # | Problem | LeetCode | Difficulty | Pattern |
|---|---|---|---|---|
| 1 | Two Sum | 1 | Easy | Hash map, complement lookup |
| 2 | Valid Parentheses | 20 | Easy | Stack |
| 3 | Best Time to Buy and Sell Stock | 121 | Easy | Greedy single-pass |
| 4 | Merge Two Sorted Lists | 21 | Easy | Linked list pointer mechanics |
| 5 | Longest Substring Without Repeating Characters | 3 | Medium | Sliding window |
| 6 | Binary Search | 704 | Easy | Binary search invariant |
| 7 | Invert Binary Tree | 226 | Easy | Tree recursion |
| 8 | Number of Islands | 200 | Medium | DFS/BFS on grids |
| 9 | Climbing Stairs | 70 | Easy | DP recurrence + base case |
| 10 | Merge Intervals | 56 | Medium | Sort then linear merge |
Seven easy, three medium. Confidence first, then complexity.
1. Two Sum (#1)
The hash map problem. You've done this one. You've explained it to someone else. It's first anyway, because the goal isn't to get the answer, it's to consciously walk yourself through the tradeoff: the brute-force O(n²) nested loop, then the O(n) version that trades space for time by storing complement lookups as you go.
Solving Two Sum correctly means re-explaining to yourself why the one-pass hash map works: you don't need to have seen both numbers yet, you just need to check whether the current number's complement is already stored.
After this problem, the "store what you've seen so you can check later" mental model is back online. That model powers anagram detection, subarray sum problems, and a dozen others.

The brain after a break: reaches immediately for O(n²) before the hash map kicks in.
2. Valid Parentheses (#20)
Push opening brackets. Pop and verify on closing brackets. Return false if the stack is non-empty at the end.
You definitely wrote this in school. Write it again. The goal is to re-activate the "stack as a memory of open decisions" model, which also drives expression evaluation, histogram problems, and everything involving the monotonic stack.
Three lines of logic, and you've re-activated an entire category.
The edge case that trips people after a break: trying to pop from an empty stack before checking its size. The stack has no idea what you've been doing for the past six months. Add the guard anyway.
3. Best Time to Buy and Sell Stock (#121)
Single scan. Track the running minimum. At each element, update your answer as the difference between the current price and the minimum seen so far.
No DP needed here, even though it looks like an optimization problem. One pass, two variables. Your brain will reach for a DP table. It will be very confident about this. Don't let it.
This problem re-activates the instinct to think in single-pass terms: does this problem need history, or does it just need one running value updated as you go? A surprising number of interview problems have this shape. Recognizing it before you reach for a table is what separates clean code from overengineered code.
4. Merge Two Sorted Lists (#21)
Write the iterative version with a dummy head node. Create a current pointer, advance the smaller of the two heads each step, stitch the remaining tail at the end.
After a break, linked list problems feel like they require more code than they should. They don't. The dummy node pattern removes all the special-casing around the first element and most of the bugs along with it.
The real return on this problem is rediscovering that pointer manipulation looks scary but reads clean once you have the right setup. Write it without the dummy head first, then with it. The difference is immediate.
Re-establishing the prev.next = node muscle memory here means you won't fumble it when LCA or cycle detection is on the line.
5. Longest Substring Without Repeating Characters (#3)
Two pointers, one hash map (or set). Expand the right pointer. When you hit a character already in the window, advance the left pointer until it isn't. Track the maximum window size throughout.
This is the first medium on the list, and it's here to confirm that sliding window is still wired up. The hardest part coming back isn't the algorithm. It's remembering that you shrink from the left before you expand to the right, and that you do it in a while loop, not just once.
Use a character-to-index map instead of a set for the O(1) jump version. Both work here, but the index map teaches a cleaner shrink. If this one takes more than thirty minutes to feel natural, review the sliding window deep dive before moving on.
6. Binary Search (#704)
Literal binary search on a sorted array. Find a target, return its index.
The reason this is here isn't the problem. It's the off-by-one bugs. After a break, people consistently write while lo < hi instead of while lo <= hi, or forget to add 1 when updating the low boundary, and end up in an infinite loop on a two-element array. This specific mistake made it into the Java standard library and sat there for nine years. Joshua Bloch, who wrote the original, published a whole post about it in 2006.
If it can happen to him, it can happen to you. Write the template by hand and prove it terminates.
Every binary search problem you write after this inherits those boundary choices. Get the base wrong and everything that extends it (rotated arrays, binary search on the answer, search in matrix) is also wrong.
Too simple? Substitute Find Minimum in Rotated Sorted Array (#153). The template stays the same. The condition changes.
7. Invert Binary Tree (#226)
Swap the left and right children, recurse on both subtrees. Three lines in most languages.
Here's the context worth knowing: Max Howell created Homebrew, the package manager that lives on essentially every developer Mac. Google rejected him in an interview because he couldn't invert a binary tree on a whiteboard. He tweeted about it. The tweet became a meme about interview absurdity. The meme has outlived most of the interviewers who ever asked the question.
The problem is genuinely easy. The skill being tested isn't the solution. It's whether you can trust a recursive abstraction without trying to mentally simulate every node in the tree.

After a six-month break, every tree problem feels like a whiteboard ambush.
Write out the recursive swap and let yourself trust it without tracing through all the nodes manually. The moment you try to simulate the full tree in your head, you've broken the abstraction the recursion is built on. Lowest common ancestor, path sum, and serialize/deserialize all depend on that same trust.
Want the iterative version? Implement it with a queue. That's BFS. Same problem, different traversal order, and useful to have re-memorized.
8. Number of Islands (#200)
Loop over the grid. When you hit a '1', increment the island count, then DFS or BFS to mark all connected land as visited.
This does two things at once: re-activates grid traversal (the four-direction delta list) and confirms your DFS or BFS template actually runs correctly.
Write the in-place version where you overwrite '1' with '0' to mark cells visited, rather than maintaining a separate boolean grid. After a break, people reach for the separate visited array out of caution. You don't need it here, and skipping it cuts the code in half.
The grid DFS pattern shows up in Rotting Oranges, Pacific Atlantic Water Flow, Clone Graph, and most other problems where "connected region" appears in the description.
9. Climbing Stairs (#70)
Ways to reach step n, taking 1 or 2 steps at a time. dp[n] = dp[n-1] + dp[n-2]. Fibonacci with a purpose.
Write it three ways: top-down with memoization, bottom-up with a table, bottom-up with two variables. Three implementations of the same recurrence, and each one teaches something different about the relationship between recursion and iteration in DP.
The gap most people have after a break isn't the recurrence. It's the direction of the DP and where the base case lives. Top-down starts from n and works toward base cases. Bottom-up starts from base cases and works toward n. Going in both directions on purpose is the skill.
This is the cleanest illustration of the DP framework. Coin Change (#322) builds directly on this pattern if you want a harder version next.
10. Merge Intervals (#56)
Sort by start time. Iterate. If the current interval's start falls at or before the previous interval's end, merge by taking the max of both end times. Otherwise, push a new interval and continue.
The sorting step is the entire insight. Unsorted intervals can't be merged in a single pass. Sorted intervals are trivial. After a break, people try to merge without sorting first and end up with nested loops and missed cases.
One thing that bites people: max(current_end, prev_end) is not optional. If the current interval is completely contained inside the previous one, you need the max. Using current_end directly will shrink an already-wider interval.
This pattern transfers directly to Meeting Rooms, Insert Interval, and Employee Free Time.
Three Cold Re-Solves Before You Move On
You've touched hash maps, stacks, greedy, linked lists, sliding window, binary search, trees, graphs, DP, and intervals. That's the vocabulary.
Now take the three mediums (3, 200, 56) and solve each one a second time from scratch, no notes, in a fresh editor. If you can do all three cleanly, the pattern instinct is back and you're ready to move forward. If any one of them is still hard, that pattern needs a full review, not just a brush-up problem. Don't negotiate with yourself on this. The point of a restart list is the diagnostic, not the warm feelings.
For a mock interview that tells you which patterns are actually weak, SpaceComplexity simulates a real DSA interview with voice and flags gaps from your responses in real time.
Further Reading
- LeetCode Problem Set: official problem list with filters by topic and difficulty
- Wikipedia: Dynamic Programming: formal definition and history
- Wikipedia: Binary Search Algorithm: invariant and loop termination proofs
- Wikipedia: Depth-First Search: DFS definition and properties
- GeeksforGeeks: Sliding Window Technique: visual walkthrough of the shrink-and-expand pattern