Top 25 LeetCode Problems for a One-Week Interview Crunch

May 29, 202612 min read
interview-prepdsaleetcodealgorithms
TL;DR
  • Top 25 LeetCode problems span 10 patterns: hash maps, sliding window, two pointers, binary search, linked lists, trees, graphs, heaps, DP, and backtracking
  • Min-heap of size k is the top-k template; know the O(n) bucket sort alternative that Meta and Google ask for as a follow-up
  • Binary search on the answer (LC 875) is the reusable template for all minimize-the-maximum and maximize-the-minimum problems
  • BST validation (LC 98) requires passing a valid [min, max] range down through recursion, not just comparing a node to its direct parent
  • Coin Change (LC 322) is the most commonly asked DP problem at Amazon and Google; outer loop iterates amounts, inner loop iterates coins
  • Minimum Window Substring (LC 76) earns its hard rating but appears everywhere; use a have-vs-need counter and shrink from the left when have equals need
  • Day 7 is review only: revisit the five problems you felt least confident about and practice explaining each one verbally before touching the keyboard

You have a week. Maybe less. The interview was supposed to be "sometime next month" and now it's Tuesday and you're staring at a Blind 75 checklist like it owes you money.

You are not finishing Blind 75. You are definitely not finishing NeetCode 150. So which 25 LeetCode problems teach the most, cover the broadest patterns, and actually show up in real interviews?

Every problem here earns its place as a pattern anchor, a frequency staple, or both. Work through them in order. The sequence is deliberate.

Pattern coverage beats problem count. These 25 problems hit every major interview pattern: arrays, sliding window, two pointers, binary search, linked lists, trees, graphs, heaps, DP, and backtracking. Skip new hard problems this week. Hards take 40-90 minutes cold and hinge on a single non-obvious insight. You need breadth, not a clever insight you'll forget under pressure. The one exception is Minimum Window Substring, covered below.

If you have more time, read how to practice LeetCode without wasting time first.


The Top 25 LeetCode Problems

Arrays and Hashing

1. Two Sum (LC 1), Easy

The most solved, most memed, most condescended-about problem on LeetCode. Do it anyway. Teaches the hash map as a complement store: you trade O(n) space to eliminate an O(n²) nested scan. Every problem involving "target minus current element" traces back here. If you can't explain why the hash map works, not just how, stay on this one. The joke is that Two Sum is easy. The truth is most people solving it can't explain it.

2. Group Anagrams (LC 49), Medium

Sort each string, use the result as a hash key. Two strings are anagrams if and only if they share the same sorted form. This is canonical key construction, a technique that shows up in dozens of grouping problems. Simple idea, surprisingly satisfying when it clicks.

3. Top K Frequent Elements (LC 347), Medium

Min-heap of size k gives O(n log k). But interviewers at Meta and Google frequently ask for the O(n) alternative: count frequencies, distribute into buckets by frequency, read from the top. Know both. The bucket sort follow-up is the actual test. They will ask.


Sliding Window

4. Longest Substring Without Repeating Characters (LC 3), Medium

The canonical sliding window problem. Expand right, shrink left when you hit a duplicate, track the max length. The invariant: the window always contains unique characters. Internalize this and every "longest subarray satisfying a constraint" problem becomes a variation on the same template. More in our sliding window deep dive.

5. Minimum Window Substring (LC 76), Hard

Do this one despite the rating. You need the smallest window containing all characters of a pattern string. The technique is a "have vs need" counter: track how many required characters are currently satisfied. When have equals need, you have a valid window. Record it and shrink from the left. Every major company has a version of this in their rotation. Skipping it because it says Hard is the bad decision you make during prep, not during the interview.


Two Pointers

6. Container With Most Water (LC 11), Medium

Two pointers, one at each end, moving inward. The elimination argument: if the left pointer is shorter, moving the right pointer inward can't increase the area. Always move the shorter pointer. This reasoning generalizes to every "which pointer do I advance?" decision. It feels like guessing until you see why it's not.

7. 3Sum (LC 15), Medium

Sort the array. Fix one element, use two pointers on the remaining sorted suffix. The tricky part is deduplication: after finding a valid triple, skip duplicates for both inner pointers. This appears constantly at Amazon and Google. The dedup step is where candidates go quiet and start staring at their code.


