We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design and AI Engineering, by Roni Das. 984 interactive lessons.
Start LearningSystem design interview guide
in this guide
7 parts open to everyone · 3 with a free account · 3 with the course
You can read 7 of 13 parts. A free account opens the deep dive; the course opens all of it.
Design WhatsApp tests whether you understand persistent connections (WebSocket or XMPP), message durability, the difference between presence and message delivery, fan-out to groups, and how end-to-end encryption changes server responsibilities. Bonus points if you can talk about why WhatsApp can run on 50 engineers when Facebook Messenger runs on hundreds.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the WhatsApp design across a run of lessons, not one page. These 4 alone are about 91 minutes of step-by-step reading, every one with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 5 lessons. Each one teaches one piece of the WhatsApp design above, step by step.
Lifetime access for ₹1,111 in India or $25 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $25 elsewhere, once
Get System DesignYou own this course
214 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
WhatsApp delivers 100+ billion messages per day across 2+ billion users, with end-to-end encryption and 99.99% delivery success.
Designing WhatsApp forces you to combine real-time bidirectional messaging, durable offline delivery, end-to-end encryption, presence and typing indicators, and group fan-out. It is the canonical chat system design problem and a favorite at FAANG.
Where it shows up
Commonly asked at Meta (which owns WhatsApp), Google, Amazon, Slack, Discord, Snap, and Microsoft Teams. It is the standard real-time messaging interview question.
Spec sheetWhatsApp
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: WebSockets, Push Notifications and Message Queues.
Full-duplex, persistent connections, how the real-time web actually works.
Deliver messages to users even when they're not actively using your app.
Decouple producers from consumers with a buffer that holds messages until they're processed.
Splitting a database across multiple servers, the nuclear option for scaling writes, and the architecture behind Instagram, Uber, and YouTube.
all part of
System Design Masterclass
770 lessons · about 287 hours · 18 free to read
₹1,111in India, by UPI
$25everywhere else, by PayPal
You own this course
Continue with WebSocketspay once,
yours for life
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Total users
2B
WhatsApp public reporting. Assume 60% daily active.
Messages per day
100B
100B+ messages per day is a publicly cited figure. That averages to roughly 80 messages per DAU.
Messages per second (peak)
5M
100B a day averages about 1.16M a second. A 4x peak factor for busy evenings gives about 4.6M, rounded to 5M. That is an everyday peak only: planned events such as a World Cup final or New Year's Eve run several times higher (see Event peaks under the deep dives).
Concurrent persistent connections
500M
Roughly 40% of DAU online at peak. Each holds a WebSocket or XMPP-style connection.
Storage per message
200 bytes
Plus media stored separately. 100B messages per day equals roughly 7 PB per year of message metadata. Media is much larger but stored in object storage with TTL.
Clients hold a persistent connection (originally XMPP, now a proprietary protocol) to a fleet of Connection Servers. When a client sends a message, the connection server hands it to a Message Router. The router looks up the recipient's connection (in a sharded session store keyed by user_id), and if the recipient is online, it pushes the message over their connection. If offline, the message is queued in an Offline Message Store (sharded by user_id) and delivered on reconnect. End-to-end encryption (Signal Protocol) is handled client-side: the server only sees ciphertext blobs. Media (images, videos) is uploaded to a Media Service that returns a URL; the URL is encrypted and embedded in the message. Group chats use the same router with a fan-out step: the router looks up group members and pushes a copy to each online member. Push notifications (APNs, FCM) are used to wake the recipient app when offline.
In a real interview, sketch this on the whiteboard before diving into any single box.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Holds millions of persistent connections per node. Originally Ejabberd (XMPP), rewritten in Erlang for high concurrency. Routes incoming messages to the Message Router and pushes outgoing messages to the client.
A sharded KV store mapping user_id to the connection server holding that user's active connection. Reads and writes on every message. Backed by Redis or a custom in-memory store.
Receives the ciphertext blob, looks up the recipient in the session store, and either pushes over the live connection or stores in the offline queue. For groups, fans out to all members.
Sharded by user_id. Stores messages for users not currently connected. On reconnect, the connection server drains the queue and pushes everything in order. Messages are deleted from the server after delivery (WhatsApp is store-and-forward, not durable archive).
Handles uploads and downloads of images, videos, voice notes, and documents. Media is encrypted client-side with a per-message symmetric key (the key is encrypted in the E2E payload). Media is stored in object storage with a 30-day TTL.
Tracks online/offline/typing/last-seen state. Updates flow over the same persistent connection but are rate-limited. Presence is eventually consistent; a 1-2 second lag is acceptable.
When a message is queued for an offline user, fires a wake-up notification via APNs (iOS) or FCM (Android). The notification does not contain message content (it cannot, given E2E encryption).
users. Sharded by user_id hash. Device keys are public keys used for the Signal Protocol.
Every table for WhatsApp, its keys, and which store fits it and why.
Persistent connections at 500M concurrent. A single connection server in WhatsApp's published architecture holds 1 to 2 million persistent connections. With 500M concurrent users, that is 250 to 500 servers just…
6 deep dives on the parts that break at scale, with 1 diagrams: Persistent connections at 500M concurrent; Message routing and offline queueing; End-to-end encryption and the server's role.
Erlang vs Go or Java for the gateway. Erlang's lightweight processes win at millions of concurrent connections per node. Go and Java need 5 to 10x the hardware for the same load. The trade-off is hiring: the…
5 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
A connection server holding a million live connections crashes. What happens to those users and their messages?
4 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design WhatsApp with the AI tutor.
WhatsApp famously ran on a tiny engineering team (~50 engineers serving 900M users at the time of the Facebook acquisition) by leaning hard on Erlang and a custom version of FreeBSD-tuned servers. The chat protocol is a proprietary binary protocol derived from XMPP. End-to-end encryption uses the Signal Protocol developed by Open Whisper Systems. Media is stored in a custom blob store. The Erlang choice came from WhatsApp's hire of an Ejabberd contributor in the early days.
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
India: UPI, cards or netbanking through Razorpay. Elsewhere: card or PayPal. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
It is really nice and good Please join the course