Why You Need a Roadmap
Most engineers preparing for coding interviews make the same mistake: they open LeetCode, filter by "medium," and start solving random problems. After 200 problems they feel stuck — familiar patterns still feel foreign, and progress has plateaued. The issue is not effort. It is the absence of structure.
Pattern-based learning changes everything. Research on deliberate practice consistently shows that organizing problems by underlying pattern — rather than by difficulty or recency — accelerates skill transfer to unseen problems by roughly 3x. When you learn the sliding window pattern deeply, you can solve any sliding window problem you have never seen before. Memorized solutions cannot do that.
The 480+ problems on LeetCode can be organized into approximately 15 core patterns. This guide gives you the optimal order to learn them, the key problems within each pattern, and the time allocation that gets you from zero to interview-ready in 16 weeks.
- Random grinding causes plateau after ~100-150 problems — pattern learning breaks through
- 15 core patterns cover 90%+ of all LeetCode medium and hard problems
- 480+ problems distilled into a 250-problem curated path across 4 phases
- Pattern recognition transfers to unseen problems; memorized solutions do not
- 16-week timeline with 2-3 hours daily gets you to consistent medium solves in under 25 minutes
Phase 1: Foundations (Weeks 1-3)
Phase 1 is about building pattern intuition on familiar ground. You will work with arrays, strings, hash maps, and two pointers — the data structures and techniques you partially know from general programming. The goal is not just to solve these problems but to articulate why each approach works, which prepares you to generalize.
Start with the NeetCode core cluster: Contains Duplicate, Two Sum, Valid Anagram, Group Anagrams, and Products of Array Except Self. These five problems introduce hash map counting patterns, the trade-off between time and space, and the idea that preprocessing an array once can make subsequent operations trivial.
Two pointers rounds out Phase 1. Valid Palindrome, Two Sum II (sorted input), Container With Most Water, and Trapping Rain Water teach you to eliminate the O(n²) brute force by maintaining two boundary indices and moving the one with less leverage. By week 3 you should be solving Phase 1 problems comfortably within 20 minutes.
- Arrays & Hashing: Contains Duplicate, Two Sum, Valid Anagram, Group Anagrams, Top K Frequent Elements
- String manipulation: Valid Palindrome, Longest Common Prefix, Encode and Decode Strings
- Two Pointers: Two Sum II, 3Sum, Container With Most Water, Trapping Rain Water
- Target: solve any Phase 1 problem in under 20 minutes by end of week 3
Phase 1 Study Tip
Spend 70% of your Phase 1 time understanding patterns and 30% solving new problems. For every problem you solve, write down the pattern name and the one-line insight that makes it work. Pattern recognition transfers to unseen problems — memorized solutions do not.
Phase 2: Core Patterns (Weeks 4-8)
Phase 2 is where the biggest gains happen. Six patterns — sliding window, binary search, linked list, stack and queue, trees, and graphs — each unlock a category of problems that seemed impossible before. Plan on 5-7 problems per pattern, mostly medium difficulty, working each pattern for 2-3 days before moving to the next.
Sliding window extends the two-pointer idea to subarray problems: Longest Substring Without Repeating Characters, Permutation in String, Minimum Window Substring, and Sliding Window Maximum. Binary search is not just for sorted arrays — it applies anywhere you can define a monotonic decision function, making problems like Koko Eating Bananas and Find Minimum in Rotated Sorted Array tractable.
Trees and graphs are the heaviest investment of Phase 2. Depth-first and breadth-first search are the backbone of interview problems. Invest time in Invert Binary Tree, Level Order Traversal, Lowest Common Ancestor, Clone Graph, Number of Islands, and Pacific Atlantic Water Flow. By week 8 you should be solving medium tree and graph problems in under 30 minutes.
- 1Sliding Window (Week 4): Longest Substring Without Repeating Characters, Permutation in String, Minimum Window Substring
- 2Binary Search (Week 4-5): Binary Search, Search Rotated Array, Koko Eating Bananas, Find Minimum in Rotated Array
- 3Linked List (Week 5): Reverse Linked List, Merge Two Sorted Lists, Linked List Cycle, Reorder List, Find Duplicate Number
- 4Stack & Queue (Week 6): Valid Parentheses, Min Stack, Evaluate Reverse Polish Notation, Daily Temperatures
- 5Trees (Week 7): Invert Binary Tree, Max Depth, Level Order Traversal, Validate BST, Kth Smallest in BST, LCA
- 6Graphs BFS/DFS (Week 8): Number of Islands, Clone Graph, Pacific Atlantic Water Flow, Surrounded Regions, Course Schedule
Phase 3: Advanced Patterns (Weeks 9-12)
Phase 3 introduces the patterns that separate candidates who pass phone screens from candidates who get offers: dynamic programming, backtracking, greedy algorithms, heaps and priority queues, tries, union find, and monotonic stacks. These patterns are harder, but the same principle applies — learn the pattern, then the specific problems become variations on a theme.
Dynamic programming demands the most investment. The key insight is to always identify the subproblem structure before writing any code. Ask: what is the state? What is the recurrence? What are the base cases? Start with 1D DP (Climbing Stairs, House Robber, Min Cost Climbing Stairs) and build to 2D DP (Unique Paths, Coin Change, Longest Common Subsequence) before tackling the hardest cases (Edit Distance, Burst Balloons, Regular Expression Matching).
Backtracking problems — Subsets, Permutations, Combination Sum, Word Search, N-Queens — all follow the same template: choose, explore, unchoose. Heaps are essential for Top K Elements, K Closest Points, and Median from Data Stream. Tries unlock efficient prefix search in Add and Search Words and Word Search II. Union Find makes Graph Valid Tree and Number of Connected Components trivial.
- 1Dynamic Programming (Weeks 9-10): Climbing Stairs, House Robber, Coin Change, LCS, Edit Distance, Burst Balloons
- 2Backtracking (Week 10): Subsets, Permutations, Combination Sum, Word Search, Palindrome Partitioning
- 3Greedy (Week 11): Jump Game, Jump Game II, Gas Station, Hand of Straights, Merge Intervals
- 4Heap / Priority Queue (Week 11): Kth Largest Element, Top K Frequent, K Closest Points, Median from Data Stream
- 5Tries (Week 12): Implement Trie, Add and Search Words, Word Search II
- 6Union Find (Week 12): Graph Valid Tree, Number of Connected Components, Redundant Connection
- 7Monotonic Stack (Week 12): Largest Rectangle in Histogram, Car Fleet, Trapping Rain Water (stack approach)
Dynamic Programming Reality
DP alone accounts for roughly 30% of hard LeetCode problems and appears in 60%+ of senior engineering interviews. Invest extra time here. Start with Climbing Stairs and House Robber to internalize the recurrence mindset before tackling Coin Change and Edit Distance.
Phase 4: Integration (Weeks 13-16)
Phase 4 is about becoming interview-ready under real conditions. Mixed practice, mock interviews, and company-specific preparation replace pattern drilling. You now have the toolkit — Phase 4 is about deploying it at interview speed and under social pressure.
Simulate real interview conditions daily. Set a 25-minute timer for one medium problem and a 45-minute timer for one hard problem. If you cannot solve the medium in 25 minutes, you are not yet at interview pace — go back and drill the relevant pattern for two more days. Do not skip the 45-minute hard sessions; they build the mental endurance required when an interviewer gives you a problem you have never seen.
Company-specific preparation belongs here. Google favors graphs, BFS/DFS, and clever DP. Meta leans heavily on trees, arrays, and system design. Amazon emphasizes practical OOP design and BFS. Use the last two weeks to pull company-tagged problems from LeetCode, do at least four full mock interviews on Pramp or interviewing.io, and review your notes from Phases 1-3 to consolidate everything into pattern recall rather than solution recall.
- 1Week 13: Mixed medium practice — 2 mediums daily, one timed (25 min), one untimed with full solution review
- 2Week 14: Mixed hard practice — 1 hard daily (45 min timer), 2 mediums for confidence maintenance
- 3Week 15: Company-specific tag drilling — pull top 20 problems for your target companies, timed
- 4Week 16: Full mock interviews — 4 Pramp sessions, 1 interviewing.io session, review all pattern notes
Time Management
The 16-week roadmap assumes 2-3 hours of focused daily practice. Structure matters as much as volume: morning sessions are for learning new patterns and solving one problem cold; evening sessions are for reviewing yesterday's solution, reading an editorial, and solving one more problem with the pattern fresh. Weekend sessions run longer and include mock interviews.
Weekly targets: 10-12 new problems per week in Phases 1-2, dropping to 7-10 in Phases 3-4 as the problems take longer. Total target across 16 weeks is approximately 150 problems solved deeply — meaning you could reconstruct the solution the next day without seeing the code — plus 100 additional problems reviewed but not necessarily solved from scratch.
Track your time-to-solve metric weekly. In week 1 you might average 40 minutes per medium. By week 8 target 25 minutes. By week 14 target 18-20 minutes. If your average is not dropping, you are grinding without pattern internalization — slow down, review more editorials, and articulate the pattern in your own words before moving on.
- Morning (60-90 min): learn pattern concept + solve 1 cold problem in the pattern
- Evening (60-90 min): review solution + editorial + solve 1 more with pattern fresh
- Weekend (3-4 hours): mock interview (90 min) + 2-3 harder problems + pattern notes review
- Weekly: 10-12 new problems Phases 1-2, 7-10 new problems Phases 3-4
- Total: ~250 problems encountered, ~150 solved deeply across 16 weeks
Diminishing Returns Warning
Diminishing returns hit hard after 300 problems. If you can consistently solve LeetCode mediums in under 20 minutes and explain your approach clearly, stop grinding and start interviewing. More problems at that stage does less for you than real interview reps.
Resources and Next Steps
The best resources complement this roadmap rather than replace it. YeetCode flashcards are built specifically for pattern review — use them during your evening sessions to drill the pattern name, key problems, and the one-line insight for each technique. Spaced repetition means patterns stay accessible for months without re-solving problems from scratch.
NeetCode 150 is the gold-standard curated problem list for this roadmap. Every problem referenced in this guide appears there. The NeetCode YouTube channel has high-quality video walkthroughs for every problem — watch one walkthrough per pattern on your first pass, then solve the remaining problems in the pattern independently. LeetCode contests (weekly and biweekly) are invaluable for Phase 4: timed, high-pressure, graded against peers.
For mock interviews, Pramp offers free peer-to-peer sessions where both parties interview each other. Interviewing.io connects you with experienced interviewers from FAANG companies. Do at least four mock sessions before your real interviews — the social pressure of articulating your thought process out loud to another person is a skill that only improves through practice, not more problem solving.
- YeetCode flashcards — spaced repetition for pattern review, use during evening sessions
- NeetCode 150 — the curated 150-problem list that maps directly to this roadmap
- NeetCode YouTube — one video walkthrough per pattern on first pass, then solve independently
- LeetCode Weekly/Biweekly Contests — mandatory in Phase 4 for time-pressure practice
- Pramp — free peer mock interviews, aim for 4+ sessions before real interviews
- Interviewing.io — experienced FAANG interviewers for realistic late-stage practice