Code RoomRate limiter with burst smoothing
HardPrep Room Coding #3682

Rate limiter with burst smoothing

System designNetworking & APIsDistributed systemsMid–Senior~40 min

Design an API rate-limiter service fronting a public API gateway handling ~80K req/sec across a fleet of ~40 gateway instances. Limits are per-API-key and tiered (e.g. 100 req/min free, 10K req/min enterprise) plus a global per-key burst limit. Requirements: enforce limits accurately across all gateway instances (not per-instance), add <2ms to each request, fail-open if the limiter backend is down (don't take the API offline), and return correct rate-limit headers (remaining, reset). Smooth bursting is preferred over hard cliffs.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:30 left
Estimate4:30 planned
Design13:30 planned
Deep dive10:30 planned
Failure7:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.