Design a live video comments system
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
## System Design: Live Video Comments (FB Live-style)
Design a system that supports **real-time comments** for a live video stream.
### Core user experience
- Viewers watching the same live stream should see new comments appear in near real-time.
- Users can post comments; everyone watching should receive them quickly.
- Comments are ordered in a sensible way (define your ordering semantics).
### Functional requirements
- Post a comment to a specific live stream.
- Fetch recent comments when a viewer joins (initial load + pagination/scrollback).
- Real-time delivery of new comments to connected viewers.
- Basic moderation support (e.g., remove a comment; block a user; optionally profanity/spam filtering).
### Non-functional requirements
- High fan-out: a single stream can have very large concurrent audiences.
- Low latency for real-time delivery (define a target, e.g., p95 < 1s).
- Reliability: comments should not be silently lost; define durability/consistency tradeoffs.
- Handle abuse: rate limiting, spam, and reconnect storms.
### What to cover
- APIs (HTTP/WebSocket) and data model.
- High-level architecture and key components.
- Scaling strategy (partitioning/sharding, fan-out model).
- Consistency/order guarantees and how you implement them.
- Storage, caching, and retention.
- Moderation and deletion propagation.
- Key metrics and failure modes.
Quick Answer: This question evaluates skills in designing scalable, low-latency real-time systems, covering fan-out delivery, ordering and consistency semantics, durable storage and caching, API and WebSocket design, and moderation propagation.