Design WhatsApp
IntermediateOn the roadmap:Interview Ready · step 7: Practise under pressure
Design a one-to-one and group chat system with delivery receipts.
Focus on connection handling, message routing, storage of undelivered messages, ordering and idempotency, and group fan-out.
Requirements
- Send and receive messages in real time
- Deliver messages to offline users when they reconnect
- Sent / delivered / read receipts
- Group chats up to 256 members
- Media sharing
Scale & constraints
- 2B users, 100B messages per day
- Hundreds of millions of concurrent connections
- End-to-end latency under 500 ms for online users
Hints (try without them first)
- How do clients stay connected, and how does a message find the right server?
- What do you store for offline delivery and for how long?
- How do you fan out a group message?
Useful reading