Learn the pattern, then reuse it.
Each guide connects a recognition signal, a core invariant, a deliberate practice order, and every worked problem in that family.
Arrays & Hashing
Frequency maps, prefix sums, in-place scans. You need constant-time lookup, frequency counts, deduplication, or information about a prefix.
Study this pattern →Two Pointers
Converge from both ends or chase in one pass. A sorted order, opposing ends, or two sequences lets one pointer eliminate choices for the other.
Study this pattern →Sliding Window
A moving range that grows and shrinks. The question asks about a contiguous range whose validity changes predictably as either edge moves.
Study this pattern →Stack
LIFO bookkeeping for matching and order. The most recent unresolved item must be handled first, or you need the next greater or smaller boundary.
Study this pattern →Binary Search
Halve the search space every step. Answers become permanently feasible after a boundary, or the sorted search space can discard half at once.
Study this pattern →Linked List
Pointer surgery on chained nodes. The problem is about rearranging, locating, or comparing nodes without random access.
Study this pattern →Intervals
Sort, then sweep and merge ranges. Each item occupies a range and the answer depends on overlap, coverage, or scheduling order.
Study this pattern →Matrix
2-D traversal and in-place transforms. The input is a grid whose row, column, diagonal, or neighborhood geometry matters.
Study this pattern →Dynamic Programming
Carry the best answer so far, build up. Brute force repeats the same state, and the future depends on a compact summary of earlier choices.
Study this pattern →Recursion & Backtracking
Explore choices, undo, and try the next. The solution explores a decision tree, decomposes a structure, or must undo a choice before trying another.
Study this pattern →Binary Trees
Recursive structure — visit, go left, go right. Each answer can be composed from a node and the answers of its child subtrees.
Study this pattern →Strings
Scan, compare, and build character by character. Character order, matching, parsing, or repeated substrings drive the state.
Study this pattern →Greedy
Take the locally best choice and never look back. A locally optimal choice can be proven never to reduce the quality of the remaining solution.
Study this pattern →Heaps
Priority queues — always grab the smallest or largest fast. You repeatedly need the smallest or largest active candidate while the candidate set changes.
Study this pattern →Graphs
BFS, DFS, shortest paths and spanning trees. Entities form arbitrary connections and the task asks about reachability, ordering, shortest paths, or connectivity.
Study this pattern →Trie
Prefix trees for words and bits. Many words or bit strings share prefixes and queries repeatedly walk those prefixes.
Study this pattern →Bit Manipulation
XOR tricks, masks, and shifting instead of arithmetic. Parity, subsets, powers of two, or pair cancellation can be represented directly by bits.
Study this pattern →Maths
Divisors, primes, and number theory for interviews. Number properties, divisibility, digit structure, or bounded arithmetic matter more than a data structure.
Study this pattern →