The Complete DSA Interview Prep Roadmap for 2026
Data structures and algorithms (DSA) are the backbone of technical interviews at product companies like Google, Amazon, and Microsoft, and increasingly at well-funded startups. The good news: the syllabus is finite and the patterns repeat. This roadmap gives you a topic-by-topic path and a study plan to go from basics to interview-ready.
How to use this roadmap
Don't grind random problems. For each topic: learn the concept, understand the common pattern, then solve 8–15 representative problems while narrating your approach out loud. Track the pattern behind each problem, not just the answer — that's what lets you adapt to unseen questions.
Phase 1: Foundations (Weeks 1–2)
Arrays & strings. The most common interview surface. Master: two pointers, sliding window, prefix sums, frequency counting with hash maps. Practice: longest substring without repeating characters, two-sum, maximum subarray (Kadane's), merge intervals, rotate array.
Hashing. Understand when a hash map turns an O(n²) scan into O(n). Practice: group anagrams, first non-repeating character, subarray sum equals k.
Time & space complexity. Be able to state Big-O for every solution and justify it. Interviewers ask "can you do better?" constantly.
Phase 2: Linear structures (Week 3)
Linked lists. Reversal (iterative + recursive), cycle detection (Floyd's), finding the middle, merging two sorted lists, removing the nth node from the end.
Stacks & queues. Valid parentheses, min stack, next greater element (monotonic stack), implement a queue with stacks. Recognise when a problem is "last-in-first-out" in disguise.
Phase 3: Trees & recursion (Weeks 4–5)
Binary trees & BSTs. Traversals (inorder, preorder, postorder, level-order/BFS), height/depth, validate a BST, lowest common ancestor, diameter, serialize/deserialize. Trees teach recursion, which underpins much of DSA.
Recursion & backtracking. Subsets, permutations, combinations, N-queens, word search. Learn the "choose → explore → un-choose" template.
Phase 4: Searching, sorting & heaps (Week 6)
Binary search. Not just on sorted arrays — on answer spaces too ("minimum capacity to ship packages," "search in rotated sorted array"). Master the boundary conditions.
Sorting. Know the mechanics and complexity of merge sort and quicksort, and when to use counting/bucket sort. Many problems reduce to "sort first."
Heaps / priority queues. Top-K elements, merge K sorted lists, find median from a data stream. Recognise "K largest/smallest/most frequent" as heap problems.
Phase 5: Graphs (Weeks 7–8)
Graph fundamentals. Representations (adjacency list/matrix), BFS and DFS. Practice: number of islands, clone a graph, course schedule (cycle detection), word ladder.
Advanced graphs. Topological sort, Dijkstra's shortest path, union-find (disjoint set), and minimum spanning tree basics. These appear in senior loops and harder product interviews.
Phase 6: Dynamic programming (Weeks 9–10)
DP is where most candidates stall — and where strong ones separate themselves. Learn the progression:
- 1-D DP: climbing stairs, house robber, coin change, maximum subarray.
- 2-D DP: longest common subsequence, edit distance, unique paths, 0/1 knapsack.
- DP on strings & intervals: palindromic substrings, matrix chain, burst balloons.
The key skill is identifying the state and the transition. Practise writing the recurrence before coding, and start from the brute-force recursion, then memoize, then tabulate.
Phase 7: System design primer (optional, for SDE-2+)
For mid/senior roles, add a high-level design layer: scaling reads/writes, caching, load balancing, sharding, and classic prompts (URL shortener, rate limiter, news feed). See our system design interview tips.
How to practise effectively
- Narrate out loud. State the brute force, then optimise, then code, then test on edge cases (empty, single element, duplicates) — and state complexity unprompted.
- Spaced repetition. Revisit a topic a few days later; re-solve a problem from memory.
- Mock under pressure. Timed mock interviews expose gaps that untimed practice hides.
- Review patterns weekly. Keep a sheet: pattern → trigger → template.
Company-specific notes
- Google: heavy on algorithmic depth, clean code, and clear communication; expect graph/DP.
- Amazon: DSA plus strong Leadership Principles behavioural rounds — prepare behavioural stories too.
- Microsoft: balanced DSA with practical problem-solving and design at higher levels.
- Startups: often more practical, build-something rounds plus core DSA.
Make DSA practice free and role-specific
You don't need a paid course to prepare. Use a structured roadmap (this one), solve representative problems, and rehearse out loud. To make it role-specific, save the actual posting at your target company and generate an AI mock interview with DSA-style questions tied to that role — then iterate on the feedback until your reasoning is fluent. Pair it with our software engineer and technical interview prep guides.
Frequently asked questions
How long does DSA prep take? With consistent daily practice, 8–12 weeks to go from basics to interview-ready; less if you already know the fundamentals.
How many problems should I solve? Quality over quantity — roughly 150–250 well-understood problems across patterns beats 1,000 skimmed ones.
Which language should I use? The one you're fastest and most accurate in. Python, Java, and C++ are all widely accepted.
Do I need competitive programming? No. Interview DSA is about patterns and clear communication, not contest-level tricks.
Pattern cheat sheet: trigger → technique
Recognising the pattern is most of the battle. Memorise these triggers:
- "Subarray / substring with a condition" → sliding window.
- "Pair / triplet summing to a target in a sorted array" → two pointers.
- "Top / K largest / K most frequent" → heap.
- "Next greater / smaller element" → monotonic stack.
- "Number of ways / min cost / can you reach" → dynamic programming.
- "Shortest path in an unweighted graph" → BFS; weighted → Dijkstra.
- "Connected components / detect cycle (undirected)" → union-find or DFS.
- "Generate all combinations / permutations" → backtracking.
- "Search in a sorted / rotated array, or minimise a max" → binary search.
When you read a new problem, ask which trigger it matches before writing code.
Representative problems per topic
- Arrays/strings: two-sum, longest substring without repeating characters, product of array except self, merge intervals, trapping rain water.
- Linked lists: reverse, detect cycle, merge two sorted lists, LRU cache.
- Trees: level-order traversal, validate BST, lowest common ancestor, serialize/deserialize, diameter.
- Graphs: number of islands, course schedule, clone graph, word ladder, network delay (Dijkstra).
- DP: climbing stairs, coin change, longest common subsequence, edit distance, house robber, 0/1 knapsack.
- Heaps: Kth largest, merge K sorted lists, find median from data stream.
Solve each while narrating the brute force, the optimisation, and the complexity.
A realistic mock-interview strategy
Two weeks before your interviews, switch from solving to simulating: timed sessions, talking through every step, on a whiteboard or plain editor (no autocomplete). Record yourself and review for silence, missed edge cases, and unclear explanations. Do at least 6–8 full mock rounds. The gap between "I can solve it at home" and "I can solve it while explaining under pressure" is exactly what mocks close.
Behavioural rounds matter too
At Amazon, Leadership Principles behavioural questions can be as decisive as the coding. Even at Google and Microsoft, communication and collaboration are scored. Prepare behavioural stories with the STAR method alongside your DSA — a brilliant coder who can't communicate or collaborate still gets "no hire."
Avoiding the most common DSA-prep mistakes
- Grinding volume without understanding patterns — 1,000 skimmed problems lose to 200 understood ones.
- Never practising out loud — silent solving doesn't build the explain-while-coding skill interviews test.
- Skipping DP because it's hard — it's the most common stall point; face it early.
- Ignoring complexity analysis — "can you do better?" is the most frequent follow-up.
- No timed mocks — pressure changes everything; rehearse it.
A 12-week study calendar
| Weeks | Focus | Goal |
|---|---|---|
| 1–2 | Arrays, strings, hashing, complexity | Two pointers, sliding window, prefix sums fluent |
| 3 | Linked lists, stacks, queues | Reversal, cycle detection, monotonic stack |
| 4–5 | Trees, recursion, backtracking | Traversals, BST ops, subsets/permutations |
| 6 | Searching, sorting, heaps | Binary search on answer spaces, top-K |
| 7–8 | Graphs | BFS/DFS, topological sort, Dijkstra, union-find |
| 9–10 | Dynamic programming | 1-D, 2-D, string/interval DP |
| 11 | System design primer (SDE-2+) | Caching, sharding, classic prompts |
| 12 | Mock interviews + behavioural | Timed, out-loud, with feedback |
Adjust the pace to your starting point, but keep the order — each phase builds on the last.
How to review and retain
Spaced repetition beats marathon sessions. Re-solve a problem from memory a few days after first learning it, and keep a "patterns" sheet (trigger → technique → template) you review weekly. When you get stuck, study the solution, then close it and re-implement from scratch — passive reading of solutions creates false confidence.
Free resources strategy
You don't need a paid bootcamp. Use this roadmap for structure, a free judge to test your code, and free explanations for concepts you find hard. The one thing self-study misses is realistic, timed interview rehearsal — close that gap with free AI mock interviews tied to your target company's posting, so you practise explaining solutions under pressure, not just solving them.
Handling the interview itself
When you get the problem: restate it, clarify constraints and input size, state a brute force, then optimise out loud before coding. Write clean code with good names, test on edge cases (empty, single element, duplicates), and state complexity unprompted. If you stall, narrate where you're stuck and propose a fallback — interviewers reward engaged problem-solving over silent perfection.
Final DSA readiness checklist
- All core patterns recognised on sight (sliding window, two pointers, BFS/DFS, DP, heap, binary search)
- 150–250 problems solved with understanding, not memorisation
- Can explain complexity for every solution
- 6–8 timed mock interviews done out loud
- Behavioural stories prepared alongside DSA
Staying consistent over 12 weeks
The hardest part of DSA prep isn't any single topic — it's consistency over three months. Protect a fixed daily slot, even if it's only 60–90 minutes, and treat it as non-negotiable. Track your progress visibly (a simple spreadsheet of topics and problems solved) so you can see momentum building. Mix difficulty: a couple of easy wins to warm up, then one harder problem that stretches you. When motivation dips, switch to mock interviews — the realism and time pressure re-engage your focus and remind you why the patterns matter. Above all, prioritise understanding over count: ten problems you can re-derive and explain are worth more than fifty you copied. Sustained, understanding-focused practice is what turns the roadmap into offers.
Key takeaways
- The DSA syllabus is finite and the patterns repeat — learn to recognise the trigger, then apply the technique.
- Follow the phased roadmap: foundations → linear structures → trees/recursion → searching/sorting/heaps → graphs → dynamic programming.
- Don't skip dynamic programming; it's the most common stall point and a key differentiator.
- Practise out loud, state complexity unprompted, and always test on edge cases.
- Prepare behavioural stories alongside DSA — communication and collaboration are scored even at top product companies.
- Consistency over 12 weeks beats bursts; quality (150–250 understood problems) beats raw volume.
- Timed mock interviews close the gap between solving at home and performing under pressure.
Start today
The roadmap only works if you start. Pick today's topic, solve three problems out loud, and note the pattern behind each. Repeat tomorrow. Twelve weeks of that compounding effort is what turns "I'm bad at DSA" into a confident, offer-winning interview performance.
Practice for your exact role with ClavePrep
Reading tips only takes you so far — interviews are won by rehearsing out loud and iterating on feedback. With ClavePrep you can save a real job posting (TCS, Infosys, Wipro, Accenture, or any role) straight from LinkedIn using the Chrome extension, then generate an AI mock interview tuned to that exact posting — technical, aptitude, or HR. Build your behavioural stories first with the free STAR Answer Builder, check your resume against the job with the ATS checker, and practise until your answers are automatic. It's free to start, no coaching-institute fees required.
