
Data structures and algorithms (DSA) are the core of coding interviews at product companies, and the foundation for exams like GATE. The problem is not a lack of material; it is knowing what to learn, in what order, and which patterns actually matter. This roadmap answers exactly that.
The Learn DSA series on CodingHumans has 13 parts. Each part explains one topic from scratch, shows the patterns interviewers ask about, gives clean code in C++ and Java, lists practice problems from easy to hard, and ends with interview questions and links to MCQ practice. Work through them in order: each part builds on the earlier ones.
1. All 13 parts
2. What each part covers
| Part | Topic | What you will learn | Key pattern |
|---|---|---|---|
| 1 | Time and Space Complexity | Big-O notation, analysing loops and recursion, space and amortized cost | Estimate complexity from input limits |
| 2 | Arrays and Strings | Arrays, strings, prefix sums, Kadane's algorithm, matrices | Prefix sums, in-place reversal |
| 3 | Hashing | HashMap, HashSet, collisions, C++ and Java containers | Counting, complement lookup, prefix sum + map |
| 4 | Two Pointers and Sliding Window | Two pointers, fast/slow pointers, fixed and variable windows | Expand-and-shrink window template |
| 5 | Linked List | Reversal, Floyd's cycle detection, dummy heads, merging | Slow/fast pointers, dummy node |
| 6 | Stack and Queue | Stacks, queues, deques, design questions | Monotonic stack and deque |
| 7 | Recursion and Backtracking | Recursion, call stack, backtracking template, pruning | Choose, explore, un-choose |
| 8 | Sorting and Binary Search | Merge sort, quick sort, quickselect, binary search | Binary search on the answer |
| 9 | Trees and BST | Binary trees, traversals, BSTs, balanced trees | Combine left and right subtree answers |
| 10 | Heaps and Priority Queue | Heaps, priority queues in C++ and Java | Top K, merge K lists, two heaps |
| 11 | Graphs | BFS, DFS, topological sort, Dijkstra, union-find | Model the problem as nodes and edges |
| 12 | Greedy Algorithms | Greedy choice, intervals, Jump Game, Gas Station | Sort then pick; exchange argument |
| 13 | Dynamic Programming | Memoization, tabulation, knapsack, LCS, LIS | State, transition, base case, order, answer |
3. An 8-week study plan
At about 1.5 to 2 hours a day, this plan covers the whole series with time for practice. If you have more time, go faster; if you have less, stretch it out, but keep the order.
| Week | Parts | Goal |
|---|---|---|
| 1 | 1, 2 | Read complexity confidently; solve easy array and string problems |
| 2 | 3, 4 | Use hash maps and windows to turn O(n^2) solutions into O(n) |
| 3 | 5, 6 | Handle pointer manipulation and monotonic stacks without bugs |
| 4 | 7, 8 | Write backtracking and binary search from a template |
| 5 | 9, 10 | Solve tree problems recursively; know when to use a heap |
| 6 | 11 | Model problems as graphs; BFS, DFS, topological sort, Dijkstra |
| 7 | 12, 13 | Recognise greedy versus DP; solve classic DP problems |
| 8 | Revision | Mixed practice and timed mock interviews across all topics |
4. How to practise effectively
- Patterns over problem counts. Solving 150 well-chosen problems and understanding the pattern behind each beats rushing through 500.
- Time-box each attempt. Try a problem for 25 to 40 minutes. If stuck, read a hint or the approach, then close it and code it yourself.
- Always state complexity. Before coding, say the time and space of your idea, and whether the input limits allow it (Part 1).
- Revisit after a few days. Re-solve problems you needed help with. Spaced repetition is what makes patterns stick.
- Test yourself with MCQs. Short quizzes reveal gaps in theory quickly; links are below.
- Practise explaining out loud. Interviews reward clear reasoning as much as working code.
FAQ
How long does it take to learn DSA for interviews?
With steady daily practice, about two to three months is typical for a solid foundation: roughly eight weeks to go through the topics and a few more weeks of mixed practice. Prior programming experience shortens this.
Do I need to learn every topic before applying?
Parts 1 to 9 cover most interview questions. Graphs, greedy and dynamic programming appear more at product companies and in senior rounds, so finish them before those interviews.
How many problems should I solve?
Around 150 to 250 problems spread across all topics is enough for most candidates, as long as you understand the pattern behind each one. Each part lists 12 to 15 problems to start with.
Is this series useful for GATE CSE?
Yes. The theory on complexity, sorting, trees, heaps, hashing and graphs matches the GATE syllabus. Pair it with the GATE MCQ sets linked below for exam-style practice.
Comments
Post a Comment