Master the patterns that appear in every coding interview. Each track teaches you when to use the pattern, common traps, and walks you through problems from easy to hard.
Use hash maps, sets, and array manipulation to solve problems involving lookups, frequency counting, and element relationships.
Use two pointers moving through the data to find pairs, partitions, or solve problems on sorted arrays in O(n) time.
Maintain a dynamic window over a contiguous subarray or substring to find optimal ranges in O(n) time.
Use LIFO ordering to match pairs, track state, or maintain monotonic sequences for next-greater/smaller element problems.
Halve the search space each step to find targets or boundaries in O(log n) time on sorted or monotonic data.
Manipulate node-based data structures using pointer techniques like fast/slow, dummy heads, and in-place reversal.
Traverse and manipulate hierarchical structures using DFS (pre/in/post-order) and BFS (level-order) traversals.
Model relationships as nodes and edges, then traverse with BFS (shortest path) or DFS (all paths, connectivity).
Maintain quick access to the min or max element for top-k, merge, and scheduling problems.
Sort and merge overlapping or adjacent intervals to solve scheduling, coverage, and overlap problems.
Make locally optimal choices at each step, proving they lead to a globally optimal solution.
Break problems into overlapping subproblems, cache results, and build up to the final answer.
Explore all candidates by building solutions incrementally and abandoning paths that can't lead to valid answers.
Build prefix trees for efficient string operations like autocomplete, prefix matching, and word search.
Track connected components efficiently with union and find operations, using path compression and rank optimization.