DSA Roadmap
This is the order I'm learning DSA in, and why. Each topic builds on the previous — the sequence matters.
Start here — the interview method
Patterns get you to a solution; method gets you through the room.
- Interview Process (UMPIRE) — a 6-step loop so you never freeze
- Communication & Whiteboard — how to think out loud and present code
- Big-O Primer — reason about trade-offs
- Study Plan — 1 / 2 / 6-week roadmaps + a curated problem set
Philosophy: learn patterns, not problems. Internalize a pattern and new problems become variations. Always plan your own approach before reading any solution.
Group 1 — The Recursion Family (built on Tree)
"We can learn about recursion: Base case; Recurrence Relation; How children respond to their parents; DFS, BFS."
Tree is the gateway. Once you understand how a tree node delegates work to its children and combines results on the way back up, the rest of this group follows naturally.
- Trees & Recursion — the foundation
- Backtracking — explore all paths, prune bad ones
- Dynamic Programming — memoize overlapping sub-problems
- Divide and Conquer — split, solve, merge
- Graphs — generalized trees with cycles
- Linked List — foundational node-chain structure; pointer manipulation practice for tree/graph work
Group 2 — Hashmap as a Supporting DS
"We can use this one as a supporting DS: Frequency; Memorize (memoize); Access key with O(1). Note: Anything can be a key."
Hashmap rarely stands alone — it amplifies every other technique.
- Hashmap — the universal supporting structure
- Prefix Sum — range queries powered by a hashmap
- Strings — frequency maps, anagram detection, window tricks
Group 3 — Sliding Window → Two Pointers
- Sliding Window — variable-length window that grows/shrinks to satisfy a condition
- Two Pointers — "main algorithm to check the sub-array with given conditions; slow-fast pointers; opposite-ends pointers"
- Intervals — merge/insert/sweep; an array-scan technique that pairs naturally with two-pointer thinking
Group 4 — Heap & Stack
- Heap & Stack — combined with hashmap, extremely useful in system design; "top is the most important thing"
- Greedy — the counterpart to DP: when the exchange argument holds, take the locally optimal choice; no memoization needed
Group 5 — Binary Search
- Binary Search — "define what to search, and the validation function is the most important thing"
Bonus (if you have time)
- Difference Array — range updates in O(1)
- Trie — prefix tree; I like this one a lot
- Union-Find (DSU) — connectivity queries
- Bit Manipulation — XOR tricks, masks, power-of-2 checks; surprisingly common in hard problems
- Topological Sort & Shortest Paths — Kahn's + Dijkstra
Further reading
- EngineerPro — Coding DSA Interview at Big Tech — 288 worked problems organized by pattern; the source this roadmap's interview-method notes draw on.