The full set
All 41 puzzles
home

Agents · 11

System Design · 14

The Balancer
Play

Minimising the busiest server's load is multiprocessor scheduling — place the heaviest requests first, not round-robin.

The Pipeline
Play

Batching trades latency for throughput-per-server — meet the SLA with the fewest consumers, not the smallest batch.

Consistent Hashing
Play

Placing a node on the ring relieves the hotspot — and only the slice of keys in its arc re-homes, not the whole keyspace.

The Shard
Play

Range-shard by load, not by key count — equal-sized ranges hotspot when the data is skewed.

Capacity Planning
Play

Rightsize to the demand curve — provisioning for peak wastes money, but scaling every interval pays churn.

The Rate Limiter
Play

Bursts need bucket capacity, not just refill rate — pouring the whole budget into rate still drops spikes.

Backpressure
Play

Past the concurrency knee, adding workers reduces throughput — contention collapses the system.

The Connection Pool
Play

Pool size is a U-curve — too small queues requests, too large wastes idle connections.

The Index
Play

Build only the indexes that pay for their storage on the query mix — indexing everything is a tax on every write.

The CDN
Play

Cache placement is facility location — cover the users by weighted distance, don't pile caches on the busiest city.

The Mesh
Play

Cover every region with the fewest edge PoPs — minimum set cover. Greedy 'most-coverage-first' is a strong heuristic but not always optimal.

Fewest VMs
Play

Packing services onto the fewest capacity-bounded VMs is bin packing — first-fit-decreasing can waste a VM; the true minimum needs a search.

The Queue
Play

On one server, run the shortest job first — a job's wait is the sum of every service time ahead of it, so a long job up front taxes the whole queue.

The Relay
Play

Connect every node at the lowest total link cost — that's a minimum spanning tree. Kruskal: add the cheapest edge that joins two separate components, skipping any that would form a cycle.

Algorithms · 16

The Cache
Play

LRU is a guess; Belady (evict the item used farthest in the future) is the provable optimum.

The Route
Play

The shortest path minimises edge cost, not hop count — fewest stops is a trap.

Exact Change
Play

Greedy 'largest coin first' isn't optimal for arbitrary denominations — minimum-coin change is a DP.

Interval Schedule
Play

Earliest-finish greedy maximises the number of jobs, not their value — weighted scheduling is a DP.

Huffman
Play

Fixed-length codes waste bits — frequent symbols deserve short codes; Huffman's greedy is the optimal prefix code.

The Heist
Play

Maximize a sum with no two adjacent picks — the House Robber DP. 'Grab the biggest' and 'take every other' both lose.

Deadlines
Play

Schedule unit jobs before their deadlines to maximize profit — highest-profit-first, latest free slot. Earliest-deadline-first chases count, not profit.

The Trade
Play

Buy once, sell later, maximize profit — track the min-so-far. 'Buy the lowest, sell the highest' fails when the high comes before the low.

Max Meetings
Play

Fit the most non-overlapping meetings into one room — sort by end time, take the next that starts on/after the last end. Picking by earliest start blocks more than it fits.

Cut the Cable
Play

Slice a cable into priced piece-lengths summing to exactly its length for the most money — that's an unbounded-knapsack DP, not best-price-per-unit greed.

The Streak
Play

Pick the contiguous run of days with the largest total — Kadane's pass extends while it helps and resets when the running sum turns into a drag. Summing only the positive days fails.

Refuel
Play

Cross the distance in the fewest fill-ups: don't stop at the first low-tank station — bank the biggest refills you've already passed. That's the heap greedy.

The Ladder
Play

Find the longest run of strictly increasing values that keeps the original order. Greedily taking every bigger number can trap you in a short chain — the LIS sometimes skips an early value to climb higher later.

The Gauntlet
Play

Two walls hold water = width × the shorter wall. Sweep from the widest pair and always move the shorter wall inward — grabbing the two tallest bars ignores width.

The Slack
Play

Run jobs in Earliest-Due-Date order to minimize the worst lateness on one server — shortest-job-first feels busy but lets a tight deadline blow up.

The Watch
Play

Cover every alert window with the fewest watch times — sort windows by end, plant a point at the end of the first uncovered window. Stabbing by earliest start uses more points.