DSA Study Plan & 12-Week Roadmap
Made with ❤️ by OpenShot Team
Preparing for technical interviews can feel overwhelming, but having a structured roadmap makes all the difference. This comprehensive DSA (Data Structures and Algorithms) study plan breaks down the essential topics into 7 digestible phases, complete with a 12-week calendar to keep you on track. Whether you're a fresh graduate gearing up for your first technical interview or an experienced engineer brushing up on fundamentals, this guide provides the core concepts, must-practice problems, and proven strategies you need to succeed. Remember: consistency beats intensity—small daily progress compounds into interview readiness.
If you're gearing up for system design and didn't catch my last post, here’s the link to get you started. System Design Prep Plan
Pre-Requisite
- Big O Notation: Understand the calculations (Read Prologue from the book).
- Arithmetics:
- O(logN) + O(N) = O(N)
- O(N) * O(logN) = O(NlogN)
- Choosing a Language For DSA interviews, language doesn’t matter much. What matters is the concepts. Use a language where you can subconsciously code correctly and quickly without many mistakes.
Phase 1: Linear Data Structures
List Data Structures
- Queue (FIFO)
- Stack (LIFO)
- Linked List (Best is to implement it from scratch.)
- Doubly Linked List (Implementing from scratch will help you practice the code.)
- Arrays (Understand differences: Array vs. Linked List)
Practice
- Search:
- Binary Search (O(logN)) - Variations: Unique elements, Duplicates, Element not present in the array.
- Two Pointers
- Search in Rotated Sorted Array
- Search element in a Linked List
- Sorting:
- Merge Sort (O(NlogN)) - Divide & Conquer
- Quick Sort
- Counting Sort (Great for large arrays with many duplicates)
- Pattern Problems:
- Valid Parentheses
- MinStack: Design a stack supporting push, pop, top, and O(1) minimum retrieval.
- Best time to buy/sell a Stock
- Implement Queue using Stacks
- Running Data Stream:
Phase 2: Optimizing Lookups (HashMaps & Sets)
Data Structures
- HashSet: For uniqueness. O(1) contains/duplicates checks.
- HashMap: Simple key-value store.
- Hashing Concepts: How it works (Video), how is hash stored, how to compute hash, near perfect hash functions, and how to handle collisions.
Practice
- Two Sum: (Sum is K). Variations: Three Sum, Multiplication is K.
- Group Anagrams: Categorize strings by character counts.
- Top K Frequent Elements
- LRU Cache
Phase 3: Trees (Hierarchy Phase)
Knowledge
- Terminology: Root, Parent, Child, Leaf, Height, Depth.
- Binary Tree: Max 2 children per node.
- Balanced Tree: The height of the Left and Right subtree of every node differs by one.
- Traversals: (Implement yourself for better understanding)
- Pre-Order
- In-Order
- Post-Order
- Level Order (BFS).
- Binary Search Tree (BST): Left Child < Node < Right Child.
Practice
- Maximum Depth of a Tree
- Path Sum:
- Binary Tree:
- Construct from Preorder/Inorder traversed arrays
- Count of nodes in a binary tree of height h (Apply simple maths)
- Diameter of a Binary Tree
- Right/Left View of the Binary Tree
- Invert a Binary Tree
- Same Tree check.
- BST:
- Search element in a BST
- Validate BST
Phase 4: Special Trees (Heaps & Tries)
Heaps
- Used for Priority Queues. Understand Max vs. Min Heap.
- Time complexity of insert, search, delete.
- Heapify: (O(N)) conversion of unsorted array to Heap.
Tries (Prefix Trees)
- Used for prefix searching, autocomplete, and spell checkers.
Practice
- Implement Heap using Arrays.
Left Child: 2i+1 (1st left child at 1st index), Right Child: 2i+2 (1st right child at 2nd index) - Top K Frequent Elements (Heap approach)
- Kth Largest element in Array
- Median from Data Stream
- Merge K Sorted Lists
- Implement Trie
- Longest Common Prefix.
Phase 5: Graphs
Knowledge
- Resource: (Read Chapter 3, 4 & 5 from the book)
- Node, Edge, Weight
- Directed/Undirected
- Cycles: Does a path exist that starts and ends at the same node?
- Connectivity: Can you reach every node from every other node?
- Graph Representation: Adjacency Matrix vs. Adjacency List.
- Fundamental Algorithms: (Implement these algorithms by yourself)
- Depth-First Search (Use recursion or a stack)
- Breadth-First Search (Use a queue)
- Weighted Breadth-First Search (Also known as Dijsktra)
- Topological Sort.
- Minimum Spanning Tree:
- Node first technique: Prim’s Algorithm
- Edge first technique: Kruskal’s Algorithm
Practice
- Find Path between two nodes
- Number of Islands
- Course Schedule
- Shortest Path:
- Network Delay Time
- Word Ladder
- Cheapest Flight (K stops).
- Queen Knight Problem
- Cycle Detection
- Redundant Connection
- Greedy:
Phase 6: Dynamic Programming
Approaches
- Top-Down (Memoization): Start with recursion or simple solution. If there is recalculation happening, then you can use memoization to store the results. Note: Memoization is a classic DP technique asked at big tech companies including Google, Meta, Amazon and Microsoft
- Bottom-Up (Tabulation): Start with smallest subproblem and fill a table (1D or 2D array) until you reach the final answer.
- Classic MIT Videos to understand DP: (Link). You will need an SWF player to watch the videos (Try Certfusion SWF Player Free).
Popular Problems
- Maximum Value Contiguous Subsequence
- Longest Increasing Subsequence
- Coin Change
- Integer Knapsack
- Edit Distance
Phase 7: Advanced Data Structures
- Disjoint Set Union (Union-Find): Reading Material (During my Google interview, this was the key to solving a complex connectivity problem. Must if you are 4+ years of experience)
- Range Query Structures: Segment Trees for range sums/minimums.
- Bit Manipulation: AND, OR, XOR, NOT patterns.
- Random Picks: Problems that are recently getting asked at companies esp at Google, Meta
12-Week Calendar Plan
| Week | Phase | Focus |
|---|---|---|
| Week 1 | Phase 1 | Big O, Arrays, and Linked List implementations. |
| Week 2 | Phase 1 | Stacks, Queues, and Search (Binary Search variations). |
| Week 3 | Phase 1 | Sorting algorithms and Pattern Problems (Parentheses, Stocks). |
| Week 4 | Phase 2 | Hashing concepts, HashSets, and HashMaps. |
| Week 5 | Phase 2 | Two/Three Sum, Anagrams, and LRU Cache. |
| Week 6 | Phase 3 | Tree Basics and Traversals (DFS/BFS implementations). |
| Week 7 | Phase 3 | BST, Path Sum, and Tree Construction problems. |
| Week 8 | Phase 4 | Heaps and Tries (Implementations and Top K problems). |
| Week 9 | Phase 5 | Graph Basics, DFS, BFS, and Cycle Detection. |
| Week 10 | Phase 5 | Dijkstra, Topological Sort, and MST. |
| Week 11 | Phase 6 | DP: Memoization and Tabulation basics (Knapsack, Coin Change). |
| Week 12 | Phase 7 | Union-Find, Bit Manipulation, and Random Pick problems. |
How to Approach Problems
- Understand the problem completely: Read the prompt multiple times until you can explain it to someone else.
- Think before coding: Plan your approach, draw it out, or write pseudo-code first.
- Start with brute force: Get a working solution on paper, even if it's inefficient.
- Optimize: Ask yourself "Can I do better?" Check for repetitive work or unnecessary space usage.
- Test your solution: Dry run your logic with a small example and consider edge cases.
Time Management
- The 30-Minute Rule: Spend 20–30 minutes struggling with a problem on your own before seeking help.
- The "Hint" Strategy: If stuck, look at a small hint rather than the full solution.
- Post-Solve Study: Even if your code passes, study the top-rated optimal solutions to learn new patterns.
- Spaced Repetition: Revisit difficult problems after 1 week, then again after 1 month.
Mock Interviews
- Platforms: Use tools like Pramp or Interviewing.io to simulate the pressure of a real interview. Aim to complete at least 2–4 mock interviews before your actual technical screens.
- Think Out Loud: Practice explaining your logic while you code. In an interview, silence is your enemy. But you can definitely ask your interviewer to give you 2 minutes to think in your head at any point within the interview.
Common Mistakes to Avoid
- Jumping to code too quickly: Always finalize your logic before typing; it saves time on debugging later.
- Ignoring edge cases: Always test for empty arrays, single elements, duplicates, or null inputs.
- Ignoring complexity: Never finish a problem without analyzing the Time (O) and Space (S) complexity.
- Conceptual "Traps": Understanding the concept isn't enough; you must be able to implement it from a blank file.
- Giving up too easily: The "struggle" is where the actual learning happens.
- Not revising: If you don't use it, you lose it. Use spaced repetition to keep patterns fresh.
Level Up Your Search with OpenShot
Most top-tier firms currently asking these advanced DSA questions are hiring right now. Browse jobs here
- Quality Companies: Verified roles from highly-rated employers. Browse companies here
- Zero Ghost Jobs: Daily updates pulled directly from source to ensure active listings.
- India-Centric: Curated specifically for the Indian software engineering market.
Good luck with your preparation! Remember: Consistency is more important than intensity. Solve problems daily and track your progress.