DSA Master: 180 problems, organised by pattern
A concept-first roadmap of 180 curated LeetCode problems for mid-level interviews. Learn each pattern, solve the problems, and track your progress in your browser.
Phase 1 – Core DSA foundations
Essential topics. Don't skip them, even if you've solved some of these before.
- Arrays & Hashing (12 problems): HashMap, HashSet, Frequency counting, Prefix sums, Array indexing tricks
- Two Pointers (9 problems): Opposite-direction pointers, Fast/slow pointers, Sorted-array manipulation, Dutch National Flag
- Sliding Window (10 problems): Fixed window, Variable window, Frequency window, Monotonic deque
- Prefix Sum & Difference Arrays (6 problems): Prefix sums, Prefix frequency maps, Difference arrays, Range queries
- Binary Search (11 problems): Lower/upper bounds, Rotated arrays, Binary search on the answer, Monotonic predicates
- Sorting & Intervals (7 problems): Custom comparators, Merge sort, Quicksort, Interval merging, Sorting by endpoints
- Linked Lists (9 problems): Dummy nodes, Slow/fast pointers, Reversal, Pointer manipulation, Cycle detection
- Stack & Monotonic Stack (9 problems): Monotonic increasing/decreasing stacks, Expression evaluation, Stack simulation
- Queue, Deque & Heap (8 problems): PriorityQueue, Min/max heaps, Two heaps, Top-K, Deque
Phase 2 – Intermediate to advanced
The make-or-break phase for mid-level interviews: recursion, trees, graphs and DP.
- Recursion & Backtracking (9 problems): Recursion trees, Choose / explore / unchoose, Pruning, Duplicate handling
- Binary Trees (14 problems): DFS, BFS, Preorder / inorder / postorder, Level-order, Tree construction
- Binary Search Trees (5 problems): BST properties, Inorder traversal, Search, Insertion, Deletion
- Graphs (13 problems): Adjacency list & matrix, BFS & DFS, Cycle detection, Topological sort (Kahn's & DFS), Union Find / DSU, Dijkstra, MST – Prim's & Kruskal's
- Dynamic Programming (20 problems): 1D DP, 2D / Grid DP, Knapsack DP, Subsequence DP, String DP, State-machine DP, Interval DP
- Greedy Algorithms (8 problems): Greedy choice, Sorting, Interval scheduling, Local vs global optimum
- Trie & String Algorithms (5 problems): Trie construction, Prefix matching, KMP basics, String searching
- Bit Manipulation (5 problems): XOR, AND / OR, Shifts, Bit masks, Bit counting
Phase 3 – Extra mid-level challenges
Pick these up once the core patterns feel comfortable.
- Advanced Data Structures & Design (10 problems): HashMap + doubly linked list, Heaps, Ordered sets (TreeMap), Custom data structures, Amortized complexity
- Additional Challenging Patterns (10 problems): Merge-sort counting, BFS on grids/words, Dijkstra / binary search on grids, DP on squares & palindromes, DP + binary search