The Skills
93 reviewed skills: the patterns, data structures and algorithms that carry interview problems. Each opens in the reading room with how to recognise it, the invariant to say aloud and the problems where it matters.
The skills shelf
93 skills
Family
- 2D Prefix SumUse cumulative matrix regions and inclusion-exclusion to answer rectangular range queries.
- Binary Search on AnswerBinary-search a monotone feasibility predicate when the answer lies in an ordered numeric space.
- Choose / Explore / UnchooseBuild candidates recursively, prune invalid states, and undo each choice during backtracking.
- Constraint SatisfactionSearch assignments incrementally while pruning partial states that violate constraints.
- Cyclic SortPlace values into index-derived positions to find missing, duplicate, or misplaced elements in place.
- Difference ArrayEncode range updates at boundaries and reconstruct final values with a prefix accumulation.
- Fast and Slow PointersAdvance pointers at different speeds to detect cycles, middles, or repeated state.
- Fixed-size WindowSlide a window of constant length while adding the entering value and removing the leaving value.
- In-place Index MappingReuse array positions as state when values have a bounded relationship to valid indices.
- Interval DPSolve progressively larger contiguous intervals by combining solutions around split points.
- Island TraversalTreat a grid as an implicit graph and traverse connected components using directional neighbors.
- K-way MergeUse a heap of current heads to merge or traverse multiple sorted sequences efficiently.
- MemoizationCache top-down subproblem results so overlapping recursive states are solved only once.
- Merge IntervalsSort intervals and combine overlapping ranges while tracking the current merged endpoint.
- Monotonic QueueMaintain a deque ordered by value to query window extrema while elements enter and leave.
- Monotonic StackMaintain ordered unresolved candidates for next-greater, next-smaller, and span problems.
- Multi-source BFSSeed a BFS with every starting state to model simultaneous shortest-time propagation.
- Opposite-direction PointersMove pointers inward from both ends when ordering lets each comparison discard candidates.
- Prefix SumPrecompute cumulative aggregates so range queries become constant-time differences.
- Same-direction PointersAdvance read and write pointers in one direction for compaction, partitioning, or deduplication.
- Sliding WindowMaintain an incrementally updated contiguous range instead of recomputing every subarray.
- State-machine DPRepresent each step with a small set of allowed states and transitions between them.
- Sweep LineSort boundary events and process them in order to track active intervals or geometric state.
- TabulationOrder bottom-up subproblems so every dependency is available before a state is computed.
- Top KKeep only the best k candidates with a heap, quickselect, counting, or bucket strategy.
- Tree DPAggregate dynamic-programming states from child subtrees into a result for each parent node.
- Two PointersCoordinate two indices to eliminate candidate pairs or partition an ordered search space.
- Variable-size WindowExpand and contract a window to preserve a validity invariant and optimize its length or score.
- Adjacency ListGraph representation storing each vertex's neighbors with space proportional to vertices and edges.
- Adjacency MatrixDense graph representation using a vertex-by-vertex matrix for constant-time edge lookup.
- ArrayContiguous indexed sequence used for random access, scanning, and in-place transformations.
- Balanced TreeSearch tree that controls height so ordered operations remain logarithmic in the worst case.
- Binary Search TreeBinary tree maintaining an ordering invariant for search, insertion, and range traversal.
- Binary TreeTree whose nodes have at most two children, enabling standard recursive traversal patterns.
- DequeDouble-ended queue supporting constant-time insertion and removal at both ends.
- Disjoint Set UnionPartition structure supporting near-constant-time connectivity queries through find and union.
- Fenwick TreeCompact indexed tree supporting logarithmic prefix aggregates and point updates.
- GraphVertices and edges representing arbitrary relationships, reachability, paths, and dependencies.
- Hash MapKey-value structure providing average constant-time lookup, update, and frequency aggregation.
- Hash SetUnique-key structure for average constant-time membership and duplicate detection.
- HeapPartially ordered tree-backed structure supporting efficient minimum or maximum extraction.
- IntervalStart-end pair representing a range for overlap, scheduling, and sweep-line problems.
- Linked ListNode sequence connected by references, favoring local insertion over random access.
- Matrix / GridTwo-dimensional indexed data commonly treated as rows, columns, or an implicit graph.
- Priority QueueAbstract queue that removes the highest-priority item, commonly implemented with a heap.
- QueueFirst-in-first-out structure for breadth-first traversal, scheduling, and ordered processing.
- Segment TreeRange-query tree supporting logarithmic aggregation and point or lazy range updates.
- StackLast-in-first-out structure for nested state, expression evaluation, and iterative traversal.
- StringImmutable character sequence used in parsing, matching, sliding-window, and dynamic-programming tasks.
- TreeHierarchical acyclic structure used for recursive aggregation, search, and ordered relationships.
- TriePrefix tree for incremental string lookup, autocomplete, and dictionary-constrained search.
- A* SearchPrioritize path states by cost-so-far plus an admissible heuristic toward the goal.
- BacktrackingEnumerate constrained candidates by choosing, exploring, pruning, and undoing decisions.
- Bellman-FordRelax every edge repeatedly to support negative weights and detect reachable negative cycles.
- Binary SearchRepeatedly halve an ordered or monotone search space using a boundary invariant.
- Bipartite CheckTwo-color graph components with BFS or DFS and reject edges joining equal colors.
- Bit ManipulationUse bitwise operations and binary representations for masks, parity, subsets, and compact state.
- Breadth-first SearchExplore states level by level, yielding shortest unweighted path lengths from the source set.
- Bucket SortDistribute values into ordered buckets, sort locally, and concatenate under distribution assumptions.
- Counting SortCount bounded integer keys and reconstruct order in time proportional to input plus key range.
- Cycle DetectionDetect repeated reachability state using DFS colors, indegrees, union-find, or fast-slow pointers.
- Depth-first SearchExplore a branch completely before backtracking, using recursion or an explicit stack.
- DijkstraFind shortest paths with nonnegative weights by greedily finalizing the nearest unsettled vertex.
- Divide and ConquerSplit a problem into independent subproblems, solve them recursively, and combine results.
- Dynamic ProgrammingSolve overlapping subproblems once and combine their results under a state transition.
- Euclidean GCDRepeatedly replace a pair by divisor and remainder to compute the greatest common divisor.
- Fisher-Yates ShuffleGenerate an unbiased permutation by swapping each position with a uniformly chosen remaining one.
- Floyd-WarshallCompute all-pairs shortest paths by progressively allowing each vertex as an intermediate.
- GreedyMake locally optimal choices only when an exchange or invariant proves global correctness.
- HashingMap keys to buckets for average constant-time membership, aggregation, and lookup.
- Heap SortBuild a heap and repeatedly extract extrema for in-place O(n log n) sorting.
- Kadane's AlgorithmTrack the best subarray ending at each position to obtain a linear-time maximum subarray sum.
- Kahn's AlgorithmProduce a topological order by repeatedly removing zero-indegree vertices with a queue.
- Knuth-Morris-PrattUse a prefix-function fallback table to match strings in linear time without rescanning text.
- KruskalBuild a minimum spanning tree by taking sorted edges that join different components.
- Linear SearchInspect candidates sequentially when no exploitable ordering or index is available.
- Merge SortRecursively sort halves and merge them in stable O(n log n) time with auxiliary storage.
- Minimum Spanning TreeConnect every vertex with minimum total edge weight while keeping the result acyclic.
- Modular ArithmeticApply congruence rules to keep large integer calculations bounded and preserve equivalence.
- PrimGrow a minimum spanning tree by repeatedly choosing the cheapest edge leaving the tree.
- Quick SortPartition around pivots and recursively sort partitions with average O(n log n) time.
- QuickselectPartition like quicksort while recursing into only the side containing the requested rank.
- Rabin-KarpUse a rolling hash to compare many candidate substrings efficiently with collision checks.
- Radix SortApply stable digit-wise passes to sort bounded-width keys without direct comparisons.
- RecursionSolve a problem by reducing it to smaller instances with explicit base cases.
- Reservoir SamplingMaintain an unbiased sample from a stream whose total length is unknown in advance.
- SearchLocate a value, state, path, or feasible answer inside an explicit or implicit search space.
- Shortest PathCompute minimum path cost under edge-weight assumptions that determine the correct method.
- Sieve of EratosthenesMark multiples of discovered primes to enumerate primes up to a fixed bound efficiently.
- SortingReorder values by a comparison or key to expose structure for subsequent processing.
- String MatchingLocate pattern occurrences in text while controlling repeated comparison work.
- Topological SortOrder a directed acyclic graph so every dependency appears before its dependents.
- Union-FindMaintain dynamic components using path-compressed find and union by rank or size.
Keep the craft
