KatInterview

Building a Pipeline for Fleet-Captured Panoramic Imagery

System DesignModel answer
HardModel answerSystem Designsystem-designobject-storagegeospatial-indexing

Last updated

Design a system that receives huge volumes of geotagged panoramic photos from a vehicle fleet, stores raw and processed versions durably, and serves location-based tiles quickly.

Scenario

A mapping company runs a fleet of vehicles, each carrying a multi-camera rig that takes high-resolution panoramic photos of streets. Every photo comes with telemetry: GPS position, timestamp, heading/orientation, and the ID of the capturing device. Vehicles store data locally and send it in batches.

Design the backend that receives, stores, processes, and serves this imagery.

Requirements

Functional

  • Upload: an authenticated API that lets vehicles send images plus telemetry.
  • Storage: keep the original files for long-term archival, and keep processed versions suitable for public display.
  • Processing: extract metadata and produce optimized thumbnails and tiles for fast delivery.
  • Lookup: answer location queries such as "return the panorama nearest to latitude X, longitude Y".

Non-functional

  • Volume: roughly 50 TB of new data per day; tile retrieval must feel instant (sub-second).
  • Durability: no data loss; uploads must tolerate retries and be able to resume after interruption.
  • Security: only legitimate devices may upload, and file integrity must be verifiable.

What to deliver

  1. A text description of the high-level architecture and data flow.
  2. API design for both upload and retrieval.
  3. A data model for image metadata, including how you index it spatially.
  4. How the system copes with sudden surges of uploads (for example, many vehicles returning to depots at once) and how you reason about eventual consistency.

Start by converting the daily volume into throughput numbers, and state any assumptions you make.

Hints

Hint 1

Convert 50 TB/day into MB/s, then assume a peak multiple (fleets often return at the same time). Estimate captures per day from an assumed file size, and notice that metadata is tiny compared with the image bytes.

Hint 2

Keep the control plane and data plane apart: let the API hand out signed, resumable upload destinations so the image bytes go straight to object storage, and use a queue between upload and processing.

Hint 3

For spatial lookup, think of a hierarchical cell grid (S2, geohash) used as a row-key prefix, with a covering of the search circle scanned and filtered by exact distance. For consistency, make every pipeline step idempotent and publish tiles before the metadata row that references them.