Data Structures & Algorithms
The Complete Zero-to-Hero Roadmap & Learning Resource Guide
Step-by-Step Curriculum Basics to Advanced Curated Resources Interview & Contest Ready
How to Use This Roadmap
Follow this structured roadmap sequentially from Phase 1 through Phase 6. Mastering Data Structures and Algorithms requires a
strong foundational understanding, constant pattern recognition, and regular problem-solving practice. Pick one primary programming
language (C++, Java, or Python) and stick with it throughout your preparation.
1. PRIMARY PROGRAMMING LANGUAGE SELECTION
LANGUAGE PROS FOR DSA RECOMMENDED FOR
C++ Fast execution speed, rich Standard Template Competitive programmers, high-performance tech
Library (STL) with efficient collections, industry roles, engineering students.
standard for competitive programming.
Java Strong Collection Framework, strictly object- Backend developer roles, enterprise interviews
oriented, memory management handled, heavily (Amazon, Google, SDE roles).
used in enterprise system interviews.
Python Clean and concise syntax, built-in data structures Data Science, Machine Learning, fast-paced
(list, dict, set), fast implementation during quick technical coding assessments.
technical interviews.
2. STEP-BY-STEP ROADMAP PHASES
PHASE 1: Foundations & Mathematical Warm-up (Weeks 1 – 2)
Focus on understanding computational thinking, time/space complexity analysis, and basic mathematical operations.
Basics Time & Space Complexity Basics Basic Mathematics & Logic
• Big-O Notation (O(1), O(log N), O(N), O(N log N), O(N²)) • Counting digits, reversing numbers, Palindrome check
• Best, Average, and Worst Case scenarios • Euclidean Algorithm for GCD & LCM
• Space Complexity (Auxiliary space vs Total space) • Prime Numbers & Sieve of Eratosthenes
• Identifying bottleneck loops & recursion stack space • Armstrong Numbers, Divisors, Fast Exponentiation
Basics Bit Manipulation Basics Basics Basic Recursion
• Bitwise AND (&), OR (|), XOR (^), NOT (~), Left/Right Shift • Base Condition & Call Stack understanding
• Check if i-th bit is set, Set/Clear i-th bit • Print 1 to N / N to 1 recursively
• Count set bits (Brian Kernighan’s Algorithm) • Sum of N numbers, Factorial, Fibonacci sequence
• XOR properties (Single number finding) • Reverse an Array / Palindrome String via Recursion
DSA Complete Roadmap & Resources Guide Page 1 of 5
PHASE 2: Fundamental Data Structures & Techniques (Weeks 3 – 5)
Master linear data structures, pointer manipulations, sliding window, and hashing.
Easy Medium Arrays & Core Techniques
• Basic Operations: Traversal, Insertion, Deletion, Searching (Linear & Binary), Rotation (Left/Right by K steps).
• Two Pointers Pattern: Pair with target sum, Remove duplicates from sorted array, Container with Most Water, 3Sum/4Sum.
• Sliding Window Pattern: Fixed Size Window (Max sum subarray of size K) & Variable Size Window (Longest substring without
repeating characters, Minimum window substring).
• Prefix Sum & Difference Array: Range Sum Queries, Subarray sum equals K, Equilibrium index.
• Kadane’s Algorithm: Maximum Subarray Sum, Maximum Product Subarray.
Easy Medium Hashing & Hash Tables
• Collision Resolution: Chaining vs Open Addressing (Linear Probing, Quadratic Probing).
• Hash Maps & Hash Sets usages and internal implementations.
• Key Problems: Count element frequencies, Two Sum, Longest consecutive sequence, Subarray with 0 sum, Group Anagrams.
Easy Medium Linked Lists (Singly, Doubly, Circular)
• Node structure creation, insertion, deletion, and reversal (Iterative & Recursive).
• Floyd’s Cycle Detection: Detecting loop in LL, finding the starting point of loop.
• Pointer Manipulation: Find middle node, Reverse in K-groups, Merge two sorted lists, Palindrome Linked List, LRU Cache
implementation using Doubly LL + HashMap.
Easy Medium Stacks & Queues
• Stack & Queue implementations using Arrays, Linked Lists, and Collections.
• Stack Applications: Valid Parentheses, Infix to Postfix/Prefix conversion, Expression Evaluation.
• Monotonic Stack Pattern: Next Greater Element, Next Smaller Element, Daily Temperatures, Largest Rectangle in Histogram,
Trapping Rain Water.
• Queue Variants: Circular Queue, Deque (Double-ended Queue), Sliding Window Maximum using Deque.
PHASE 3: Sorting, Searching & Backtracking (Weeks 6 – 7)
Deepen algorithmic problem-solving through binary search, divide-and-conquer, and state space exploration.
Easy Medium Searching Algorithms Easy Medium Sorting Algorithms
• Binary Search on 1D Arrays: Lower bound, Upper bound, • Basic Sorts: Bubble Sort, Selection Sort, Insertion Sort
Search in Rotated Sorted Array, Find Peak Element. (O(N²)).
• Binary Search on Answer Space: Aggressive Cows, Book • Advanced Sorts: Merge Sort, Quick Sort (Partitioning
Allocation Problem, Koko Eating Bananas, Capacity To Ship scheme), Heap Sort (O(N log N)).
Packages.
• Non-Comparison Sorts: Counting Sort, Radix Sort.
• 2D Array Binary Search: Matrix Search I & II.
• Custom Comparators & Stability of Sorting algorithms.
DSA Complete Roadmap & Resources Guide Page 2 of 5
Medium Hard Recursion & Backtracking
• Subsets generation / Power Set, Combination Sum I & II, Permutations.
• Classic Problems: N-Queens Problem, Sudoku Solver, Rat in a Maze, Word Search, Palindrome Partitioning.
PHASE 4: Non-Linear Data Structures & Trees (Weeks 8 – 10)
Master hierarchical data structures, binary search trees, priority queues, and graph representations.
Easy Medium Binary Trees & Binary Search Trees (BST)
• Tree Traversals: In-order, Pre-order, Post-order (Iterative & Recursive), Level-order (BFS), Zig-zag Traversal.
• Tree Properties: Height, Diameter, Maximum Path Sum, Balanced Binary Tree check, Lowest Common Ancestor (LCA).
• Views: Left View, Right View, Top View, Bottom View of a Binary Tree.
• Binary Search Trees: Search, Insert, Delete, Validate BST, Inorder Successor/Predecessor, Construct BST from Preorder, K-th
Smallest Element in BST.
Medium Priority Queues & Heaps
• Min-Heap & Max-Heap concepts, Binary Heap representations, Heapify algorithm.
• Top-K Patterns: K-th Largest/Smallest element, K Most Frequent Elements, Top K Frequent Words.
• Two Heaps Pattern: Find Median from Data Stream.
• Merge K Sorted Lists / Arrays using Min-Heap.
Medium Hard Graphs & Disjoint Set Union (DSU)
• Representations: Adjacency Matrix, Adjacency List.
• Graph Traversals: Breadth-First Search (BFS) & Depth-First Search (DFS).
• Cycle Detection: Undirected Graph (BFS/DFS, DSU) & Directed Graph (DFS, Kahn's Algorithm BFS).
• Topological Sort: Kahn's Algorithm (BFS) & DFS implementation.
• Shortest Path Algorithms: Dijkstra’s Algorithm (Priority Queue), Bellman-Ford Algorithm, Floyd-Warshall Algorithm.
• Minimum Spanning Tree (MST): Prim’s Algorithm, Kruskal’s Algorithm with Disjoint Set Union (Union by Rank & Path
Compression).
• Bipartite Graph: Graph Coloring technique (BFS/DFS).
PHASE 5: Dynamic Programming & Advanced Topics (Weeks 11 – 14)
Tackle complex optimization problems using Dynamic Programming, Tries, and Advanced Graph concepts.
DSA Complete Roadmap & Resources Guide Page 3 of 5
Medium Hard Dynamic Programming (DP)
• Core Concepts: Overlapping Subproblems, Optimal Substructure, Memoization (Top-down) vs Tabulation (Bottom-up), Space
Optimization.
• 1D DP: Climbing Stairs, Frog Jump, House Robber I & II, Maximum Sum of Non-Adjacent Elements.
• 2D/Grid DP: Ninja’s Training, Unique Paths I & II, Minimum Path Sum, Triangle.
• Knapsack DP: 0/1 Knapsack, Subset Sum Equal to K, Target Sum, Unbounded Knapsack, Coin Change I & II, Rod Cutting.
• Strings DP: Longest Common Subsequence (LCS), Longest Palindromic Subsequence, Edit Distance, Distinct Subsequences,
Wildcard Matching.
• Longest Increasing Subsequence (LIS): DP O(N²) vs Binary Search O(N log N) approach.
• Advanced DP Patterns: Matrix Chain Multiplication (MCM), Partition DP, DP on Trees, DP with Bitmasking.
Medium Tries (Prefix Trees) Hard Advanced Graph Algorithms
• Trie Node Structure, Insert, Search, StartsWith operations. • Strongly Connected Components (Kosaraju’s Algorithm,
• Count words, Longest Word with all Prefixes. Tarjan’s Algorithm).
• Maximum XOR of two numbers in an array using Trie. • Bridges and Articulation Points in Graphs.
• Eulerian Path and Circuit concepts.
3. BEST YOUTUBE CHANNELS FOR LEARNING DSA
PRIMARY FOCUS /
CHANNEL NAME WHY IT'S RECOMMENDED
LANGUAGE
takeUforward (Striver) C++ / Java / Python Famous for A2Z DSA Sheet, SDE Sheet, and crystal-clear step-by-step
explanations for Dynamic Programming, Graphs, and Trees.
NeetCode Python / C++ Creator of NeetCode 150 & Blind 75 sheets. Exceptional visual diagrams
and clean code walkthroughs tailored for interviews.
Abdul Bari Language Agnostic Unrivaled whiteboard explanations of core algorithm design techniques
(Algorithms) (Greedy, DP, Divide & Conquer, Graph algorithms).
Kunal Kushwaha Java Comprehensive complete DSA bootcamp playlist covering Java
fundamentals, recursion, linear and non-linear data structures.
William Fiset Java / Conceptual Former Google engineer offering top-tier animated tutorials on Data
Structures, Graph Theory, and Advanced Algorithms.
MIT OpenCourseWare Academic / Theoretical MIT 6.006 (Intro to Algorithms) & 6.046J (Design and Analysis of
Algorithms) for deep academic rigor and mathematical foundations.
Tech Dose C++ / Java Concise and intuitive explanations for popular interview problems and
complex patterns.
Pepcoding (Sumeet Malik) Java / C++ In-depth playlists on Level 1 & Level 2 DSA covering foundation,
recursion, dynamic programming, and trees thoroughly.
DSA Complete Roadmap & Resources Guide Page 4 of 5
4. BEST WEBSITES & PLATFORMS FOR PRACTICING
PLATFORM BEST USED FOR KEY FEATURES & RECOMMENDED USE CASE
LeetCode Technical Interview Prep Industry standard for tech interview practice. Focus on Top
Interview Questions, Company Tags, and Weekly Contests.
takeUforward (A2Z Structured Learning Roadmap Free comprehensive sheet mapping every concept directly to
Sheet) curated practice problems with video solutions.
[Link] Pattern-based Practice Categorized lists (Blind 75, NeetCode 150) grouped by problem-
solving patterns with full video breakdowns.
GeeksforGeeks (GFG) Concept Articles & Practice Extensive written tutorials, company interview experiences, and
daily practice problem challenges.
Codeforces Competitive Programming Best platform for improving speed, logic, and problem-solving
agility through timed contests (Div 2/3/4).
CSES Problem Set Core Algorithmic Mastery A high-quality collection of 300 classic algorithmic problems
covering DP, Graphs, Tree algorithms, and Range queries.
HackerRank Beginner Skill Building Great for learning initial language syntax, basic problem solving,
domain badges, and company screening assessments.
InterviewBit Time-bound Interview Mock Gamified interview prep platform organized topic-by-topic with
time constraints simulating real tech interviews.
5. RECOMMENDED PROBLEM-SOLVING STRATEGY & REVISION
The "Rule of 30 Minutes" & Problem-Solving Routine
When tackling a new problem:
1. Spend 15–20 minutes trying to think of brute-force and optimized approaches independently on pen and paper.
2. If stuck, check small hints or the high-level pattern without looking at the code.
3. If still stuck after 30–40 minutes, analyze the solution thoroughly, understand the intuition, close the solution, and write the code
from scratch yourself.
4. Always analyze the Time and Space Complexity before submitting.
Spaced Repetition & Pattern Notebook Strategy
• Maintain a Problem Journal: Record the core trick/pattern for hard problems rather than memorizing entire code blocks.
• Revision Cadence: Re-visit previously solved medium/hard problems on Day 3, Day 7, and Day 30 to lock algorithms into long-
term memory.
• Mock Tests & Timed Practice: Once comfortable with topics, give virtual contests on LeetCode / Codeforces to simulate real
interview pressure and constraints.
DSA Complete Roadmap & Resources Guide Page 5 of 5