Design Live Comments and Gifts Fan-Out for TikTok LIVE

Last updated: November 29, 2026

Quick Overview

Design the real-time system that delivers comments, likes and virtual gifts to every viewer of a TikTok LIVE stream, including streams with millions of concurrent viewers.

TikTok
System Design
Software Engineer
TikTok
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the real-time system that delivers comments, likes and virtual gifts to every viewer of a TikTok LIVE stream, including streams with millions of concurrent viewers.

TikTok LIVE is a core product with gifting revenue, and celebrity streams can spike to millions of viewers in minutes. The interviewer checks fan-out design, connection management, hot-room handling and the different guarantees needed for chat versus paid gifts.

What the Interviewer Expects
  • Separates the real-time delivery path from durable storage
  • Handles hot rooms with sampling, aggregation and tiered fan-out
  • Treats gifts as financial events with stronger guarantees than comments
  • Manages millions of persistent connections with gateway tiers
  • Defines latency targets and degradation behavior
Key Topics to Cover
fan-out
websockets
pub/sub
hot partitions
idempotency
rate limiting
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you guarantee a gift animation is shown to the streamer even if the viewer disconnects?
  • How do you order messages within a room?
  • How would you add moderation of comments before they are shown?
  • What changes if a room grows from 1,000 to 5 million viewers in five minutes?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: viewers in a room send comments, likes and gifts; all viewers see a live stream of messages; the streamer sees every gift; gifts are charged exactly once.

Non-functional: end-to-e...

High-Level Design
  • Edge gateways hold persistent WebSocket connections from viewers, grouped by room.
  • Message ingest service validates, rate limits, and runs fast moderation on comments.
  • **Room pub/sub lay...

Submit Your Answer
Markdown supported