Code RoomRequest coalescing and batching
MediumPrep Room Coding #3448

Request coalescing and batching

System designDistributed systemsMid–Senior~35 min

Design a request-coalescing / batching layer in front of a backend that's far more efficient at batch lookups than single lookups (e.g. a database or a service where one call fetching 100 keys is ~the same cost as one call fetching 1 key, but per-call overhead is high). Requests arrive individually and concurrently for single keys. Design how you coalesce concurrent in-flight requests for the same key and batch distinct keys into grouped backend calls, while bounding the added latency each caller pays and handling partial failures within a batch.

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:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.