All problems

Stock Exchange

Match orders in milliseconds — a slow fill is a wrong fill.

hard~24 min Pro Simulator · +140 ptsTheory +45 pts
The build

Match orders in tens of milliseconds through a Fed-day frenzy while a matcher dies and the order log chokes.

Latency IS the product: an order that takes 100ms is an order filled at yesterday's price. Ordering is sacred — every fill flows through an append-only order log before settlement, so the log's throughput bounds the whole exchange. Market-data reads must never queue behind order flow.

Components in play

  • Order gatewayValidates and routes orders and market-data requests in microseconds.
  • Matching enginesPrice-time priority matching per symbol shard — the hot path.
  • Order logAppend-only, strictly-ordered log of every fill; settlement reads from here.
  • SettlementClears fills off the log and books positions.
  • Trade ledgerDurable record of every executed trade.
  • Market-data cacheServes ticker reads so they never queue behind order flow.
  • Ticker storeLatest quotes and depth snapshots per symbol.

Graded on these SLOs

  • ≥ 98.50%Orders execute
  • ≤ 40 msOrder-to-fill p99
  • ≥ 16k rpsSustain the tape
  • ≤ 90%Hot-path headroom
  • ≤ 13Lean floor
Base 16,000 rps46s run 4 scripted failures

The brief

Design the matching core of an exchange: orders come in, get matched by strict price-time priority, and every fill flows through an append-only order log before settlement. Latency is the product — a 100ms fill is a fill at yesterday's price — and market-data reads must never queue behind order flow, even when a Fed headline sends every algo firing at once.

Functional

  • Match orders by price-time priority per symbol
  • Append every fill to a strictly-ordered log before settlement
  • Serve market-data (ticker/quote) reads

Non-functional

  • Order-to-fill p99 stays in the tens of milliseconds
  • No fill ever loses its ordering, even under a demand spike
  • Market-data reads never queue behind order flow

Warm-up: design decisions

Optional theory to prime the calls a senior engineer would make before you build.

Pro

Solving is a Pro feature

Unlock the on-canvas AI design coach, per-run design reviews, the chaos simulator and all 12 problems for $15/month.

  • AI design coach on your canvas — pins failure points & over-engineering
  • Honest AI design review on every run
  • All 12 problems + unlimited chaos simulator
  • Points, levels & leaderboard
Get started