System design interview questionHardMessaging & Realtime
Design a Chat / Messaging System like WhatsApp
Design WhatsApp-style messaging: send/receive chats in near real time, with history when users come back online.
Interview scope
Client → Realtime Gateway (+ Gateway/LB for REST). App → DB + Cache + Message Queue (offline/push). No Client → DB.
Functional requirements
- Send a message to another user or group.
- Deliver quickly when recipient is online.
- Store chat history for later read.
Scale and quality goals
- Low latency delivery for online users.
- Durable history for offline catch-up.
- Fan-out / push should not block forever in one HTTP request.
Capacity assumption
Design for this scale
Assume ~50M DAU sending ~40 messages/day → ~2B msgs/day (~23k msgs/s average).
Practice more than a diagram
Place components on the Froquiz canvas, connect the data flow, and see which decisions the scenario-specific review finds missing. The full exercise and review unlock with Premium.
Explore Premium →