Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Distributed Real-Time Data Processing Platform

Run versioned event-time pipelines that produce fresh materialized results and replayable corrections from high-volume streams.

Problem statement

The source asks for a distributed system for real-time data processing. For this exercise, assume a platform team lets internal tenants register a versioned stream-processing job, ingest keyed events, observe job health, and query materialized window results.

For this exercise, assume a job is a validated directed acyclic graph of bounded map, filter, key-by, event-time window, and associative aggregate operators. Arbitrary user code, batch SQL, model training, and cross-job joins are outside scope.

For this exercise, assume producers send events with tenant, stream, event ID, event time, key, schema version, and payload. Retries and out-of-order delivery are normal.

A job version defines one allowed-lateness and correction policy, and published results identify the job version and window revision that produced them.

For this exercise, assume the platform checkpoints processing state and input positions so a worker or availability-zone failure can resume without silently losing accepted events or double-counting them in materialized results.

For this exercise, assume an operator can pause a job, deploy a new version from a chosen input boundary, inspect lag and failures, and launch an isolated replay over retained raw events. A replay writes a new result generation and becomes visible only through an explicit promotion.

For this exercise, assume downstream consumers read current window results and can subscribe to revision events. The platform must expose freshness and incompleteness instead of presenting late or stalled data as final.

What to build

  1. Tenants can validate, deploy, pause, resume, and inspect immutable versions of bounded stream-processing jobs.
  2. The platform consumes keyed events, applies event-time windows and allowed-lateness policy, and produces revisioned materialized aggregates.
  3. Consumers can query current results with job-version, window-revision, completeness, and freshness metadata and subscribe to corrections.
  4. Operators can run an isolated replay from retained input and explicitly promote one verified result generation without mixing it with live state.

At scale

  • For this exercise, assume 2 million accepted events per second globally across 50,000 active job versions, with individual keys and tenants capable of becoming hot.
  • For this exercise, assume accepted events normally affect a queryable result within 5 seconds at p95 and job lag becomes visible within 10 seconds.
  • For this exercise, retain replayable raw events for seven days, checkpoints for 24 hours, and promoted aggregate generations for 30 days.
  • For this exercise, survive loss of one worker or availability zone without acknowledged-event loss, and recover a failed partition from a recent checkpoint plus durable input replay.