Complete DSA Roadmap for Interview Preparation
A 12-week structured plan covering arrays, trees, graphs, DP, and system design basics for product company interviews.
Share
Who this roadmap is for
This 12-week plan is designed for software engineers targeting product company interviews (SDE-1 to SDE-2 level). It assumes you know basic programming and can dedicate 2–3 hours daily. Adjust pace if you have more or less time, but do not skip the fundamentals.
Weeks 1–2: Arrays, strings, and two pointers
Build fluency with the most common interview patterns. Aim for 3–4 problems per day.
- Day 1–3: Array traversal, prefix sums, kadane's algorithm.
- Day 4–6: Two pointers (sorted arrays, palindromes, container with most water).
- Day 7–9: Sliding window (fixed and variable size).
- Day 10–12: String manipulation (anagrams, substrings, character frequency).
- Day 13–14: Review weak problems + 1 timed mock.
- Target: 40 problems, recognize pattern in under 3 minutes.
Weeks 3–4: Stacks, queues, linked lists, and hashing
These structures appear in medium problems across every company.
- Stacks: valid parentheses, monotonic stack, next greater element.
- Queues and deques: BFS foundations, sliding window maximum.
- Linked lists: reversal, cycle detection, merge sorted lists.
- Hash maps and sets: two-sum, grouping, frequency counting.
- Practice implementing each from scratch without IDE autocomplete.
- Target: 35 problems, clean implementation under 25 minutes.
Weeks 5–7: Trees and graphs
Tree and graph questions separate candidates who know patterns from those who memorize solutions.
- Week 5 — Trees: traversals (in/pre/post/level), BST operations, height and diameter.
- Week 6 — Trees advanced: LCA, serialize/deserialize, path sum problems.
- Week 7 — Graphs: BFS, DFS, topological sort, union-find, cycle detection.
- Learn to draw the tree/graph before coding every time.
- Practice 4–5 problems per day; trees and graphs need volume.
- Target: 50 problems, articulate BFS vs DFS trade-offs clearly.
Weeks 8–10: Dynamic programming
DP is the hardest topic for most candidates. Spend three full weeks — rushing here costs you onsite rounds.
- Week 8 — 1D DP: climbing stairs, house robber, coin change, LIS.
- Week 9 — 2D DP: grid paths, edit distance, knapsack variants.
- Week 10 — DP patterns: state machine, interval DP, partition problems.
- For each problem: define state, recurrence, base case, iteration order.
- If stuck for 30 min, read the solution, then re-solve from scratch next day.
- Target: 30 DP problems with spoken state-definition practice.
Week 11: Heaps, binary search, and bit manipulation
Fill gaps in high-frequency patterns before mock interview season.
- Heaps: top-K elements, merge K sorted lists, median from stream.
- Binary search: on arrays, on answer space (minimize maximum, capacity).
- Bit manipulation: XOR tricks, counting bits, power of two.
- Greedy: activity selection, interval scheduling, Huffman-style problems.
- Target: 25 problems across these topics.
Week 12: Mock interviews and weak area review
Shift from learning mode to performance mode. Simulate real interview conditions.
- Days 1–3: 2 timed mocks per day on InterviewVeda (coding + behavioral).
- Days 4–5: Review mistakes journal — re-solve every problem you failed in mocks.
- Days 6–7: Light review of core patterns, rest before real interviews.
- Practice on a plain text editor — no autocomplete, no run button.
- Record yourself explaining solutions aloud for communication practice.
System design basics (parallel track for SDE-2)
If you are targeting SDE-2 or senior roles, add 3–5 hours per week alongside the DSA plan from Week 5 onward.
- Learn: load balancers, caching, databases (SQL vs NoSQL), message queues.
- Practice: design URL shortener, chat system, news feed, rate limiter.
- Framework: requirements → estimation → API → data model → scaling → trade-offs.
- Read engineering blogs (Google SRE, Netflix, Uber) for real-world patterns.
How to track progress
Maintain a spreadsheet: problem name, pattern, difficulty, time taken, solved without hints (yes/no). Review weekly. If a pattern appears 3+ times in your mistakes journal, dedicate a half-day to it. Consistency over 12 weeks beats cramming over 2.
Related articles
Top 50 DSA Questions for Amazon Interviews
High-frequency patterns from Amazon OA and onsite loops — arrays, trees, graphs, and greedy.
Kavya Reddy
Senior SDE Mentor
Top 50 SQL Interview Questions
Joins, window functions, indexing, and query optimization — the SQL topics that appear in almost every data and backend interview.
Kavya Reddy
Senior SDE Mentor
Google Coding Interview Preparation
How to prepare for Google's coding rounds: problem-solving signals, complexity analysis, and communication expectations.
Priya Sharma
Interview Coach
Practice what you learned with AI mock interviews and resume tools.
Get started free