~/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.

Algos 150

Algos 75 plus the next tier of classics, company-style assessments, and the practical, concurrency and quant staples.

0 of 150 solved

150 problems

Interview roadmap

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

Hash maps and counting guide

Prefix sums and difference arrays guide

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

Stacks Matching brackets, paths, next greater element.

Stacks guide

Monotonic stack guide

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

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

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

Linked lists guide

LRU / LFU cache guide

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

Binary trees guide

Tree DP guide

Tries Prefix trees for words and autocomplete.

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

Heaps and priority queues guide

Heap scheduling (deadlines, leases) guide

Backtracking Recursion that tries, undoes and tries again.

Intervals Merge, insert and sweep over ranges.

Greedy Sort, then take the locally best choice.

Graphs Grids and networks: BFS, DFS, cycles, ordering.

BFS / multi-source BFS guide

DFS and connected components guide

Topological sort (Kahn's) guide

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

Intro DP guide

Longest increasing subsequence guide

Weighted graphs Dijkstra, union-find, spanning trees.

Dijkstra (weighted shortest paths) guide

Union-Find guide

Minimum spanning tree guide

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

Grid DP guide

String DP (edit distance, LCS) guide

Knapsack and coin change guide

Bit manipulation Masks, shifts and IP-address arithmetic.

Practical systems

Simulation & OOP design Model the rules precisely, keep it extensible.

Simulation

Object-oriented design and extensible simulations

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

Time-travel key-value store

In-memory file system

In-memory database

Bank system

Iterators & parsers Lazy sequences, tokenizers and tiny interpreters.

Parsers and interpreters

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

Rolling windows and rate counters

Fault-tolerant work queue

Concurrency

Locks Mutexes, lock ordering, readers and writers.

Lock (mutex)

Deadlock and lock ordering

Coordination Semaphores, conditions and barriers.

Semaphore

Pools & pipelines Thread pools, crawlers, producer/consumer buffers.

Thread pool / concurrent crawler

Quant & trading

Probability Expected value, sampling, randomized algorithms.

Probability and expected value

Trading systems Order books, matching engines, market simulations.

Order books and matching engines

esc