Learn data structures and algorithms, end to end
21 chapters, 70 topics, ~514 problems. Read a lesson, solve the exercise, take a quiz. Your code compiles and runs in your browser — C++, Python and JavaScript today, Java soon.
Learn the Basics
Language fundamentals, time/space complexity, and the hashing intuition every other step rides on.
Variables, control flow, I/O, functions, and arrays in C++, Java, JavaScript, and Python.
Big-O notation, common growth classes, how to reason about loops, recursion, and amortized costs.
Hash maps, hash sets, frequency counting, the classic two-sum pattern.
Sorting Techniques
Build every classic sort from scratch. Then understand why we use the built-in sort for almost everything else.
Selection, bubble, insertion. Quadratic but instructive.
Merge sort, quick sort. The recursive sorts that get you to O(n log n).
Arrays
The most important data structure. Master the patterns here and binary search, two pointer, sliding window all click later.
Linear scans, two-pass tricks, basic counting. The warmup problems.
Kadane, Dutch national flag, majority element, set matrix zeroes, rotations.
Merge intervals, count inversions, median of two sorted arrays, reverse pairs.
Binary Search
Binary search isn't just for sorted arrays. Learn to recognize the monotonic predicate and you'll see binary search everywhere.
Classic lower bound, upper bound, first and last occurrence, rotated arrays.
Search over a range of possible answers. Aggressive cows, koko eating bananas, painter's partition.
Row-column elimination, treating a matrix as a flattened sorted array.
Strings — Basic and Medium
Character manipulation, palindromes, anagrams. The classic warmup before advanced string algorithms.
Reverse, palindrome check, anagram check, longest common prefix.
Roman to integer, group anagrams, longest substring without repeating, sort by frequency.
Linked Lists
Pointer manipulation that carries over to trees, graphs, allocators, parsers. Master the dummy node + two pointer patterns.
Build the data structure. Insertions, deletions, reversal, the most asked DSA topic in interviews.
Prev + next pointers. The data structure behind LRU caches and browser history.
Floyd's cycle detection, merge two sorted, remove nth from end, palindrome check, intersection.
Reverse in k-groups, copy list with random pointer, sort, flatten a multilevel list.
Recursion
Pattern by pattern. Once you internalize parametrized recursion, backtracking and dynamic programming both stop being scary.
Print 1 to N, factorial, sum of N, recursion tree intuition.
Power set, subsequences with sum K, count subsequences, the take-or-skip pattern.
N-queens, sudoku solver, rat in a maze, word break, palindrome partitioning.
Bit Manipulation
Bitwise tricks that turn O(n) lookups into O(1) and unlock subset enumeration, parity, XOR.
AND, OR, XOR, shift, set/clear/toggle the i-th bit.
Count set bits, single non-repeating, XOR of range, power of two, n divisors.
Stacks and Queues
LIFO and FIFO. Plus the monotonic stack and deque, two of the most reused patterns in competitive programming.
Implementations using arrays and linked lists. Stack from queues, queue from stacks.
Next greater element, daily temperatures, largest rectangle in histogram, sum of subarray minimums.
Sliding window maximum, the classic monotonic deque pattern.
Sliding Window and Two Pointer
Whenever you see 'longest subarray with property X', this is your tool. Internalize the expand-shrink template.
Pair sum on a sorted array, three sum, remove duplicates, container with most water.
Longest substring without repeating, max consecutive ones, minimum window substring, fruits into baskets.
Heaps and Priority Queues
The data structure of choice for top-K problems, streaming medians, and Dijkstra's algorithm.
Heapify, sift up, sift down, build heap in O(n), implement a priority queue from scratch.
K largest elements, K closest points to origin, K-th smallest in a sorted matrix, top K frequent.
Two-heap median, merge K sorted lists, the two-heap pattern.
Greedy Algorithms
When local optimal choices give the global optimum. Learn the standard problems and the proof patterns.
Assign cookies, lemonade change, valid parenthesis after replacements.
N meetings in one room, minimum platforms, job sequencing for max profit.
Fractional knapsack, jump game I and II, candy distribution, minimum coins.
Binary Trees
Traversals, structural problems, the most-asked tree patterns. Recursion on trees is the easiest place to internalize tree DP.
Preorder, inorder, postorder (recursive and iterative). Level order BFS. Morris traversal.
Height, diameter, balanced check, identical trees, symmetric trees, max path sum.
Build a tree from traversals, top/bottom/left/right views, vertical order traversal.
LCA in a binary tree, LCA in a BST, k-th ancestor with binary lifting.
Binary Search Trees
BST invariant, search/insert/delete, and the inorder traversal trick that makes a lot of BST problems easy.
Search, insert, delete, ceiling, floor, k-th smallest, validate BST.
Recover a BST, merge two BSTs, pair sum in a BST, BST iterator with O(h) memory.
Graphs
Traversals, shortest paths, MST, topological sort. The most varied chapter in DSA.
Adjacency list vs matrix, directed vs undirected, edge list, when to use each.
Traversal templates, connected components, cycle detection, bipartite check.
Kahn's algorithm and DFS-based, course schedule, alien dictionary.
Dijkstra, Bellman-Ford, Floyd-Warshall, 0/1 BFS, shortest path in DAG.
Prim's and Kruskal's. Why MSTs matter and how to spot them in problem statements.
Union by rank, path compression, the data structure that makes Kruskal's fast and unlocks Number of Islands II.
Strongly connected components, bridges in a graph, articulation points. Disc/low time intuition.
Dynamic Programming
DP by pattern. Once you can spot which standard pattern a problem maps to, DP stops feeling magical.
Fibonacci, climbing stairs, frog jump, max sum of non-adjacent, house robber.
Unique paths, min path sum, triangle, chocolate pickup.
Subset sum, partition, target sum, count subsets, the take-or-skip pattern with memoization.
0/1 knapsack, unbounded knapsack, coin change I and II, rod cutting.
O(n^2) DP, O(n log n) binary search variant, printing the LIS, longest divisible subset.
Longest common subsequence, edit distance, shortest common supersequence, wildcard matching.
All six stock problems with one unified state machine.
Matrix chain multiplication, palindrome partitioning, burst balloons, boolean evaluation.
Tree diameter via DP, max path sum, house robber on a tree, rerooting technique.
Tries
Prefix tree data structure. Used for autocomplete, longest common prefix, max XOR pair, word search II.
Insert, search, starts-with. Build the data structure from scratch.
Max XOR of two numbers, count distinct substrings, word search II.
Strings — Advanced
Failure function, suffix arrays, hashing. The string algorithms that show up in hard interviews and competitive programming.
Knuth-Morris-Pratt failure function. Substring matching in O(n + m).
Z-function. Pattern matching, string period detection.
Rabin-Karp, polynomial hashing, double hashing to defeat anti-hash tests.
Longest palindromic substring in O(n).
Math Foundations
The number theory you actually need: GCD, LCM, primes, modular arithmetic, combinatorics. Topics Striver underweights but interviews ask for.
GCD by Euclid's algorithm, LCM, sieve of Eratosthenes, prime factorization.
Modular addition, multiplication, inverse via Fermat's little theorem, fast exponentiation.
nCr mod p, Pascal's triangle, stars and bars, basic counting.
Segment Trees and Fenwick Trees
Range query data structures. Striver barely touches these; for competitive programming and FAANG-tier interviews they're table stakes.
Build, point update, range query. Sum, min, max segment trees.
Range updates with lazy propagation. The pattern that turns O(n*q) into O((n+q) log n).
Binary indexed tree, prefix sums in O(log n), counting inversions in O(n log n).
Data Structure Design
LRU cache, LFU cache, time-based key-value, snapshot array. The 'design X' problems that combine multiple DSAs.
Hash map + doubly linked list. The most-asked design problem in interviews.
Frequency tracking with O(1) operations. Hash map + nested doubly linked list.
Time-based key-value store, snapshot array, randomized set, design Twitter.