Beginner Roadmap
DSA Roadmap 2026 — Coding Interview Learning Path
From fundamentals to advanced patterns. Work through each phase in order for the best results.
Hash Map / Set
Trade space for time using O(1) lookup to find pairs, duplicates, and frequencies.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Contains Duplicate | Easy | High | |
| Isomorphic Strings | Easy | Medium | |
| Number of Good Pairs | Easy | Medium | |
| Two Sum | Easy | High | |
| Valid Anagram | Easy | High | |
| Word Pattern | Easy | Medium | |
| 4Sum II | Medium | Medium | |
| Group Anagrams | Medium | High | |
| Longest Consecutive Sequence | Medium | High | |
| LRU Cache | Medium | High | |
| Subarray Sum Divisible by K | Medium | Medium | |
| Top K Frequent Elements | Medium | High |
Two Pointers
Use two indices moving toward each other or in the same direction to solve linear problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Move Zeroes | Easy | Medium | |
| Remove Duplicates from Sorted Array | Easy | High | |
| Squares of a Sorted Array | Easy | High | |
| Valid Palindrome | Easy | High | |
| Valid Palindrome II | Easy | High | |
| 3Sum | Medium | High | |
| 4Sum | Medium | Medium | |
| Boats to Save People | Medium | Medium | |
| Container With Most Water | Medium | High | |
| Minimum Length of String After Deleting Similar Ends | Medium | Low | |
| Sort Colors | Medium | High | |
| Two Sum II - Input Array Is Sorted | Medium | High | |
| Trapping Rain Water | Hard | High |
Sliding Window
Efficiently process subarrays or substrings of a fixed or variable size.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Count Number of Nice Subarrays | Medium | Medium | |
| Find All Anagrams in a String | Medium | Medium | |
| Frequency of the Most Frequent Element | Medium | Medium | |
| Fruit Into Baskets | Medium | Low | |
| Longest Repeating Character Replacement | Medium | Medium | |
| Longest Subarray of 1's After Deleting One Element | Medium | Medium | |
| Longest Substring Without Repeating Characters | Medium | High | |
| Max Consecutive Ones III | Medium | Medium | |
| Maximum Number of Vowels in a Substring of Given Length | Medium | Medium | |
| Minimum Operations to Reduce X to Zero | Medium | Medium | |
| Minimum Size Subarray Sum | Medium | Medium | |
| Permutation in String | Medium | Medium | |
| Subarray Product Less Than K | Medium | Low | |
| Minimum Window Substring | Hard | High | |
| Sliding Window Maximum | Hard | Medium |
Stack
LIFO structure for matching brackets, evaluating expressions, and monotonic problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Valid Parentheses | Easy | High | |
| Asteroid Collision | Medium | Medium | |
| Basic Calculator II | Medium | High | |
| Car Fleet | Medium | Medium | |
| Daily Temperatures | Medium | High | |
| Decode String | Medium | Medium | |
| Evaluate Reverse Polish Notation | Medium | Medium | |
| Min Stack | Medium | High | |
| Remove K Digits | Medium | Medium | |
| Simplify Path | Medium | Medium |
Binary Search
Halve the search space each step to find an element or boundary in O(log n).
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Binary Search | Easy | High | |
| Capacity to Ship Packages Within D Days | Medium | High | |
| Find Minimum in Rotated Sorted Array | Medium | High | |
| Find Peak Element | Medium | Medium | |
| Koko Eating Bananas | Medium | Medium | |
| Search a 2D Matrix | Medium | High | |
| Search in Rotated Sorted Array | Medium | High | |
| Time Based Key-Value Store | Medium | Medium | |
| Median of Two Sorted Arrays | Hard | High | |
| Split Array Largest Sum | Hard | Medium |
Prefix Sum
Precompute cumulative sums to answer range queries in O(1).
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Find Pivot Index | Easy | High | |
| Range Sum Query - Immutable | Easy | Medium | |
| Running Sum of 1D Array | Easy | Medium | |
| Contiguous Array | Medium | Medium | |
| Minimum Average Difference | Medium | Low | |
| Product of Array Except Self | Medium | High | |
| Subarray Sum Equals K | Medium | High |
Linked List
Pointer manipulation for in-place list operations without extra memory.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Linked List Cycle | Easy | High | |
| Merge Two Sorted Lists | Easy | High | |
| Palindrome Linked List | Easy | High | |
| Reverse Linked List | Easy | High | |
| Add Two Numbers | Medium | High | |
| Copy List with Random Pointer | Medium | High | |
| Remove Nth Node From End of List | Medium | High | |
| Reorder List | Medium | Medium | |
| Rotate List | Medium | Medium | |
| Swap Nodes in Pairs | Medium | Medium | |
| Reverse Nodes in k-Group | Hard | High |
Trees / DFS
Recursive and iterative depth-first traversal for tree structure problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Diameter of Binary Tree | Easy | High | |
| Invert Binary Tree | Easy | High | |
| Maximum Depth of Binary Tree | Easy | High | |
| Symmetric Tree | Easy | High | |
| Binary Tree Right Side View | Medium | High | |
| Construct Binary Tree from Preorder and Inorder Traversal | Medium | Medium | |
| Count Good Nodes in Binary Tree | Medium | Medium | |
| Flatten Binary Tree to Linked List | Medium | Medium | |
| Kth Smallest Element in a BST | Medium | High | |
| Lowest Common Ancestor of a BST | Medium | High | |
| Path Sum II | Medium | Medium | |
| Populating Next Right Pointers in Each Node | Medium | Medium | |
| Sum Root to Leaf Numbers | Medium | Medium | |
| Validate Binary Search Tree | Medium | High | |
| Binary Tree Maximum Path Sum | Hard | High | |
| Serialize and Deserialize Binary Tree | Hard | Medium |
Queue / BFS
Level-by-level traversal for shortest paths and layer-based problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| 01 Matrix | Medium | High | |
| Binary Tree Level Order Traversal | Medium | High | |
| Jump Game III | Medium | Medium | |
| Minimum Genetic Mutation | Medium | Medium | |
| Number of Islands | Medium | High | |
| Open the Lock | Medium | Medium | |
| Rotting Oranges | Medium | High | |
| Shortest Path in Binary Matrix | Medium | Medium | |
| Walls and Gates Premium | Medium | Medium | |
| Word Ladder | Hard | Medium |
Heap / Priority Queue
Efficiently track the k-th largest/smallest element or merge sorted sequences.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Find K Pairs with Smallest Sums | Medium | Medium | |
| K Closest Points to Origin | Medium | High | |
| Kth Largest Element in an Array | Medium | High | |
| Minimum Cost to Connect Sticks Premium | Medium | Medium | |
| Reorganize String | Medium | Medium | |
| Task Scheduler | Medium | Medium | |
| Top K Frequent Words | Medium | Medium | |
| Find Median from Data Stream | Hard | High | |
| Merge K Sorted Lists | Hard | High |
Backtracking
Explore all possibilities recursively, pruning invalid branches early.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Combination Sum | Medium | High | |
| Combination Sum II | Medium | Medium | |
| Generate Parentheses | Medium | High | |
| Letter Combinations of a Phone Number | Medium | High | |
| Palindrome Partitioning | Medium | Medium | |
| Permutations | Medium | High | |
| Subsets | Medium | High | |
| Subsets II | Medium | Medium | |
| Word Search | Medium | High | |
| N-Queens | Hard | Medium |
Graphs
DFS and BFS on adjacency lists for connectivity, cycles, and path problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| All Paths From Source to Target | Medium | Medium | |
| Cheapest Flights Within K Stops | Medium | High | |
| Clone Graph | Medium | High | |
| Find Eventual Safe States | Medium | Medium | |
| Minimum Height Trees | Medium | Medium | |
| Network Delay Time | Medium | Medium | |
| Number of Connected Components in Undirected Graph Premium | Medium | Medium | |
| Pacific Atlantic Water Flow | Medium | Medium | |
| Surrounded Regions | Medium | Medium |
Dynamic Programming
Break problems into overlapping subproblems and build up solutions bottom-up.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Best Time to Buy and Sell Stock | Easy | High | |
| Climbing Stairs | Easy | High | |
| Min Cost Climbing Stairs | Easy | High | |
| Best Time to Buy and Sell Stock with Cooldown | Medium | Medium | |
| Best Time to Buy and Sell Stock with Transaction Fee | Medium | Medium | |
| Coin Change | Medium | High | |
| Decode Ways | Medium | High | |
| House Robber | Medium | High | |
| House Robber II | Medium | High | |
| Integer Break | Medium | Low | |
| Interleaving String | Medium | Medium | |
| Longest Common Subsequence | Medium | High | |
| Longest Increasing Subsequence | Medium | High | |
| Longest Palindromic Substring | Medium | High | |
| Maximum Product Subarray | Medium | High | |
| Maximum Subarray | Medium | High | |
| Minimum Path Sum | Medium | High | |
| Palindromic Substrings | Medium | High | |
| Partition Equal Subset Sum | Medium | High | |
| Perfect Squares | Medium | Medium | |
| Target Sum | Medium | High | |
| Triangle | Medium | Medium | |
| Unique Paths | Medium | High | |
| Word Break | Medium | High | |
| Edit Distance | Hard | Medium | |
| Regular Expression Matching | Hard | Medium |
Greedy
Make the locally optimal choice at each step to achieve a globally optimal solution.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Gas Station | Medium | Medium | |
| Jump Game | Medium | High | |
| Jump Game II | Medium | High | |
| Meeting Rooms II Premium | Medium | High | |
| Minimum Number of Arrows to Burst Balloons | Medium | Medium | |
| Non-overlapping Intervals | Medium | High | |
| Queue Reconstruction by Height | Medium | Medium | |
| Candy | Hard | Medium |
Intervals
Merge, insert, and count overlapping intervals after sorting by start time.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Meeting Rooms Premium | Easy | High | |
| Insert Interval | Medium | High | |
| Merge Intervals | Medium | High | |
| Minimum Interval to Include Each Query | Hard | Low |
Matrix
Navigate 2D grids with DFS/BFS, rotation, spiral traversal, and flood fill.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Count Negative Numbers in a Sorted Matrix | Easy | Medium | |
| Game of Life | Medium | Medium | |
| Maximal Square | Medium | High | |
| Rotate Image | Medium | High | |
| Search a 2D Matrix II | Medium | High | |
| Set Matrix Zeroes | Medium | High | |
| Spiral Matrix | Medium | High |
Bit Manipulation
Use bitwise operations to solve XOR, subset, and number theory problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Counting Bits | Easy | High | |
| Missing Number | Easy | High | |
| Number of 1 Bits | Easy | High | |
| Power of Two | Easy | Medium | |
| Reverse Bits | Easy | Medium | |
| Single Number | Easy | High | |
| Single Number II | Medium | Medium | |
| Sum of Two Integers | Medium | Medium |
Topological Sort
Linear ordering of vertices in a DAG — essential for dependency problems.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Course Schedule | Medium | High | |
| Course Schedule II | Medium | High | |
| Parallel Courses Premium | Medium | Medium | |
| Sequence Reconstruction Premium | Medium | Low |
Union Find
Disjoint set union for grouping, connectivity, and cycle detection.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Accounts Merge | Medium | Medium | |
| Most Stones Removed with Same Row or Column | Medium | Medium | |
| Number of Provinces | Medium | High | |
| Redundant Connection | Medium | Medium | |
| Satisfiability of Equality Equations | Medium | Medium | |
| Swim in Rising Water | Hard | Medium |
Trie
Prefix tree for efficient string search, autocomplete, and word matching.
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Design Add and Search Words Data Structure | Medium | Medium | |
| Implement Trie (Prefix Tree) | Medium | High | |
| Longest Word in Dictionary | Medium | Low | |
| Replace Words | Medium | Medium | |
| Word Search II | Hard | Medium |
Monotonic Stack
Maintain a sorted stack to find next/previous greater or smaller elements in O(n).
| Problem | Difficulty | Frequency | |
|---|---|---|---|
| Next Greater Element I | Easy | Medium | |
| 132 Pattern | Medium | Medium | |
| Online Stock Span | Medium | Medium | |
| Remove Duplicate Letters | Medium | Medium | |
| Sum of Subarray Minimums | Medium | Medium | |
| Largest Rectangle in Histogram | Hard | High |