Mock Interviewer
Ask Coach
Tap a question to start, or type your own below.
Chat System Design
Visual Problem Diagram

Scenario
A product launch spikes 30K messages per second while 5M users sit with WebSockets open. One user's "typing…" indicator should not fan out as a full message; offline users must catch up without duplicate bubbles when the network retries. The interview is real-time delivery, ordering, and connection scale—not a single "message queue" box.
Design a real-time chat system supporting one-on-one and group messaging with delivery and read receipts, presence, and searchable history. Production systems separate low-latency signaling from media blobs and assume networks retry—your design must handle duplicates and ordering without confusing users.
You should support text and attachments, online/typing presence, offline catch-up, and ordered delivery at scale. Be ready to explain connection server sharding, per-chat sequence numbers, group fan-out policies, and storage for 2.5B+ messages/day. Latency budgets and degradation when the ranker or fan-out queue lags are fair game.
Constraints
1:1 and group chat, text/images/files, delivered/read receipts, presence, message history with pagination
< 200 ms p95 delivery for online users, 99.99% availability, ordered per-chat delivery, durable history
500M users, 50M DAU; ~2.5B messages/day (~30K/s peak); ~1.25 TB/day; millions of concurrent connections
Stages ahead
Log in to start practicing
Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.
Want full access now? View Pro pricing