Design End-to-End Encrypted Message Sync Across Linked Devices
Last updated: November 29, 2026
Quick Overview
Design how Messenger delivers end-to-end encrypted messages to a user who is signed in on a phone, a laptop, and a tablet, including history on a newly linked device. The server must never see plaintext.
Meta
November 29, 20260
0
0 solved
Design how Messenger delivers end-to-end encrypted messages to a user who is signed in on a phone, a laptop, and a tablet, including history on a newly linked device. The server must never see plaintext.
Meta moved Messenger and WhatsApp to default end-to-end encryption with multi-device support, so senior candidates get probed on how the server can route and store messages it cannot read. The interviewer checks key management reasoning, fan-out per device, and how history survives without breaking the security model.
What the Interviewer Expects
- Explain per-device identity keys and why messages are encrypted per device
- Describe the server as an untrusted relay with an encrypted mailbox
- Handle adding and removing a device safely
- Design encrypted history backup or transfer for new devices
- Discuss metadata the server still sees
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you stop a compromised server from silently adding a device?
- How would you make group messages cheaper than N devices times M members?
- What happens to undelivered messages when a device is removed?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: send and receive on every linked device; new device sees recent history; removing a device stops delivery to it; group chats.
Non-functional: server never holds plaintext or long-...
High-Level Design
Each device generates its own identity key pair and uploads public keys plus one-time prekeys to a key directory. To send, a client fetches the device list for each recipient (and the sender's own...