0%
System requirements
Functional
Capacity estimation
Bandwidth
API design
Content Management
Database design
Content and User Metadata (PostgreSQL)
High-level design
API Tier
Request flows
VR Content Upload and Transcoding Flow
Detailed component design
Adaptive Bitrate Streaming Engine
Trade-offs and tech choices
Quality vs Latency
Failure scenarios and bottlenecks
Media Server Failure During Live Event
Future improvements
Foveated Streaming
System requirements
Functional
Capacity estimation
Bandwidth
API design
Content Management
Database design
Content and User Metadata (PostgreSQL)
High-level design
API Tier
Request flows
VR Content Upload and Transcoding Flow
Detailed component design
Adaptive Bitrate Streaming Engine
Trade-offs and tech choices
Quality vs Latency
Failure scenarios and bottlenecks
Media Server Failure During Live Event
Future improvements
Foveated Streaming
A VR streaming service delivers immersive 360-degree video content to headsets worldwide with ultra-low latency. Unlike standard video streaming where 200ms of buffer is invisible, VR latency above 20ms causes motion sickness. The technical challenge is delivering 10-50x the bandwidth of traditional video while meeting latency requirements an order of magnitude stricter.
Let us size a VR streaming platform targeting 100K concurrent users during normal operation and 1M during live events.
The VR platform exposes APIs for content management, streaming sessions, and authentication.
1POST /v1/content/upload
2Body: multipart/form-data { file: <vr_video>, title: "...", description: "...", spatial_format: "equirectangular_360", duration_sec: 1800 }
3Response: { "content_id": "ct-abc123", "status": "processing", "transcoding_job_id": "tj-xyz" }
4
5GET /v1/content/:content_id
6Response: { "content_id": "ct-abc123", "title": "...", "status": "ready", "renditions": [{ "codec": "h265", "bitrate_mbps": 50, "resolution": "7680x3840" }, ...], "thumbnail_url": "...", "duration_sec": 1800 }
7
8GET /v1/content?page=1&limit=20&sort=popular
9Response: { "items": [...], "total": 10000, "page": 1 }The VR platform uses specialized storage for each data type: relational for metadata, object storage for media, and time-series for analytics.
1users (user_id UUID PK, email VARCHAR UNIQUE, password_hash VARCHAR, display_name VARCHAR, subscription_tier VARCHAR, created_at TIMESTAMP)
2content (content_id UUID PK, title VARCHAR, description TEXT, uploader_id UUID FK, spatial_format VARCHAR, duration_sec INT, status VARCHAR, created_at TIMESTAMP)
3content_renditions (rendition_id UUID PK, content_id UUID FK, codec VARCHAR, bitrate_mbps INT, resolution VARCHAR, file_path VARCHAR, size_bytes BIGINT)
4streaming_sessions (session_id UUID PK, user_id UUID FK, content_id UUID FK, device_type VARCHAR, started_at TIMESTAMP, ended_at TIMESTAMP, playback_position_sec INT, peak_bitrate_mbps INT)The VR streaming platform follows a three-tier architecture: API tier for business logic, media tier for transcoding and delivery, and storage tier for persistence.
s3://vr-media/originals/ct-abc123/raw.mp4) and creates a content record in PostgreSQL with status "processing."s3://vr-media/renditions/ct-abc123/h265/50mbps/).The media streaming engine is the heart of the VR platform. It orchestrates content delivery from origin storage through CDN to headset, adapting quality in real-time based on network conditions. This is the core interview question for this problem.
The ABR engine runs on the client (VR headset) and makes per-segment decisions about which rendition to download. For VR, the ABR algorithm is more aggressive than standard video because the consequences of getting it wrong (buffering -> motion sickness) are more severe.
Higher VR resolution requires higher bitrate, which requires more bandwidth and encoding time. 8K per eye at 90 FPS demands 100+ Mbps, beyond what most home connections can sustain. The trade-off is between visual fidelity and smooth playback.
Adaptive bitrate navigates this dynamically: it delivers the highest quality the network can sustain at any moment. But the ABR ladder must be designed for the connection distribution. If 80% of users have 30-60 Mbps connections, the rendition ladder should have fine granularity in that range and fewer renditions above 80 Mbps.
A media server encoding a live VR event crashes. Without redundancy, the live stream goes dark for all viewers.
Mitigation: run 3 redundant live encoders (primary, secondary, tertiary) processing the same camera feed simultaneously. The CDN ingests from the primary. If the primary fails, health checks detect the failure within 5 seconds and the CDN switches to the secondary encoder's output. Viewers experience at most a 5-second glitch. The tertiary provides protection against double failures.
Eye-tracking hardware (present in Apple Vision Pro, Meta Quest Pro) enables delivering high resolution only where the user is looking. The foveal region (5-10 degrees of visual angle) gets 8K quality while the periphery gets 2K. This can reduce bandwidth requirements by 60-80%, making high-quality VR streaming viable on standard broadband connections.
Implementation requires tile-based encoding (dividing each frame into independently encoded tiles), real-time gaze tracking, and sub-50ms end-to-end latency from gaze change to tile delivery. The CDN must cache tiles at multiple quality levels, and the manifest format must support per-tile quality selection.
Reading a solution is not the same as producing one under interview pressure. Design it on the whiteboard and get scored feedback.
0%
System requirements
Functional
Capacity estimation
Bandwidth
API design
Content Management
Database design
Content and User Metadata (PostgreSQL)
High-level design
API Tier
Request flows
VR Content Upload and Transcoding Flow
Detailed component design
Adaptive Bitrate Streaming Engine
Trade-offs and tech choices
Quality vs Latency
Failure scenarios and bottlenecks
Media Server Failure During Live Event
Future improvements
Foveated Streaming
System requirements
Functional
Capacity estimation
Bandwidth
API design
Content Management
Database design
Content and User Metadata (PostgreSQL)
High-level design
API Tier
Request flows
VR Content Upload and Transcoding Flow
Detailed component design
Adaptive Bitrate Streaming Engine
Trade-offs and tech choices
Quality vs Latency
Failure scenarios and bottlenecks
Media Server Failure During Live Event
Future improvements
Foveated Streaming