Skip to content
SD-25 · SURGE PRICING · INTERACTIVE

Break it.
Then fix it.

Turn up the drivers and riders, watch what breaks, and add the parts a real surge pipeline needs. Every switch is a decision you would defend in an interview.

CHALLENGEHandle 400K events/s with multipliers under 60 s old, quote p99 under 50 ms, no errors, and prices that are steady and locked.
StatusDOWNAt 100K events/s
Surge age300 sTarget under 60 s
Quote p99132 ms81.8% of events dropped
Monthly cost$2,070One database
Drivers + ridersLIVE
90K pings · 10K quotes/s
traffic source
Ingest gateways × 6OK
Point → cell
100K / 150K events/s
Batch job5 MIN OLD
Every 5 minutes
scan every 5 min
DatabaseDOWN
Every ping is a write
110K ops/s
Pricing servers × 3OK
Reads the store
10K / 15K quotes/s
Surge is up to 5 minutes old, and every ping is a database write. Demand after a concert jumps in 2 minutes. Write events to a log and let a stream processor count each cell in a 2-minute window that slides every 30 seconds.
32 MBThe whole multiplier table2 million cells × 16 bytes, so every pricing server keeps it in memory.
40 sTypical surge ageA 2-minute window that slides every 30 s, plus a few seconds to publish.
5×Fewer eventsDrivers send cell changes and a 60-s heartbeat instead of a ping every 4 s.
2 minQuote lockThe rider pays the quoted multiplier, even if surge moves meanwhile.
Want the reasoning behind every switch?Visual walkthroughFull write-up
Was this lab useful?Your vote tells us what to improve next.