You've opened LeetCode and seen the problem count: 3,000+. You've watched people brag about solving 500 problems. You've felt the anxiety of not knowing where to start.
Here's the truth: you don't need 500 problems. You need 75–150 problems done well — understood deeply, patterns internalized, solutions you could reconstruct under pressure. That's it.
This guide gives you an exact 8-week plan, the core patterns that unlock 90% of interview problems, and the practice habits that actually build skill.
How Many Problems Do You Actually Need?
The "solve more problems" advice is wrong. It optimizes for volume over understanding. Engineers who grind 400 problems without pattern recognition still bomb interviews. Engineers who deeply understand 100 problems and can recognize the underlying structure rarely do.
The honest breakdown:
- 75 problems: Minimum viable prep for mid-level roles at non-FAANG companies
- 100–150 problems: Target for FAANG / top-tier (Google, Meta, Amazon, Apple, Microsoft, Stripe, etc.)
- 150–200 problems: If you have 10+ weeks and want deep confidence across all pattern variants
The quality bar: for every problem you solve, you should be able to (a) explain the pattern it uses, (b) write the solution from scratch 24 hours later, and (c) state the time and space complexity without hesitation.
If you can't do all three, you haven't actually solved it.
The 10 Core Patterns That Unlock Everything
Coding interview problems are not unique. They are variations on roughly 10 underlying patterns. Once you can recognize the pattern from the problem statement, you're 70% of the way to the solution.
1. Two Pointers
Use two indices that move through an array or string — often toward each other or in the same direction. Eliminates the need for nested loops in many problems.
When to reach for it: "find a pair that sums to X," sorted array problems, palindrome checks, removing duplicates in-place.
2. Sliding Window
Maintain a contiguous subarray or substring as a "window" that expands and shrinks. Converts O(n²) brute-force solutions to O(n).
When to reach for it: "longest/shortest subarray/substring that satisfies condition X," problems involving subarrays with constraints.
3. Binary Search
Not just for sorted arrays. Binary search is a general technique for eliminating half the search space per step whenever you have a monotonic decision function.
When to reach for it: sorted arrays, problems where you're searching for a minimum/maximum value that satisfies a condition, "kth element" problems.
4. Tree Traversal (BFS/DFS)
Two fundamental ways to visit every node in a tree. DFS (recursive or stack-based) explores depth-first; BFS (queue-based) explores level by level.
When to reach for it: any binary tree problem, level-order traversal, path sums, tree construction, lowest common ancestor.
5. Graph Traversal (BFS/DFS, Union-Find)
Extends tree traversal to graphs with cycles. Union-Find (disjoint sets) efficiently tracks connected components and detects cycles.
When to reach for it: grid problems, "number of islands" variants, connectivity problems, cycle detection, topological ordering.
6. Dynamic Programming (1D and 2D)
Break a problem into overlapping subproblems and store intermediate results to avoid recomputation. 1D DP uses a single array; 2D DP uses a matrix (usually for string/sequence comparison problems).
When to reach for it: optimization problems ("maximum/minimum X"), counting problems ("how many ways"), problems with overlapping subproblems (Fibonacci-shaped recurrence).
7. Backtracking
Explore all possible options recursively, and prune branches that can't lead to valid solutions. The systematic way to generate combinations, permutations, and subsets.
When to reach for it: generating all combinations/permutations/subsets, constraint satisfaction (N-queens, Sudoku), word search problems.
8. Heap / Priority Queue
Efficiently retrieve the maximum or minimum element from a dynamic set. Python's heapq is a min-heap; negate values for max-heap behavior.
When to reach for it: "top K elements," merge K sorted lists, streaming median, any problem where you repeatedly need the smallest/largest element.
9. Stack / Monotonic Stack
A stack where elements are maintained in sorted order (increasing or decreasing). Enables O(n) solutions for problems that naively require O(n²) comparisons.
When to reach for it: next greater element, daily temperatures, largest rectangle in histogram, problems involving "spans" or "ranges."
10. Prefix Sums
Precompute cumulative sums so that any subarray sum query is O(1). Extend to 2D for matrix range queries.
When to reach for it: subarray sum problems, range queries, problems asking "how many subarrays have property X."
The 8-Week Study Plan
Each week targets a specific set of patterns. The problem counts are targets — if you can only do 80% of them deeply, that beats 100% done shallowly.
Week 1: Arrays, Strings, and Two Pointers
Goal: Get comfortable with index manipulation and the two-pointer technique.
Topics: Array traversal, in-place modifications, string manipulation, two-pointer patterns (opposite ends, same direction, fast/slow).
Daily focus:
- Day 1–2: Array basics — Two Sum, Best Time to Buy and Sell Stock, Contains Duplicate, Product of Array Except Self
- Day 3–4: String manipulation — Valid Anagram, Valid Palindrome, Longest Common Prefix
- Day 5–7: Two pointers — 3Sum, Container With Most Water, Trapping Rain Water, Move Zeroes
Target: 12–15 problems. Every solution reviewed for time/space complexity.
Week 2: Binary Search and Sliding Window
Goal: Recognize problems that reduce to binary search or a shrinking window.
Topics: Binary search on sorted arrays, binary search on answer space, fixed-size and variable-size sliding window.
Daily focus:
- Day 1–3: Binary search — Binary Search (trivial, but nail the template), Search in Rotated Sorted Array, Find Minimum in Rotated Sorted Array, Koko Eating Bananas, Median of Two Sorted Arrays
- Day 4–7: Sliding window — Best Time to Buy and Sell Stock (revisit), Longest Substring Without Repeating Characters, Minimum Window Substring, Sliding Window Maximum, Permutation in String
Target: 10–13 problems. Practice writing both the inclusive and exclusive binary search templates until you can produce either on demand.
Week 3: Linked Lists, Stacks, and Queues
Goal: Pointer manipulation for linked lists; stack and queue applications.
Topics: Linked list traversal, reversal, cycle detection (Floyd's algorithm), stack-based parsing, monotonic stack intro.
Daily focus:
- Day 1–3: Linked lists — Reverse Linked List, Merge Two Sorted Lists, Reorder List, Remove Nth Node From End of List, Linked List Cycle, LRU Cache
- Day 4–7: Stacks and queues — Valid Parentheses, Min Stack, Daily Temperatures, Car Fleet, Largest Rectangle in Histogram
Target: 10–12 problems. For linked lists, draw the pointer diagram before writing code.
Week 4: Trees (BST, BFS, DFS)
Goal: Fluency with recursive tree traversal and BFS level-order iteration.
Topics: Pre/in/post-order DFS, level-order BFS, BST properties, tree construction, path problems.
Daily focus:
- Day 1–2: DFS fundamentals — Invert Binary Tree, Maximum Depth of Binary Tree, Diameter of Binary Tree, Balanced Binary Tree
- Day 3–4: BFS — Binary Tree Level Order Traversal, Right Side View, Good Nodes in Binary Tree
- Day 5–7: BST + advanced — Validate Binary Search Tree, Kth Smallest Element in BST, Lowest Common Ancestor, Binary Tree Maximum Path Sum, Serialize and Deserialize Binary Tree
Target: 13–15 problems. Be able to write both recursive and iterative DFS.
Week 5: Graphs (BFS/DFS, Union-Find, Topological Sort)
Goal: Extend tree traversal to graphs; handle cycles, connectivity, and ordering constraints.
Topics: Grid DFS/BFS, adjacency list representation, visited tracking, union-find with path compression, topological sort (Kahn's algorithm and DFS variant).
Daily focus:
- Day 1–2: Grid graphs — Number of Islands, Max Area of Island, Clone Graph
- Day 3–4: General graph traversal — Pacific Atlantic Water Flow, Surrounded Regions, Course Schedule (cycle detection)
- Day 5–6: Topological sort — Course Schedule II, Alien Dictionary
- Day 7: Union-Find — Redundant Connection, Number of Connected Components, Accounts Merge
Target: 10–12 problems. Implement union-find with both rank and path compression from memory.
Week 6: Dynamic Programming
Goal: Build the DP intuition — define the subproblem, write the recurrence, implement bottom-up.
Topics: 1D DP (sequence optimization), 2D DP (string comparison, grid paths), decision DP (include/exclude), interval DP.
Daily focus:
- Day 1–2: Classic 1D — Climbing Stairs, House Robber, House Robber II, Longest Increasing Subsequence
- Day 3–4: 2D DP — Unique Paths, Longest Common Subsequence, Edit Distance, Coin Change
- Day 5–7: Advanced — Word Break, Partition Equal Subset Sum, Target Sum, Burst Balloons (stretch goal)
Target: 12–14 problems. For each, write the top-down (memoized) solution first, then convert to bottom-up.
Week 7: Heaps, Greedy, and Intervals
Goal: Heap-based selection problems; greedy reasoning; interval overlap and merging.
Topics: Min/max heaps, K-th element problems, two-heap trick for running median, greedy proofs, interval sorting and sweeping.
Daily focus:
- Day 1–2: Heaps — Kth Largest Element in an Array, K Closest Points to Origin, Top K Frequent Elements, Find Median from Data Stream
- Day 3–4: Greedy — Jump Game, Jump Game II, Gas Station
- Day 5–7: Intervals — Meeting Rooms, Meeting Rooms II, Merge Intervals, Insert Interval, Non-overlapping Intervals
Target: 10–12 problems. For heap problems, be comfortable with both Python's heapq and a conceptual understanding of heap operations.
Week 8: Mock Interviews and Weak Spot Review
Goal: Simulate real interview conditions. Identify and close gaps.
Structure:
- Day 1: Timed mock — pick 2 random medium problems, 35 minutes each, no hints
- Day 2: Review everything you got wrong in weeks 1–7. Re-solve any problem you couldn't reconstruct cleanly.
- Day 3: Timed mock — 1 medium + 1 hard, 35 minutes each
- Day 4: Pattern drills — pick one pattern (e.g., DP) and solve 3 variants you haven't seen before
- Day 5–6: System design prep (if targeting senior roles) or additional mock interviews
- Day 7: Rest and light review only
Use CareerLift to run behavioral mock interviews in parallel this week — technical and behavioral prep reinforce each other.
Must-Do Problems Table
These 15 problems cover the highest-yield patterns and appear (or have variants that appear) most frequently in FAANG interviews.
| Problem | Pattern | Difficulty | Why It Matters | |---|---|---|---| | Two Sum | Hash Map | Easy | Hash map lookup foundation | | Best Time to Buy and Sell Stock | Sliding Window / Greedy | Easy | "Running min" pattern baseline | | Longest Substring Without Repeating Characters | Sliding Window | Medium | Variable window with constraint | | Search in Rotated Sorted Array | Binary Search | Medium | Binary search on non-standard arrays | | 3Sum | Two Pointers | Medium | Reducing 3-variable to 2-pointer | | Container With Most Water | Two Pointers | Medium | Greedy elimination proof | | Binary Tree Level Order Traversal | BFS | Medium | BFS template for trees | | Lowest Common Ancestor | DFS | Medium | Recursive tree state propagation | | Number of Islands | Graph DFS/BFS | Medium | Grid graph traversal template | | Course Schedule | Topological Sort | Medium | Cycle detection + ordering | | Coin Change | 1D DP | Medium | Classic unbounded knapsack | | Longest Common Subsequence | 2D DP | Medium | String DP recurrence | | Merge Intervals | Intervals + Sorting | Medium | Interval overlap reasoning | | Find Median from Data Stream | Two Heaps | Hard | Two-heap balancing pattern | | Trapping Rain Water | Two Pointers / Stack | Hard | Multi-technique problem with variants |
How to Practice Effectively
The 25-Minute Rule
When you're stuck, you have 25 minutes before looking at the solution. Not 5 minutes (too short to struggle productively), not 2 hours (diminishing returns).
Here's what the 25 minutes should look like:
- Minutes 0–5: Read carefully. Restate the problem in your own words. Write example inputs/outputs.
- Minutes 5–15: Try a brute-force approach. Get something working, even if it's O(n²) or O(n³).
- Minutes 15–20: Think about which pattern might apply. Can you identify the bottleneck in your brute force? What data structure would speed it up?
- Minutes 20–25: If still stuck, look at the discussion section for a hint (not the full solution). Try again.
After 25 minutes with no progress: read the solution, understand it fully, then close it and rewrite it from scratch.
Rubber Duck Debugging
Before you run your code, explain it out loud to an imaginary rubber duck (or a real one, no judgment). Walk through your algorithm step by step. This surfaces 80% of bugs before they ever run.
In interviews, this becomes your "thinking out loud" habit. It's the same skill.
Pattern Recognition Drills
Once per week, after solving problems, do a "pattern quiz": look at 10 problem titles you've seen before and, without opening them, state (a) the pattern, (b) the time complexity, (c) the key data structure. This is how pattern recognition becomes automatic.
Interview Day Tips
How to Think Out Loud
Interviewers don't just want the answer — they want to see your problem-solving process. Silence is worse than wrong. Here's the structure:
- Restate the problem: "So we're given an array of integers and we need to find..."
- Clarify constraints: "Can the input be empty? Can values be negative? What's the expected input size?"
- Propose brute force first: "The naive approach would be O(n²) — here's why. But I think we can do better."
- Identify the optimization: "If I use a hash map / sort the input / use a sliding window, I can get this to O(n)."
- Code it up while narrating: "I'm initializing a left pointer at 0, and I'll expand right..."
- Test with examples: Walk through a small example before declaring done.
How to Handle Being Stuck
Everyone gets stuck in interviews. The difference between candidates who recover and those who don't:
- Don't go silent. Say "I'm thinking through the edge cases here" or "Let me try a different approach."
- Restate what you know. "I know the input is sorted. I know I need to find a pair. The brute force would be O(n²). I'm trying to figure out how to use that sorted property..."
- Ask for a nudge. "I have a feeling there's a way to use the sorted order here — am I on the right track?" Interviewers want to help. Asking is not weakness.
- Simplify the problem. "What if the array had only 2 elements? What if it was unsorted?" Solving a simpler variant often unblocks the general solution.
Putting It Together
Eight weeks. 75–150 problems. Ten patterns.
The grind isn't the goal — recognition and fluency are. When you see a problem and immediately think "this is a sliding window on a string with a character frequency constraint," you're ready.
Use CareerLift's mock interview sessions alongside this plan. Pattern recognition in coding and confident delivery in behavioral interviews are complementary skills. Build both at once.
Start with Week 1. Do the problems. Come back to this guide when you need to recalibrate.