Binary Search

8. Binary Search (LC 704), Easy

Do not skip this because it's easy. Seriously. Write the lo=0, hi=n-1, while lo<=hi, mid=lo+(hi-lo)//2 template from memory without thinking. Most binary search bugs come from not having a clean template memorized, not from misunderstanding binary search. One hour on this saves you from a lo + hi integer overflow bug in a medium problem under pressure. See our binary search invariant guide for the full mental model.

9. Search in Rotated Sorted Array (LC 33), Medium

A sorted array was rotated at some pivot. Search it in O(log n). One half of the array is always sorted. Compare mid to the endpoints to identify which half, then check if your target lives there. The key insight is that even a rotated array has at least one clean half you can reason about.

10. Koko Eating Bananas (LC 875), Medium

Binary search on the answer space, not the array. If speed k works, anything higher also works. This is the template for all "minimize the maximum" and "maximize the minimum" problems. The check function is always a greedy scan. Once you see this pattern, you'll spot it everywhere and feel slightly smug about it.


Linked Lists

11. Reverse Linked List (LC 206), Easy

Three pointers (prev, curr, next), one pass. You will use linked list reversal as a subroutine in dozens of harder problems. Master the iterative version first. Draw it out if you need to. There's no shame in drawing arrows on a whiteboard, and every interviewer has seen the "I'll just figure it out" approach crash and burn.

12. Linked List Cycle (LC 141), Easy

Floyd's cycle detection. Slow pointer moves one step, fast moves two. If they meet, there is a cycle. Know why, not just that: the fast pointer closes the gap by one node per step once both are inside the cycle, so meeting is guaranteed. "It just works" is not an explanation. Interviewers know the difference.

13. Merge Two Sorted Lists (LC 21), Easy

Maintain a dummy head and a current pointer. At each step append the smaller node. This is the merge subroutine from merge sort, applied to linked lists. Understanding it now makes Merge K Sorted Lists (LC 23) obvious. Skip the dummy head once. Realize why it exists. Never skip it again.


Trees

14. Invert Binary Tree (LC 226), Easy

A Homebrew maintainer once failed a Google interview for this problem. It became a tweet. The tweet became a meme. Interviewers still ask it. Recursive DFS: swap left and right children at each node. Every tree problem recurses on left and right subtrees and combines the results. Internalize this before moving to harder tree problems.

15. Maximum Depth of Binary Tree (LC 104), Easy

Return 1 + max(depth(left), depth(right)). Trivial on the surface. But it concretizes post-order DFS: you need the children's results before computing the parent's. That ordering is what binary tree follow-ups test. Think of it as the "hello world" of recursive tree thinking.

16. Lowest Common Ancestor of a BST (LC 235), Medium

If both nodes are less than the root, recurse left. If both are greater, recurse right. Otherwise the root is the LCA. The BST property turns an O(n) tree problem into O(log n) by letting you skip entire subtrees. This is why BSTs exist. Don't just memorize the cases. Understand the geometry.

17. Binary Tree Level Order Traversal (LC 102), Medium

BFS on a tree. At each level, snapshot len(queue) before the inner loop so you process exactly one level per iteration. This generalizes directly to BFS on graphs. One problem, two patterns. Good value.

18. Validate Binary Search Tree (LC 98), Medium

The parent-only check fails. A node can be greater than its left child and still violate the BST property against some ancestor further up the tree. This is the most common wrong answer for this problem. The correct approach: pass a valid range [min, max] down through the recursion and validate each node against that range. Get this one wrong in an interview and you will remember it for the rest of your career.


Graphs

19. Number of Islands (LC 200), Medium

DFS or BFS from each unvisited land cell, marking visited as you go. The outer double loop is not optional: you need it to handle disconnected components. This problem or a variant appears at nearly every FAANG onsite. Get the template clean enough to write in two minutes.

20. Course Schedule (LC 207), Medium

Topological sort with cycle detection. DFS using three states: unvisited (0), visiting (1), visited (2). A cycle exists if and only if you hit a currently-visiting node. Alternatively, Kahn's BFS detects a cycle when the count of processed nodes is less than n. Know both. The interviewer will ask which you prefer and why.


