The DSA roadmap.In the order ideas build.
20 stops, 422 LeetCode problems. Two a day gets you to the end in about 7 months.
- Groundwork6 stops · 130
- Structures6 stops · 130
- Graphs & choices4 stops · 87
- Mastery4 stops · 75
PHASE 1Groundwork6 stops · 130 problems
Stop 1
Foundations
Big-O, complexity analysis and the basic math every later topic leans on.
5 problems- Complexity Analysis
- Simulation
- Digit Manipulation
Stop 2
Arrays, Strings & Hashing
Hash maps, frequency counting and prefix sums: the tools behind a third of all interview questions.
35 problems- Hash Map Lookup
- Hash Set
- Frequency Count
Stop 3
Two Pointers
Two indices moving through data to replace nested loops with a single pass.
20 problems- Opposite Ends
- Same Direction (Read/Write)
- Sort + Two Pointers
Stop 4
Sliding Window
Maintain a window over a sequence and update it incrementally instead of recomputing.
20 problems- Fixed-size Window
- Variable Window (Shrink When Invalid)
- Window + Frequency Map
Stop 5
Stack & Monotonic Stack
Last-in-first-out processing for parsing, undo-style logic and 'next greater' questions.
25 problems- Matching / Parsing
- Stack Simulation
- Monotonic Stack
Stop 6
Binary Search
Halve the search space each step, on arrays and, more powerfully, on the answer itself.
25 problems- Classic Binary Search
- Lower / Upper Bound
- Rotated Sorted Array
PHASE 2Structures6 stops · 130 problems
Stop 7
Linked List
Pointer manipulation: reversal, fast & slow pointers, merging and cache design.
25 problems- Dummy Head
- In-place Reversal
- Fast & Slow Pointers
Stop 8
Recursion & Backtracking
Think recursively, then explore every choice and undo it: subsets, permutations and search.
25 problems- Recursion Basics
- Divide & Conquer
- Subsets (Include / Exclude)
Stop 9
Binary Trees
Recursive DFS, level-order BFS, path problems, construction and lowest common ancestors.
35 problems- DFS Traversals (Pre / In / Post)
- BFS Level Order
- Bottom-up DFS (Return Values)
Stop 10
Binary Search Trees
Use the ordering invariant: inorder is sorted, and every step discards a subtree.
15 problems- BST Invariant (Bounds)
- Inorder = Sorted
- BST Insert / Delete
Stop 11
Heaps / Priority Queue
Always know the smallest or largest item in O(1): top-K, k-way merge, scheduling and running medians.
20 problems- Top-K with a Size-K Heap
- K-way Merge
- Two Heaps
Stop 12
Tries
Prefix trees for autocomplete, dictionary search and bitwise XOR tricks.
10 problems- Prefix Tree
- Trie + DFS (Wildcards)
- Trie + Backtracking
PHASE 3Graphs & choices4 stops · 87 problems
Stop 13
Graphs (BFS, DFS, Grid)
Model problems as nodes and edges; traverse with DFS and BFS, on explicit graphs and on grids.
35 problems- Grid DFS / Flood Fill
- BFS Shortest Path (Unweighted)
- Multi-source BFS
Stop 14
Advanced Graphs
Topological sort, Union-Find, Dijkstra, Bellman-Ford, Floyd-Warshall and minimum spanning trees.
20 problems- Topological Sort (Kahn / DFS)
- Union-Find (Disjoint Set Union)
- Dijkstra
Stop 15
Greedy
Make the locally best choice, and learn to prove it is globally optimal.
20 problems- Sort + Greedy
- Kadane's Algorithm
- Reachability (Jump Game)
Stop 16
Intervals
Sort by start or end, then merge, insert, count overlaps or sweep over events.
12 problems- Sort + Merge
- Insert into Sorted Intervals
- Sort by End (Greedy)
PHASE 4Mastery4 stops · 75 problems
Stop 17
Dynamic Programming – 1D
Recursion plus memory: define a state, write the recurrence, fill the table.
25 problems- Fibonacci-style Recurrence
- Take / Skip (House Robber)
- 0/1 Knapsack
Stop 18
Dynamic Programming – 2D & Advanced
Grids, two-string DP, stock state machines, interval DP and bitmask DP.
30 problems- Grid Paths
- Two-string DP (LCS / Edit Distance)
- State Machine DP
Stop 19
Bit Manipulation
XOR tricks, masks and counting bits: short, fast solutions that impress.
10 problems- XOR Cancellation
- Bit Counting
- Masks & Shifts
Stop 20
Math & Geometry
Matrix manipulation, number tricks and coordinate geometry that show up in interviews.
10 problems- Matrix Rotation / Traversal
- In-place Marking
- Digit & String Arithmetic