Mock Interviewer

Ask Coach

Ask Coach
Clarify requirements before you design — kept separate from your stage notes.

Tap a question to start, or type your own below.

Design WhatsApp

Visual Problem Diagram

Design WhatsApp architecture diagram

Scenario

Picture sending the message "running late" to your family group chat from a train with a weak phone signal. The app does not hear back from the server in time, so it sends the same message again, which is what chat apps are built to do when a reply gets lost. The company that runs the chat would like everyone in the family to see one bubble, in the right order, with a small tick showing the message is saved, and it would like to do this without being able to read the text. The part of the system that carries, stores and delivers those messages is called a chat messaging system. The painful failure is that the line shows up twice because the server saved the retry as a brand-new message.

Stuck on where to start? Ask Coach

Clarify this problem here, or open Pathway Coach if you want a prep plan first.

Free Coach trial
How should I start prep?

This problem asks you to design a chat messaging system like WhatsApp, which is the set of servers and phone apps that carry a short message from one person to another person or to a whole group, and keep it safe until the other side has it. Think of sending “running late” to one friend whose phone happens to be switched off. You still want a small tick that tells you the message is saved. Think of a photo sent to a family group, and of opening the app after a day without signal and finding every message waiting in the right order. Some people also use a second phone for the same account, and that phone has to show the same chat.

In the interview you need to explain six things. First, how the text is scrambled on the phone so the server only moves bytes it cannot read. Second, how a retry on a bad network does not create a second bubble. Third, how one chat stays in the order people sent it. Fourth, how a photo travels on a different road from the short text, so a large file never delays a tick. Fifth, how a second phone can read the same chat. Sixth, how a small group can store a copy for each member while a huge group stores each message once. A proof of the encryption math can stay thin unless the interviewer asks for it.

Constraints

Functional

Send text in a one-to-one chat and in a group. Send a photo or a video. Show a saved tick and a read tick. Keep the text unreadable on the server. Deliver messages after a phone was offline. Show who is currently online.

Non-functional

When both people are online, the short signal arrives in under about 100 ms, so the tick feels immediate. The service stays up for a chat people treat as a daily utility. Messages in one chat stay in send order.

Scale

Billions of people, about a billion of them active in a day. Tens of billions of messages a day, so the busy hour sits in the hundreds of thousands of sends a second. Storage grows by multiple terabytes a day. Open live connections and group delivery are the rate that dominates.

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs

Not ready to design yet?

Try the free Coach trial — ask how to prep, what to practice first, or how InterviewCrafted works. Sign in when you want to start this problem.

Try Coach free

Log in to start practicing

Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.

Want full access now? View Pro pricing