Code RoomExactly-once windowed aggregates
HardPrep Room Coding #3406

Exactly-once windowed aggregates

System designDistributed systemsSenior–Staff~55 min

Design a stateful stream-processing job that computes real-time per-merchant fraud-risk aggregates (e.g., count + sum of transactions per merchant over sliding 5-minute and 1-hour windows) off a 1M-events/sec transaction stream, emitting an alert when a window crosses a threshold. The aggregates must be correct under failures — a job restart must not double-count nor lose events — and must handle late and out-of-order events (a transaction event arriving 20 s after its actual time). How do you compute exactly-once windowed aggregates that survive crashes and late data?

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.

Clarify6:00 left
Estimate6:00 planned
Design18:30 planned
Deep dive14:30 planned
Failure10:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.