Quick answer: This DSA roadmap takes you from basics to interview-ready in 12 weeks with 1–2 hours of study a day. Learn topics in this order – complexity, arrays and strings, searching and sorting, linked lists, stacks and queues, recursion, trees, heaps and hashing, graphs, and dynamic programming – and finish with revision and mock interviews. Every tool you need is free.
Contents
- 12-week DSA roadmap
- How to study each topic
- Free tools and practice sites
- Interview readiness checklist
- FAQs
12-Week DSA Roadmap
| Week | Topic | Concepts to learn | Practice problems |
|---|---|---|---|
| Week 1 | Programming basics and complexity | Loops, functions, recursion basics, Big-O analysis | Write 15–20 small programs: reverse a number, check prime, factorial, Fibonacci |
| Week 2 | Arrays and strings | Two pointers, prefix sums, sliding window, hashing for counts | Two sum, maximum subarray, anagrams, longest substring without repeats |
| Week 3 | Searching and sorting | Binary search and its variations, merge sort, quick sort, counting sort | First/last occurrence, search in rotated array, sort colours |
| Week 4 | Linked lists | Singly, doubly and circular lists, fast and slow pointers | Reverse list, detect cycle, merge two sorted lists, find middle |
| Week 5 | Stacks and queues | Monotonic stack, deque, queue using stacks | Valid parentheses, next greater element, sliding window maximum |
| Week 6 | Recursion and backtracking | Recursion trees, subsets, permutations | Generate subsets, permutations, N-Queens, Sudoku solver |
| Week 7 | Trees and BST | Traversals, height, diameter, BST insert/delete, lowest common ancestor | Level order traversal, validate BST, path sum |
| Week 8 | Heaps and hashing | heapq, top-k problems, hash maps and sets | Kth largest, merge k sorted lists, group anagrams |
| Week 9 | Graphs – part 1 | Adjacency lists, BFS, DFS, connected components, cycle detection | Number of islands, clone graph, course schedule |
| Week 10 | Graphs – part 2 | Dijkstra, topological sort, union–find, minimum spanning tree | Network delay time, redundant connection, cheapest flights |
| Week 11 | Dynamic programming | Memoisation vs tabulation, 1-D and 2-D DP, knapsack, LCS | Climbing stairs, house robber, coin change, longest common subsequence |
| Week 12 | Revision and mock interviews | Mixed problems, time-bound practice, explaining solutions aloud | Two timed mock tests and revision of weak topics |
How to Study Each Topic
- Learn the idea (20 minutes): understand how the structure works and the time complexity of each operation.
- Implement it yourself (30 minutes): write a stack, queue, linked list or BST from scratch before using built-in tools.
- Solve 5–8 problems: start with easy ones and move to medium. If stuck for 30 minutes, read the solution, then solve it again the next day without help.
- Revise weekly: keep a notebook of patterns – two pointers, sliding window, BFS, DP state – and revisit it every weekend.
- Test yourself: use our DSA MCQs to check concepts quickly.
Free Tools and Practice Sites
- Language: Python, C++ or Java – all free. Python with VS Code is the easiest start.
- Practice: LeetCode (free problems), HackerRank, Codeforces and GeeksforGeeks practice sets.
- Visualise: draw structures on paper or use free online algorithm visualisers.
- Projects: apply what you learn with our 25 DSA projects in Python.
Interview Readiness Checklist
- I can state the time and space complexity of every operation on arrays, linked lists, stacks, queues, BSTs, heaps and hash maps.
- I can write binary search, BFS, DFS, merge sort and a linked list reversal without help.
- I recognise common patterns: two pointers, sliding window, monotonic stack, top-k with heaps, topological sort, 1-D and 2-D DP.
- I have solved about 150–250 problems across all topics.
- I can explain my approach aloud while coding. Practise with our DSA interview questions.
Frequently Asked Questions
How long does it take to learn DSA?
With 1–2 hours a day, most students can cover the core topics in about 12 weeks. Becoming fast at solving new problems takes regular practice after that.
Should I learn DSA in Python, C++ or Java?
Pick one language you already know and stay with it. Python lets you focus on logic with less code; C++ and Java are also excellent and widely used in interviews.
Is DSA needed for every software job?
Most product companies and many service companies test DSA in coding rounds. Even when it is not tested directly, it helps you write faster and cleaner code.
What are good free resources to practise DSA?
LeetCode (free problems), HackerRank, Codeforces and GeeksforGeeks practice sets are popular. Combine them with our DSA MCQs, interview questions and project ideas.