Design iMessage Delivery With Per-Device End-to-End Encryption Fan-Out
Last updated: November 29, 2026
Quick Overview
Design the backend that delivers an end-to-end encrypted iMessage from one sender to every registered device of every recipient, including offline devices and group chats.
Apple
November 29, 20260
0
0 solved
Design the backend that delivers an end-to-end encrypted iMessage from one sender to every registered device of every recipient, including offline devices and group chats.
This is a flagship Apple scenario because the server never sees plaintext, so fan-out happens per device key, not per user. The interviewer checks identity and key directory design, store-and-forward queues, ordering, and how privacy constraints shape every decision.
What the Interviewer Expects
- Separates the key directory service from the message relay and push layer
- Explains that the sender encrypts once per recipient device using that device's public key
- Uses durable per-device inboxes with TTL and acknowledgment-based deletion
- Handles ordering, deduplication, and delivery and read receipts
- Covers device add and remove, key rotation, and group membership changes
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 does a new device added to an account see messages sent while it was being set up?
- How would you keep a group of 32 people with 4 devices each efficient for the sender?
- What metadata does the server still learn, and how could you reduce it?
- How would you fall back to SMS when the recipient is not reachable on iMessage?
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 text and attachments to users and groups; deliver to all of a recipient's devices (iPhone, iPad, Mac, Watch); delivered and read receipts; offline delivery when a device reconnects. N...
High-Level Design
- Identity Directory Service (IDS): maps a handle (phone or email) to the list of device public keys. The sender's device queries it, cached with short TTL.
- Client encryption: the sender g...