Design WhatsApp: 2 billion users, 100 billion messages per day, voice and video calls, group chats up to 1024 members, multi-device sync, encrypted media, and Status posts that disappear in 24 hours — all with the property that the server cannot read message content. That single E2EE constraint reshapes every subsystem: there is no server-side full-text search of messages, no server-side content moderation in chats, no server-side fan-out of media, and no central key store the server can fall back to when a device is lost.
The hard parts are the Signal Protocol (X3DH for initial key agreement, Double Ratchet for per-message forward secrecy and post-compromise security), per-device fan-out where each recipient device gets its own ciphertext (not per-user — a 1024-member group with 2 devices each requires 2048 ciphertexts per send), group sender-keys to amortize body encryption across recipients (with O(N²) rekey cost on member removal), multi-device companion linking via QR code with primary-phone history forwarding, encrypted media with per-recipient key envelope and presigned upload URLs that bypass the API server, an abuse pipeline that runs entirely on metadata signals (bulk-send patterns, report aggregation) because content is invisible to the server, opt-in encrypted backups with a user-held 64-digit passphrase, and multi-region routing with EU residency for GDPR. Asked at Meta, Signal, Telegram, Element/Matrix, and any team building production E2EE messaging.
Suggested time: 90 minutes
Loading the workspace...
In short: with end-to-end encryption, the server can't read messages, so it routes encrypted blobs it never opens. Each device keeps a long-lived connection to a connection server. A stateless routing layer looks up where each recipient device is connected and forwards a separate ciphertext per device. Messages for offline devices wait in per-device delivery queues. Clients encrypt with the Signal protocol: X3DH to start a session, the Double Ratchet for one-to-one chats, and sender keys for groups. The server holds only public keys and metadata.
One-to-one messaging
Group messaging
Multi-device support
Voice and video calls
Media handling
Delivery semantics
The building blocks this design relies on, each explained in its own lesson.
Design an API Rate Limiter (medium)
Design Google Map (hard)
Design Dropbox (hard)
Design Facebook’s Newsfeed (hard)
Design a Load Balancer (hard)