KatInterview

Streaming Replay of Recorded Vehicle Telemetry in a 3D Viewer

System DesignModel answer
MediumModel answerSystem Designstreamingcachingtime-series

Last updated

Design a browser-based 3D replay viewer that streams time-indexed vehicle logs from object storage, with prefetching, fast seeking, and aligned playback.

Problem

Design a system that replays recorded vehicle drives as an interactive 3D scene. Each drive is a collection of time-stamped logs stored in object storage (for example, an S3 bucket). An engineer opens a drive in a viewer and watches the vehicle and its recorded signals move through the scene, with play, pause, and a timeline for seeking.

Playback has to begin quickly and stay smooth, even though a single drive is often too large to download before the first frame can appear.

Constraints

  • The log files already exist in object storage when playback is requested. Your system reads them but does not control how they were recorded.
  • Every recorded message carries a timestamp, so all data in a drive can be placed on one shared timeline.

Clarifying questions you should ask

  • What does a log contain? Only vehicle pose over time, or also heavy sensor data such as point clouds and camera frames? At what rates?
  • How large is one drive, and what file format is it stored in?
  • Does "real time" mean smooth playback at recorded speed, or must the viewer also follow a drive that is still being uploaded?
  • How many engineers use the viewer at once, and how often do they open the same drives?
  • Do you need speeds other than 1x, frame stepping, or reverse playback?
  • Must the viewer run in a web browser?

What we expect

Describe the architecture end to end: the preprocessing step, the chunk and manifest format, the client buffer and cache, the playback clock, handling of heavy data, and how the system fails and is measured. Call out the trade-offs you make.

Hints

Hint 1

Split each drive into time-indexed chunks and publish a small manifest, so the client can request just the window around the playhead instead of the whole file.

Hint 2

Use one playback clock on the client. For each frame, interpolate pose and sample each sensor stream at that clock time, rather than letting every stream drive its own timing.

Hint 3

Keep chunks immutable so they can be cached at a CDN edge. Decide how to handle a seek that lands outside the prefetched window and how to degrade when a chunk is slow or missing.