Design WhatsApp: What Happens to a Message When Your Friend Is Offline?
What the video says
You send a WhatsApp message, but your friend's phone is switched off. So where does it wait?
In an interview, I'd follow the ticks. Your phone sends the message to a server, and a single gray tick means the server has a copy.
Their phone is offline, so the server files it in a waiting tray, sealed, until the phone checks in.
When the phone reconnects, the server sends it down. The phone saves it and replies with an acknowledgement. Only then is the tray cleared, and you get a second gray tick.
What if that reply gets lost? The server sends the message again. It carries the same ID, so the phone spots the copy and shows it once.
Blue ticks are one more acknowledgement, sent when your friend opens the chat.
WhatsApp says 2 gray ticks mean it reached their phone or a linked device. Its privacy policy says undelivered messages are kept encrypted for up to 30 days.
Each tick confirms a different step. Stored on the server, delivered to a device, read by your friend. Retry until confirmed, and drop duplicates by ID.
Follow for the next system. Next time, how does Google Maps reroute when you miss a turn?
Sources
Every fact in the video was checked against these when it was made.