Problem library

Each problem walks the seven stages of a real interview and ends with the trade-offs an interviewer will push on. Study the reference, then run a timed practice.

How to use this

Run Practice first without reading the reference. Score yourself with the rubric, then read the reference and note what you missed. Repeat a week later.

easymid / seniorfree to read

URL Shortener (TinyURL / bit.ly)

Turn long URLs into short, unique aliases and redirect users at very high read volume. A classic warm-up that tests key generation, read-heavy caching and analytics.

read-heavycachingkey generationhashing
mediummid / seniorfree to read

Distributed Rate Limiter

Limit requests per client across a fleet of API servers with low latency and predictable behaviour under failure.

algorithmsdistributed stateredis
mediummid / senior

Notification System

Send push, SMS and email notifications from many internal services reliably, with priorities, rate limits and user preferences.

queuesidempotencyretriesthird-party APIs
mediummid / senior

Search Autocomplete (Typeahead)

Suggest the most likely completions as a user types a search query, within tens of milliseconds, from a vocabulary of hundreds of millions of past queries that changes every day.

trieread-heavyin-memoryoffline pipelines
mediummid / senior

Real-time Leaderboard (Top-K)

Rank millions of players by score as scores change thousands of times a second, and answer "top 10", "my rank" and "players around me" in milliseconds.

sorted setstop-kredissharding
mediummid / senior

Web Crawler

Fetch billions of pages politely and continuously, discover new links, avoid duplicates and traps, and store the pages for a search index to consume.

queuesdeduplicationpolitenessdistributed workers
mediumsenior / staff

Ad Click Aggregation

Count ad clicks per ad per minute from a firehose of click events, serve top-N and per-ad queries within seconds, and never bill an advertiser twice for the same click.

streamingexactly-oncewindowinganalytics
hardsenior / staff

Distributed Job Scheduler

Run millions of one-off and recurring jobs on time, exactly as often as asked, across a fleet of workers that can crash, with priorities, retries and dependencies between jobs.

leasesidempotencycronqueues
hardsenior / staff

Ticket Booking (Ticketmaster / BookMyShow)

Sell seats for events without ever selling the same seat twice, survive the moment a popular on-sale opens, and keep seat maps fast to read while they change under load.

consistencylockingspiky trafficpayments
hardsenior / staff

Payment System

Take a customer’s money exactly once, record it in a ledger that always balances, and stay correct when the card processor times out, retries, or sends a webhook a day late.

idempotencyledgerstate machinesthird-party APIs
hardsenior / staff

Collaborative Document Editing (Google Docs)

Let many people edit the same document at the same time, see each other’s cursors, and never lose a keystroke, even when one of them goes offline for an hour.

real-timeconflict resolutionoperation logswebsockets
hardsenior / staff

File Sync (Dropbox / Google Drive)

Keep a folder identical across a user’s devices and shared with others: upload changes efficiently, detect what changed, resolve conflicting edits, and notify every device within seconds.

chunkingcontent-addressed storagesync protocolconflicts
hardsenior / staff

Metrics and Logging Platform

Collect metrics and logs from thousands of services, store them cheaply for months, answer dashboard and search queries in seconds, and alert on symptoms without paging on noise.

time seriesingestionsearchalerting