Heaps

21. Kth Largest Element in an Array (LC 215), Medium

Min-heap of size k. Push each element, pop when the heap exceeds k. The top is your answer. This is the heap-for-top-k template. Mention Quickselect O(n) average as the follow-up when the interviewer asks for better. They will ask for better.


Dynamic Programming

22. Climbing Stairs (LC 70), Easy

Fibonacci DP. To reach stair n you came from n-1 or n-2. This is the template for all 1D DP where the current state depends on a fixed number of prior states. Also demonstrates the rolling variable trick to get O(1) space. See our DP framework if the pattern feels unfamiliar.

23. Coin Change (LC 322), Medium

dp[i] = minimum coins to make amount i. Transition: dp[i] = min(dp[i - coin] + 1) for each coin. Initialize to infinity, base case dp[0] = 0. Iterate amounts in the outer loop, coins in the inner. The most commonly asked DP problem at Amazon and Google. If you only do one DP problem this week, make it this one.

24. Longest Common Subsequence (LC 1143), Medium

dp[i][j] = LCS of the first i chars of text1 and first j chars of text2. If characters match, dp[i][j] = dp[i-1][j-1] + 1. Otherwise max of skipping either character. This is the canonical 2D DP problem. Every sequence alignment question is a variation on this table. Fill it by hand once. It will click in a way that reading a solution never does.


Backtracking

25. Combination Sum (LC 39), Medium

Choose a candidate, recurse with the reduced target, unchoose. Since candidates can be reused, do not increment the start index after choosing. Prune when target goes negative. This is the cleanest demonstration of the choose/explore/unchoose backtracking skeleton. Some version of it appears at nearly every onsite, usually wearing a thin disguise.


Pattern Coverage at a Glance

PatternProblems
Hash Map1, 2, 3
Sliding Window4, 5
Two Pointers6, 7
Binary Search8, 9, 10
Linked List11, 12, 13
Tree DFS14, 15, 16, 18
Tree BFS17
Graphs19, 20
Heap3, 21
1D DP22, 23
2D DP24
Backtracking25

Seven Days, Problem by Problem

Day 1 (1-4): Hash map foundation and first sliding window. Spend at least 20 minutes on each before reading a solution. When you read one, close it and rewrite from scratch. Not from memory. From understanding.

Day 2 (5-8): Harder sliding window, two pointers, binary search template. Give problem 5 a full 30 minutes before reading. The frustration is the point.

Day 3 (9-13): Rotated binary search, binary search on answer, all linked lists. Linked lists are mechanical. Move fast. If you are spending more than 40 minutes on Reverse Linked List, draw the pointers.

Day 4 (14-18): All tree problems. After each one, say out loud what order the DFS visited nodes and why. Say it out loud. You will feel silly. You will also remember it.

Day 5 (19-21): Graphs and heap. LC 200 is quick. LC 207 is subtle. Spend real time on the three-color DFS logic. "I know how cycle detection works" and being able to implement it from scratch are different things.

Day 6 (22-25): DP and backtracking. Before coding Coin Change, fill the DP table by hand for a small example. The act forces you to understand the recurrence instead of transcribing a solution you half-remember.

Day 7: No new problems. This is a rule, not a suggestion. Revisit the five you felt least confident on. Practice your verbal explanation before touching the keyboard. The explanation is what gets you hired, not the code. An interviewer who watches you think clearly through a medium problem will pass you. One who watches you silently produce a hard solution will worry about you.


What to Add With More Time

This list skips intervals (LC 56), monotonic stack (LC 739), advanced DP (LC 198, LC 139), and union-find (LC 323). Those are the highest-value additions once you finish the 25.


The Problem You Can't Practice Alone

You will know these solutions at your desk. Under pressure, in front of an interviewer, recall drops. You forget to narrate. You stop explaining your reasoning. You go silent for 90 seconds while the interviewer notes "candidate did not communicate." That is a performance gap, not a knowledge gap. Solo LeetCode does not close it.

SpaceComplexity runs voice-based mock interviews with rubric scoring across all four dimensions interviewers actually score: communication, problem-solving, code quality, and optimization. One mock interview under real conditions is worth five solo problems in silence. Do at least one before your interview. Preferably not the night before.


Further Reading