Every data-structures & algorithms interview pattern in learning order — concepts, when to use each, tips, and practice problems.
The foundation. Master hash maps and sets to trade space for time and turn O(n²) brute force into O(n). (9 problems · Foundations)
Two indices moving through a sorted structure to avoid nested loops. (5 problems · Foundations)
LIFO order for matching, backtracking through history, and monotonic tricks. (7 problems · Foundations)
Halve the search space every step — not just on sorted arrays, but on answer spaces too. (7 problems · Foundations)
A window that grows and shrinks over a sequence to track a running condition in linear time. (6 problems · Foundations)
Pointer manipulation, fast/slow runners, and in-place reversal. (11 problems · Core Structures)
Recursion's best friend. DFS, BFS, and traversal order define most tree problems. (15 problems · Core Structures)
A tree built for prefixes — powers autocomplete and word search problems. (3 problems · Core Structures)
Always grab the min or max in O(log n) — essential for top-k and scheduling problems. (7 problems · Core Structures)
Explore, and undo — build every valid combination by pruning as you go. (9 problems · Search & Graphs)
Model relationships as nodes and edges; traverse with DFS/BFS and union-find. (13 problems · Search & Graphs)
Shortest paths and minimum spanning trees with Dijkstra and friends. (6 problems · Search & Graphs)
Break a problem into overlapping subproblems along a single dimension. (12 problems · Dynamic Programming)
Extend DP across two dimensions — grids, strings, and sequences compared pairwise. (11 problems · Dynamic Programming)
Make the locally optimal choice at each step and prove it leads to a global optimum. (8 problems · Final Stretch)
Sort by start or end time, then sweep — the key to overlap and scheduling problems. (6 problems · Final Stretch)
Number theory, simulation, and coordinate geometry that show up in unexpected places. (8 problems · Final Stretch)
XOR tricks, bit masks, and shifting — small operations with outsized interview value. (7 problems · Final Stretch)