Challenges

Grow one design through linked stages. Each stage adds traffic or limits. A final hidden test ends the run.

41 of 41 challenges

  • Exactly-once streams

    Ad click aggregator

    Ingest 1M clicks/s, count them per minute on hot ads, wait for late events, write each settlement exactly once, and serve the totals to advertisers.

    1. Ingest 1M clicks/s
    2. Hot ad counters
    3. Wait for late events
    4. Exactly-once writes
    5. Advertiser dashboards
    6. Final test
    Difficulty
  • Real-time ML

    Card fraud detection

    Score every card payment before it reaches the card network. Start with rules, move to a model, give it features as of the payment time, set its threshold with money, and retrain it when attackers change.

    1. Rules at 5,000 payments/s
    2. A better model in 50 ms
    3. Features as of the payment
    4. One threshold per stream
    5. Retrain when attacks change
    6. Final test
    Difficulty
  • Cost, latency and capacity of LLM serving

    Chat assistant

    A chat assistant answers users with a language model. Start with a hosted model and its token bill, stream the answer, self-host on GPUs, add long documents, then survive a viral spike with a router and a fallback.

    1. Pick a tier and cache the prefix
    2. Stream the first token
    3. Own GPUs for quality and cost
    4. Long documents and KV memory
    5. Router, fallback and a viral spike
    6. Final test
    Difficulty
  • Sandboxed execution

    Code judge

    Judge contest submissions. Queue the test runs, run untrusted code in a sandbox, survive the final rush, and share the judges between contest and practice.

    1. Queue the test runs
    2. Run code in a sandbox
    3. The contest rush
    4. Share the judges fairly
    5. Final test
    Difficulty
  • Agent reliability

    Coding agent

    An agent that fixes issues in a code repository: it calls a model and tools in a loop. Make it run its steps, run generated code in a sandbox, survive a crash, stop tasks that never end, and wait for a person before it merges.

    1. A step runner for the agent loop
    2. Run generated code in a sandbox
    3. Resume after a crash
    4. Cap the tries
    5. Approve before merge
    6. Final test
    Difficulty
  • Custody and withdrawals

    Crypto exchange

    An exchange credits deposits after enough confirmations, keeps most funds in cold wallets, signs withdrawals with approvals and survives a bank run. Tune each chain, wallet and approval.

    1. Confirmations per chain
    2. Hot and cold wallets
    3. Approvals on the hot wallet
    4. A bank run
    5. Final test
    Difficulty
  • Fan-out and message storage

    Discord: giant servers

    Serve a server of 1M members. Load member lists by window, fan out late, store messages by channel and time, and cool a hot channel in a live event.

    1. Load a window, not the list
    2. Fan out late
    3. Store messages by channel and time
    4. A hot channel in a live event
    5. Final test
    Difficulty
  • Real-time media over UDP

    Discord: voice

    Run voice rooms over UDP. Replace a mesh with an SFU, keep the playout queue short, put a server in each region, and relay only the users behind strict firewalls.

    1. Voice through an SFU
    2. The playout queue
    3. A voice server per region
    4. Relay only the stuck users
    5. Final test
    Difficulty
  • ML serving with fresh features

    DoorDash: ETA

    Serve delivery time predictions for a food delivery app. Run the model fast and cheap, keep its features fresh, retrain it when the weather changes, and test a new model on live traffic.

    1. Serve in 50 ms
    2. Fresh features
    3. Retrain on rain
    4. Shadow a new model
    5. Final test
    Difficulty
  • Chunking, dedup and conflicts

    Dropbox: sync

    Sync files between devices. Send data straight to storage, cut files into blocks, tell devices about changes by push, keep both sides of a conflict, and keep the egress bill in check.

    1. Whole-file uploads
    2. Blocks and dedup
    3. Change notifications
    4. Conflicting edits
    5. Egress bill
    6. Final test
    Difficulty
  • Keys across devices

    Encrypted chat

    An encrypted chat app: serve prekeys for offline phones, link a new device with its history, rekey groups in batches, and back up chats so that no server key can read them.

    1. Prekeys for offline phones
    2. A new device and its history
    3. Rekey in batches
    4. Backups nobody can read
    5. Final test
    Difficulty
  • Real-time state sync

    Multiplayer game

    Run a 64-player game. Send ticks over UDP, shrink snapshots, queue the joins of a match, and put a server in each region.

    1. Send ticks over UDP
    2. Snapshots on a diet
    3. A waiting room for matches
    4. A server in each region
    5. Final test
    Difficulty
  • Real-time collaboration

    Google Docs: collaboration

    Autosave 45,000 edits/s on sharded stores, merge edits from two data centers, throttle cursors under a bandwidth cap, absorb an offline reconnect wave, and serve one viral document.

    1. Autosave at scale
    2. Merge live edits
    3. Presence under a cap
    4. Offline reconnect wave
    5. One viral document
    6. Final test
    Difficulty
  • Image storage pipeline

    Instagram: photos

    Store, resize and serve photos at the scale of 10B. Keep photo bytes off the API, resize in the background, serve from the edge and read cold originals without duplicates.

    1. Upload path
    2. Resize in the background
    3. Serve from the edge
    4. Cold originals
    5. Final test
    Difficulty
  • Time-series ingestion

    Metrics platform

    Take in 500,000 samples/s, keep 90 days within the disk, downsample in the background, isolate a noisy team and answer alert queries fast.

    1. Ingest 500,000 samples/s
    2. Keep 90 days in the disk
    3. Downsampling needs CPU
    4. Limit a noisy team
    5. Alert queries
    6. Final test
    Difficulty
  • Retrieval and ranking

    Music recommendations

    Recommend tracks on a home screen for millions of listeners. Start with a popular list, then retrieve candidates with a two-tower model, rank them, keep listening features fresh, and give new tracks a chance to be heard.

    1. Serve the popular list
    2. Two-tower retrieval
    3. Rank the candidates
    4. Fresh listens
    5. Give new tracks a chance
    6. Final test
    Difficulty
  • CDN placement and pre-positioning

    Netflix: edge

    Stream 10,000 viewers from the edge. Cache segments, put an edge in each region, fill the edge stores inside a night window and steer viewers around a lost edge.

    1. Cache segments at the edge
    2. An edge in each region
    3. Fill the edges at night
    4. Steer viewers around a lost edge
    5. Final test
    Difficulty
  • Multi-channel delivery

    Notification service

    Send push, email and SMS through providers with hard limits. Absorb bursts, honor preferences, retry without double sends, and keep urgent traffic ahead of campaigns.

    1. Providers have limits
    2. Check preferences first
    3. Retries and duplicates
    4. Share the provider
    5. Final test
    Difficulty
  • Retrieval quality and latency

    RAG support bot

    Answer support questions from 10,000 help articles with a language model. Make retrieval find the right text, keep cached answers fresh when articles change, test releases without hurting users, and fit it all on two GPUs.

    1. Retrieve before you answer
    2. Hybrid search and a reranker
    3. Fresh answers when docs change
    4. Run evals off the live path
    5. Only two GPUs
    6. Final test
    Difficulty
  • Distributed counting

    Rate limiter service

    Protect a shared API from one noisy key. Start with one token bucket, then run several limiters without losing the count, split the limit between two regions, and keep the limits up when a limiter fails.

    1. One token bucket
    2. One count for many limiters
    3. A limit per region
    4. When a limiter fails
    5. Final test
    Difficulty
  • Crawling and inverted indexes

    Web search: crawl and index

    Crawl the web politely, skip URLs you know, build an inverted index in a batch window, and answer 36,000 queries/s from a sharded index that survives the loss of a box.

    1. One pace per site group
    2. Bloom filter for seen URLs
    3. Build the index in parallel
    4. Shard the index, keep two copies
    5. Final test
    Difficulty
  • A game backend under tight limits

    Ship Cogore

    Run a small game backend with tight game limits. This is an exercise, not the real Cogore layout. Serve the site, verify runs, sync boards, survive the daily drop and keep a backup.

    1. Site at the edge
    2. Verify the runs
    3. Sync and snapshots
    4. The daily drop
    5. Backups and RPO
    6. Final test
    Difficulty
  • Inventory reservations

    Online shop: flash sale

    Sell a limited product in a flash sale. Keep stock in a database, split the hot product row, make every reservation survive a node loss and charge each order once.

    1. Stock in the database
    2. One hot product
    3. Durable reservations
    4. Idempotent orders
    5. Final test
    Difficulty
  • Bandwidth and CDN

    Spotify: playback

    Stream audio to 50,000 listeners on a budget. Share the catalog load, cache in two tiers, fit 4G phones, keep downloads off the stream path and survive an album drop.

    1. Share browse load over two boxes
    2. Two cache tiers for the library
    3. Phones on 4G
    4. Downloads get their own path
    5. Album drop
    6. Final test
    Difficulty
  • Yearly batch analytics

    Spotify: Wrapped

    Build a yearly summary pipeline. Log billions of listens, roll up a year of data before a deadline, serve 500 million summaries, and render share cards before launch.

    1. Log the listens
    2. Roll up the year
    3. Serve 500M summaries
    4. Render before launch
    5. Final test
    Difficulty
  • Finality in payments

    Stablecoin processor

    Take stablecoin deposits from two chains: index blocks within a provider quota, credit only after finality, send payouts in nonce order, and ride out a provider outage.

    1. Follow the chain
    2. Credit when final
    3. Payout order
    4. Two chains
    5. Final test
    Difficulty
  • Deterministic low latency

    Stock exchange

    Build an exchange in four steps: an order gateway on one host, a journal that survives engine restarts, market data for 8 subscribers, and a trade store with a standby.

    1. Order gateway
    2. Order journal
    3. Market data
    4. Trade store
    5. Final test
    Difficulty
  • Idempotency and ledgers

    Stripe: payments

    Charge cards once with idempotency keys, post double entries on a hot account, deliver signed webhooks, reconcile a bank file, and ride out a card network outage.

    1. Idempotency keys
    2. Double-entry ledger
    3. Webhooks to merchants
    4. Reconciliation
    5. Card network outage
    6. Final test
    Difficulty
  • Contention and waiting rooms

    Ticketmaster: the drop

    Sell 60,000 seats to 2M fans at 10:00:00. Serve the seat map, never sell a seat twice, hold the crowd in a waiting room and keep the bots out.

    1. Seat map reads
    2. No double sales
    3. Waiting room
    4. Bot defense
    5. Final test
    Difficulty
  • Microseconds over distance

    Trading link: Chicago to New Jersey

    A trading firm sends orders to the futures exchange near Chicago and to the stock exchanges in New Jersey, 1,190 km away. Each stage takes microseconds or milliseconds off the order path, and the last one keeps the orders flowing in a storm.

    1. Colocate the order gateway
    2. Fiber to New Jersey
    3. Microwave towers
    4. Rain fade and fast failover
    5. Final test
    Difficulty
  • GPU fabric and failures

    GPU training cluster

    Train a 30B model on 5 servers of 8 H100. Each stage asks more of the cluster: fit the model, spread it over the rails, save it without stalls and keep a long run alive.

    1. Fit the model in one server
    2. Data parallel on the rails
    3. Checkpoints without stalls
    4. A straggler and a failed server
    5. Final test
    Difficulty
  • Live video latency

    Twitch: live

    Carry live streams to millions of viewers. Give the ladder to top streams, purge playlists, pay for low latency and keep chat in order.

    1. Give the ladder to top streams
    2. Purge the playlist
    3. Pay for low latency
    4. Keep chat in order
    5. Final test
    Difficulty
  • Per-keystroke latency

    Search box: typeahead

    Show 10 suggestions on every keystroke. Index the lookups, answer repeats from memory, cache near the users and keep trending lists fresh within a minute.

    1. Prefix index
    2. Answers from memory
    3. Edge cache
    4. Trending every minute
    5. Final test
    Difficulty
  • Geospatial updates and matching

    Uber: dispatch

    Run the live core of a ride service. Take a million location pings, find the nearest drivers, give each ride one driver even when the network splits, and survive a stadium crowd.

    1. A million pings
    2. Nearby search
    3. One driver per ride
    4. Hot cell
    5. Final test
    Difficulty
  • Ids and read-heavy redirects

    URL shortener

    Build a short-link service on three small boxes. Create links, hand out ids that never collide, answer 20,000 redirects/s from a cache, and count every click without slowing the redirects.

    1. Create and redirect
    2. Ids without collisions
    3. A cache for 100 reads per write
    4. Count clicks later
    5. Final test
    Difficulty
  • WebRTC scaling

    Video meetings

    Scale video calls. Send video straight between two people, add an SFU for ten, give phones a low-quality copy, and run one media server per region.

    1. Call them directly
    2. An SFU for ten
    3. Two qualities for phones
    4. A media server per region
    5. Final test
    Difficulty
  • Latency of a streaming voice pipeline

    Voice agent

    A phone agent listens, thinks and speaks. Build the chain of speech to text, model and text to speech, stream every stage, stop talking when the caller cuts in, and place a pipeline in each region.

    1. The serial turn
    2. Stream every stage
    3. Stop when the caller cuts in
    4. A pipeline in each region
    5. Final test
    Difficulty
  • Delivery guarantees

    WhatsApp: delivery

    Deliver chat messages between phones. Hold 2M open sockets, keep messages for offline recipients, stop repeats, send to groups of 1,000, and give each of 4 devices its own copy.

    1. Sockets in memory
    2. Store and forward
    3. Receipts and repeats
    4. Groups of 1,000
    5. One copy per device
    6. Final test
    Difficulty
  • Safe job delivery

    Work queue

    Build a queue for workers that run at the same time. Recover failed work and retain jobs that cannot finish. Keep the full design within 48 USD/mo.

    1. One owner
    2. Finish once
    3. Retry failed work
    4. Recover expired work
    5. Reject old receipts
    6. Retain failed jobs
    7. Final test
    Difficulty
  • Fan-out on write or on read

    X: home timeline

    Build the home timeline of a social network. Gather it on read, then build it on write, then handle accounts with huge follower counts, and last fit the timelines in a memory budget.

    1. Gather on read
    2. Fan out on write
    3. Big accounts
    4. Timeline memory
    5. Final test
    Difficulty
  • Media pipelines

    YouTube: upload

    Build the pipeline behind a video site. Send uploads straight to storage, dead-letter corrupt files, fan out the steps, restore cold videos and absorb a new viral video.

    1. Upload chunks straight to storage
    2. Dead-letter corrupt uploads
    3. Fan out the steps
    4. Restore cold videos on demand
    5. A new video goes viral
    6. Final test
    Difficulty