← Meta Interview Insights

Meta·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Apr 2026

Summary

Meta system design round focused on live video comments, specifically the fanout problem at massive scale. The question had a lot of moving parts and I don't think I covered all of them as cleanly as I wanted.

Questions Asked (1)

Q1

Design a real-time comment system for live video streaming, where millions of viewers can post and see comments with minimal delay, including support for moderation, rate limiting, and replaying recent comments.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

The fanout piece is where I spent most of my time and also where I probably lost points.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., millions of concurrent viewers, sub-second latency, moderation needs). Then design a scalable architecture using a pub/sub system for real-time fan-out, with components for ingestion, processing, storage, and delivery. Finally, discuss trade-offs and optimizations for moderation, rate limiting, and replay.

Pro tip: Emphasize the importance of partitioning by video stream and using a push-based model (e.g., WebSockets) for low latency, while also considering a hybrid approach with long polling for fallback. Show awareness of cost and complexity trade-offs.

1. Clarify Requirements and Scale

Ask questions to understand expected scale (e.g., millions of concurrent viewers per stream, comment rate), latency requirements (e.g., <1s), moderation needs, and replay window. Define functional and non-functional requirements.

2. High-Level Architecture

Propose a microservices-based architecture with components: API gateway for ingestion, message queue (e.g., Kafka) for buffering, stream processing for moderation/rate limiting, pub/sub (e.g., Redis Pub/Sub) for fan-out, and WebSocket servers for delivery. Include storage for replay (e.g., time-series DB or Redis).

3. Deep Dive into Key Components

Detail how each component works: ingestion API handles auth and rate limiting; moderation service uses ML models and user reports; pub/sub partitions by stream ID; WebSocket servers maintain connections and push comments; storage retains recent comments for replay.

4. Address Scalability and Trade-offs

Discuss scaling strategies: horizontal scaling of WebSocket servers, sharding by stream, using CDN for static assets, and caching. Trade-offs: push vs. pull, consistency vs. latency, cost of moderation.

5. Handle Edge Cases and Optimizations

Cover rate limiting per user/IP, spam detection, handling sudden spikes, and replay API design. Mention optimizations like batching, compression, and fallback to polling.

Key Points to Mention

  • Use of WebSockets for real-time bidirectional communication with fallback to long polling.
  • Partitioning by video stream ID to enable horizontal scaling and isolation.
  • Rate limiting strategies: token bucket per user, sliding window, and distributed counters (e.g., Redis).
  • Moderation pipeline: automated filters (ML) + human review, with asynchronous processing to avoid latency.
  • Replay mechanism: store recent comments in a time-series database or Redis sorted sets with TTL, and provide an API to fetch by timestamp.
  • Trade-offs: push vs. pull, consistency vs. latency, cost of moderation, and handling of message ordering.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.