New feature: AI Job Search! Try it now

System Design & Architecture

How to Ace the Distributed Systems Interview: Designing a Global High-Throughput Video Platform (TikTok / Reels Architecture)

How to Ace the Distributed Systems Interview: Designing a Global High-Throughput Video Platform (TikTok / Reels Architecture)

Designing a global-scale short-form video streaming platform like TikTok, Instagram Reels, or YouTube Shorts is one of the most frequent system design interview prompts for Senior, Staff, and Principal engineering candidates at FAANG and top tech companies.

This architecture guide breaks down the full 45-minute interview roadmap: functional requirements, back-of-the-envelope capacity planning, high-level pipeline design, deep-dive edge caching, and failure recovery.

+───────────────────────────────────────────────────────────────────────────+
|                  GLOBAL SHORT-FORM VIDEO PLATFORM TOPOLOGY                |
+───────────────────────────────────────────────────────────────────────────+
|                                                                           |
|   [ Mobile Client ] ──► [ Global Anycast Edge CDN ]                       |
|                                    │                                      |
|                                    ▼                                      |
|   [ API Gateway & Auth ] ──► [ Resumable Chunk Uploader (S3 Direct) ]     |
|                                    │                                      |
|                                    ▼                                      |
|   [ Kafka Event Bus ] ──► [ Distributed Transcoder (FFmpeg / GPU) ]       |
|                                    │                                      |
|         ┌──────────────────────────┴──────────────────────────┐           |
|         ▼                                                     ▼           |
|   [ HLS / DASH Segments (Origin) ]              [ Video Feature Vector ]  |
|         │                                                     │           |
|         ▼                                                     ▼           |
|   [ Edge CDN Multi-Tier Cache ]                 [ Real-Time Rec Engine ]  |
|                                                                           |
+───────────────────────────────────────────────────────────────────────────+

1. Requirements & Back-of-the-Envelope Capacity Estimation

Functional Requirements

  1. Video Ingestion: Users can upload 15s to 60s video clips from mobile devices over unstable network connections.
  2. Asynchronous Transcoding: Support adaptive bitrate streaming (HLS/DASH across 1080p, 720p, 480p, 360p with AV1/H.265 encoding).
  3. Low-Latency Personalized Feed: Deliver continuous sub-100ms video playback recommendation streams for 200M daily active users (DAU).
  4. Social Interactions: Real-time likes, comments, and share counts with high eventual consistency.

Non-Functional Requirements

  • High Availability: 99.99% availability for video playback stream.
  • Ultra-Low Playback Latency: First frame start time <200ms globally.
  • Storage Durability: Zero video loss after upload confirmation.

Numerical Scale Estimation

  • DAU: 200 Million users
  • Daily Uploads: 20 Million new videos/day
  • Average Raw Video Size: 30 MB
  • Daily Ingestion Bandwidth:
    20M videos * 30 MB = 600 TB / day raw ingestion (~55 Gbps continuous network ingress)
    
  • Read-to-Write Ratio: 100:1 (2 Billion video views/day)
  • Daily Egress Bandwidth:
    2B views * 10 MB (optimized compressed stream) = 20 PB / day (~1.85 Tbps edge egress)
    

2. High-Level Ingestion & Transcoding Pipeline

+───────────────────────────────────────────────────────────────────────────+
|                  RESUMABLE INGESTION & GPU TRANSCODING                    |
+───────────────────────────────────────────────────────────────────────────+
|                                                                           |
|   [ Client App ]                                                          |
|         │ (1. Request Presigned S3 Multipart URL)                         |
|         ▼                                                                 |
|   [ Ingestion Gateway ] ──► [ S3 Temp Storage (Chunk Part Ingestion) ]    |
|                                    │ (2. Upload Complete Webhook)         |
|                                    ▼                                      |
|                          [ Apache Kafka Cluster ]                         |
|                                    │                                      |
|                                    ▼                                      |
|                   [ Distributed Transcoder Worker Fleet ]                 |
|                   (GPU-Accelerated NVENC / H.265 / AV1)                   |
|                                    │                                      |
|         ┌──────────────────────────┴──────────────────────────┐           |
|         ▼                                                     ▼           |
|   [ 1080p / 720p / 480p HLS Chunks ]               [ Master Manifest.m3u8]|
|                                                                           |
+───────────────────────────────────────────────────────────────────────────+

Resumable Chunked Multipart Upload

To ensure reliable uploads over fluctuating 4G/5G connections:

  1. Client requests a presigned multipart upload session token from the Ingestion Service.
  2. File is split into 5MB chunks client-side, uploaded in parallel with exponential backoff retries.
  3. Ingestion Service verifies checksums (MD5/SHA-256) per chunk and triggers a completion event in Apache Kafka.

3. Feed Recommendation & Edge Delivery Architecture

Dual-Layer Caching Strategy

  1. L1 Edge CDN (Cloudflare / Fastly / CloudFront): Caches the first 2 segments (3-second duration) of the top 20 trending videos per geographic region.
  2. L2 Regional POP Cache: Stores full video playlists for viral content with high local affinity.
  3. L3 Origin Storage (S3 / Ceph): Permanent cold object storage with automatic tiering to Glacier after 90 days.
+───────────────────────────────────────────────────────────────────────────+
|                     FEED GENERATION: USER REQUEST FLOW                    |
+───────────────────────────────────────────────────────────────────────────+
|                                                                           |
|   [ Mobile App ] ──► (GET /feed/v1?user_id=123) ──► [ Feed Service ]     |
|                                                            │              |
|          ┌─────────────────────────────────────────────────┴────────┐     |
|          ▼                                                          ▼     |
|   [ Redis Cluster (Precomputed Feed Cache) ]             [ ML Ranker Node]|
|   - 50 Video IDs ready in memory                         - Vector Search  |
|   - &lt;5ms retrieval latency                             - Fast Candidate |
|                                                            Scoring (10ms) |
|                                                                           |
+───────────────────────────────────────────────────────────────────────────+

4. Key Architectural Trade-Offs & Edge Cases

Architectural VectorStrategy A (Naive)Strategy B (Production Scale)Justification
Video FormatMP4 Monolithic FileHLS / MPEG-DASH Adaptive BitrateDynamic resolution switching prevents buffering on cellular connections.
Feed DeliveryReal-Time DB QueryPrecomputed Redis Ring BufferReduces database read QPS from 2M to near-zero with sub-10ms response times.
Like CounterDirect SQL UPDATE ... + 1In-Memory Redis HyperLogLog / Redis Inactive BatchingPrevents row locking and write bottleneck on viral posts with 500k likes/min.
Cold StartEmpty FeedGeo-Clustered Trending Fast PathInstant content display while recommendation vector model personalizes user preferences.

5. Live Interview Strategy with Kairo

In a 45-minute live interview, timing and structured communication are critical:

  • 0–5 min: Clarify functional/non-functional scope and calculate scale.
  • 5–15 min: Draw high-level end-to-end dataflow.
  • 15–35 min: Deep-dive into transcoding pipelines, caching hierarchies, and fault tolerance.
  • 35–45 min: Address edge cases, database sharding, and telemetry.

With Kairo's Invisible Copilot HUD, real-time architectural memory hooks, trade-off cheat sheets, and latency equations stream onto your monitor without latency—100% cloaked from screen share.