Learn every kind of DSA problem, and how to crack it.
A pattern-first course: for each topic you get the intuition, the signals that tell you to reach for it, copy-ready templates in Python and C++, fully worked problems, common bugs and a graded practice list with progress tracking.
Guides
Read these first, return to them oftenStudy Roadmap
A 12-week plan from zero to interview-ready, with what to study each week, how many problems to do, and how to practise so it sticks.
Pattern Recognition Guide
The decision table that maps problem signals and constraints to the right technique — the single most useful page for solving problems you've never seen.
Problem-Solving & Interview Framework
A repeatable process for any coding problem — clarify, explore examples, pick an approach, code cleanly, test, and communicate throughout.
Complexity Cheat Sheet
Operation costs for every major data structure and the time/space of every algorithm on this site, in one place.
Python & C++ Quick Reference
The standard-library tools you'll reach for constantly in Python and C++ — containers, sorting, heaps, bisect, strings and common gotchas.
Debugging & Edge Cases
A checklist of the inputs that break solutions and the bugs that appear again and again — use it before every submission.
Foundations
The vocabulary everything else is built on: cost models, recursion, and the core containers.01Big-O & Complexity Analysis
How to measure an algorithm's cost, read constraints to guess the intended solution, and reason about time and space like an interviewer.
02Recursion & Divide and Conquer
Think in terms of smaller subproblems. Base cases, the call stack, recursion trees, and the divide-and-conquer strategy behind merge sort, quickselect and more.
03Hash Maps & Sets
The O(1) lookup that turns quadratic brute force into linear time. Counting, complements, grouping by key, and designing good keys.
04Sorting Algorithms
How the classic sorts work, when stability matters, counting and bucket sorts for linear time, and using sorting as a preprocessing step to unlock other techniques.
Linear Structures
Arrays, strings, lists, stacks and queues — and the tricks that make them fast.05Arrays, Strings & Matrices
Contiguous memory and the in-place tricks that go with it — reversal, rotation, Kadane's algorithm, string building, and matrix traversal/rotation.
06Linked Lists
Pointer manipulation without fear. Dummy heads, reversal, fast & slow pointers, cycle detection, merging, and the tricks that keep list problems short.
07Stacks, Queues & Monotonic Structures
LIFO and FIFO containers, bracket matching, expression evaluation, and the monotonic stack/deque patterns for next-greater elements and sliding-window maxima.
Core Techniques
The reusable patterns behind most interview problems.08Two Pointers
Walk two indices through a sequence to replace nested loops with a single pass — opposite ends, same direction, and across two arrays.
09Sliding Window
Maintain a contiguous window and update it incrementally. Fixed-size windows, variable windows for longest/shortest, and the 'at most K' counting trick.
10Prefix Sums & Difference Arrays
Precompute cumulative totals to answer range queries in O(1), count subarrays with a target sum (even with negatives), and apply range updates with difference arrays.
11Binary Search
Halve the search space every step. One bug-free template for boundaries, searching rotated arrays, and the powerful 'binary search on the answer' technique.
12Backtracking
Systematically explore every choice, undo it, and try the next. Subsets, permutations, combinations, constraint puzzles, and the pruning that makes them fast enough.
13Greedy Algorithms
Make the locally best choice and never look back — when it works, how to prove it (exchange argument), and the classic greedy families.
14Intervals & Sweep Line
Sorting intervals, merging and inserting, detecting overlaps, counting maximum concurrency with sweep lines and heaps.
15Bit Manipulation
Think in binary. XOR tricks, masks, counting bits, subsets as integers, and the operations that turn O(n) memory into a single machine word.
16Heaps & Priority Queues
Always know the smallest (or largest) item in O(1) and update in O(log n). Top-K, K-way merge, two heaps for medians, and scheduling simulations.
Trees & Graphs
Hierarchies and networks: traversals, shortest paths, connectivity, ordering.17Binary Trees
Traversals (recursive, iterative, level-order), the 'return info up / pass info down' mindset, path problems, lowest common ancestor, and serialization.
18Binary Search Trees
The ordering invariant, search/insert/delete, validating with bounds, in-order = sorted, k-th smallest, and when to use balanced BSTs from the standard library.
19Tries (Prefix Trees)
A tree keyed by characters for fast prefix queries — autocomplete, word dictionaries with wildcards, grid word search, and binary tries for XOR problems.
20Graph Traversal (BFS, DFS, Topological Sort)
Representing graphs, BFS for shortest unweighted paths, DFS for components and cycles, grids as graphs, multi-source BFS, bipartite checks and topological ordering.
21Shortest Paths
Dijkstra for non-negative weights, Bellman-Ford for negatives and hop limits, Floyd-Warshall for all pairs, 0-1 BFS, DAG shortest paths, and modeling state in the graph.
22Union-Find (Disjoint Set Union)
Near-constant-time merging and connectivity queries. Path compression, union by size, counting components, detecting cycles, and weighted/offline variants.
23MST & Advanced Graph Algorithms
Minimum spanning trees (Kruskal, Prim), bridges and articulation points (Tarjan), strongly connected components, Eulerian paths, and binary lifting on trees.
Dynamic Programming
Turning exponential search into polynomial tables, one state at a time.24Dynamic Programming Fundamentals
The mental framework for DP — states, transitions, base cases, memoization vs tabulation, space optimization, and a repeatable five-step recipe.
251D Dynamic Programming
Linear DP over a sequence — take/skip decisions, decoding and partitioning, longest increasing subsequence, word break, and state-machine DP for stock problems.
262D DP — Grids & Strings
Grid path DP, and the two-sequence family — longest common subsequence, edit distance, distinct subsequences, regex/wildcard matching — plus palindromic substring DP.
27Knapsack & Subset DP
0/1, unbounded and bounded knapsack; subset sum and partition; counting combinations vs permutations; and why loop order and direction change the answer.
28Advanced DP (Interval, Tree, Bitmask, Digit)
The DP families that show up in hard problems — interval DP, DP on trees, bitmask DP over subsets, digit DP for counting numbers, and common optimizations.
Advanced
Range-query structures, string algorithms, math and design problems for the final stretch.29Segment Trees, Fenwick Trees & Sparse Tables
Answer range queries with updates in O(log n). Fenwick (BIT) for prefix sums and counting, segment trees for any associative operation with lazy propagation, and sparse tables for static min/max.
30String Algorithms
Linear-time pattern matching with KMP and the Z-function, rolling hashes (Rabin-Karp), Manacher's palindromes, and where suffix structures fit.
31Math & Number Theory
GCD, primes and sieves, modular arithmetic and inverses, fast exponentiation, combinatorics (nCr mod p), matrix exponentiation, geometry basics and useful identities.
32Data Structure Design Problems
Combining structures to hit target complexities — LRU and LFU caches, O(1) randomized sets, iterators, time-based stores, rate limiters and more.