~/problems

Problems

Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.

586 problems · advanced & competitive are listed separately

Interview roadmap

Arrays & hashing Counting, lookups, sorting with keys, prefix sums.

Complexity analysis guide

Hash maps and counting guide

18 more Hash maps and counting problems →

Sorting, custom keys, coordinate compression guide

3 more Sorting, custom keys, coordinate compression problems →

Prefix sums and difference arrays guide

5 more Prefix sums and difference arrays problems →

Two pointers Scan from both ends, or fast and slow.

Stacks Matching brackets, paths, next greater element.

Stacks guide

5 more Stacks problems →

Monotonic stack guide

5 more Monotonic stack problems →

Stack: path parsing guide

5 more Stack: path parsing problems →

Math & matrices Digit arithmetic, rotating and marking grids in place.

6 more Math and matrices problems →

Sliding window Grow and shrink a window over a string or array.

Linked lists Reverse, merge, detect cycles, build an LRU cache.

LRU / LFU cache guide

3 more LRU / LFU cache problems →

Trees Traversals, BSTs, and answers built bottom-up.

Tree DP guide

7 more Tree DP problems →

Tries Prefix trees for words and autocomplete.

Heaps Top-k, merging streams, scheduling by time.

Heap scheduling (deadlines, leases) guide

5 more Heap scheduling (deadlines, leases) problems →

Backtracking Recursion that tries, undoes and tries again.

Intervals Merge, insert and sweep over ranges.

11 more Intervals / sweep line problems →

Greedy Sort, then take the locally best choice.

1-D dynamic programming One index of state: stairs, robbers, subsequences.

Intro DP guide

14 more Intro DP problems →

Longest increasing subsequence guide

3 more Longest increasing subsequence problems →

Weighted graphs Dijkstra, union-find, spanning trees.

Dijkstra (weighted shortest paths) guide

5 more Dijkstra (weighted shortest paths) problems →

Minimum spanning tree guide

1 more Minimum spanning tree problem →

2-D dynamic programming Grids, two strings, knapsacks, ranges.

String DP (edit distance, LCS) guide

6 more String DP (edit distance, LCS) problems →

Knapsack and coin change guide

8 more Knapsack and coin change problems →

Interval (range) DP guide

3 more Interval (range) DP problems →

Practical systems

Stateful stores Key-value stores, file systems, banks, with history.

Time-travel key-value store

1 more Time-travel key-value store problem →

In-memory file system

1 more In-memory file system problem →

Bank system

Streams & durability Rate counters, serialization, retrying work queues.

Rolling windows and rate counters

4 more Rolling windows and rate counters problems →

Fault-tolerant work queue

1 more Fault-tolerant work queue problem →

Concurrency

Quant & trading

Trading systems Order books, matching engines, market simulations.

Market and strategy simulations

esc