KatInterview

Design a Global Photo and Video Hosting Platform

System DesignModel answer
HardModel answerSystem Designobject-storageCDNmedia-processing

Last updated

Architect a system that stores, processes, and serves user-generated photos and short videos at planetary scale with strong durability, low latency, and controlled cost.

The Problem

You're tasked with designing a platform where users can upload, manage, and share photos and short videos. The system must handle hundreds of millions of uploads per day, serve reads globally with low latency, and remain durable and cost-effective at exabyte scale.

Functional requirements

  • Upload: support both single-file and multipart (resumable) uploads
  • Retrieve/download: fetch originals and processed variants (thumbnails, transcoded renditions)
  • Delete and list: soft-delete with owner-scoped listing and cursor-based pagination
  • Processing pipeline: auto-generate thumbnails and transcode videos into adaptive formats
  • Search: filter by owner, media type, upload date, and user-defined tags
  • Secure access: generate short-lived signed URLs for both upload and download
  • Quotas: enforce per-user storage limits with real-time reservation and usage tracking

Non-functional requirements

Address each of the following explicitly in your answer:

  • Durability: target eleven nines (10^−11 annual loss probability)
  • Availability SLOs: reads vs. writes, and what happens during a regional outage
  • Multi-region layout: where data lives, how it replicates, and what consistency model applies to blobs vs. metadata
  • CDN integration: caching strategy and how you invalidate or avoid stale content
  • Encryption: in-transit and at-rest, envelope key management
  • Access control: authentication and authorization, including third-party delegation
  • Abuse prevention: rate limiting, content hashing for known-bad material, quota enforcement
  • Cost model: storage tiering, lifecycle policies, cold storage, and egress optimization
  • Background jobs: how you achieve effectively-once semantics across thumbnailing, transcoding, and moderation
  • Metadata schema and indexing: what you store, how you shard it, and what the search latency tradeoff is
  • Observability: metrics, distributed tracing, audit logs
  • Migrations and backfill: how you evolve the schema or reprocess billions of existing objects
  • Disaster recovery: RPO/RTO targets and how you test them
  • Performance targets: p95 and p99 latency for reads and uploads

Deliverables

  1. A rough API sketch (endpoints, key request/response fields)
  2. A component diagram in text or ASCII form
  3. Storage technology choices with justification (object store vs. block vs. file, metadata store)
  4. Capacity estimates with back-of-envelope numbers

Scale hints to get you started

Assume roughly 2 billion registered users, 500 million photo uploads per day, and 50 million short-video uploads per day (clips up to 60 seconds). Read-to-write ratio is around 100:1, and reads are heavily skewed toward recent and popular content.

Hints

Hint 1

Start with capacity math before drawing any boxes. Nail down ingest volume in PB/day, raw storage footprint after redundancy, peak upload rate, peak read rate, and CDN egress in Tbps — interviewers will probe these numbers and they shape every architectural decision that follows.

Hint 2

The single most important design insight is separating the two data planes: blobs are large, immutable, and eventually replicated, while metadata is small, mutable, and must be strongly consistent. Sketch a data model that keeps these on different stores with different consistency and replication policies, and explain why that split is the right call.

Hint 3

Think through the upload commit protocol as a distributed transaction: how do you atomically finalize quota, flip the metadata state to READY, and trigger background jobs without double-charging or losing work if any step crashes? Idempotency keys, an outbox pattern, and a GC sweep for orphaned blobs are the building blocks.