Practice: Design WhatsApp
Design a large-scale mobile messaging platform where billions of users send text messages, media, and voice messages in 1-on-1 and group chats, with end-to-end encryption, delivery and read receipts, typing indicators, message/user search, and offline message delivery — similar to WhatsApp.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Users send and receive text messages in 1-on-1 chats with sub-second delivery when both parties are online
- Users send and receive images, video, and voice messages; media is compressed and delivered efficiently
- Messages are end-to-end encrypted — the server must never have access to plaintext message content
- Offline users receive all missed messages in order when they come back online
- Delivery receipts: single tick (sent to server), double tick (delivered to device), blue tick (read by recipient)
- Typing indicators and online/last-seen presence are shown to contacts in real time
- Group chats support up to 1,024 members with the same delivery and receipt guarantees
- Users can search their message history, contacts, and groups by keyword
- The system captures usage analytics and exposes operational metrics/logs for monitoring, without impacting message delivery latency
Non-functional requirements
- Message delivery latency < 200ms p99 end-to-end when both users are online
- Support 2 billion registered users; 100 million concurrent online users
- Messages must be delivered at-least-once; deduplication on the client side
- End-to-end encryption: server stores only ciphertext; keys never leave the device
- Message history stored for 90 days; media stored for 30 days with CDN caching
- Search queries return results within 300ms p99 via a dedicated, asynchronously-updated search index
- All services and workers emit metrics/logs to a centralized observability pipeline for production monitoring and alerting
- 99.99% uptime — users must be able to send messages even during partial outages