Phase 1 — Clarify & Scope
Interviewer: Design a distributed email service — think Gmail or a large transactional email platform like SendGrid. What do you want to clarify?
Candidate: Key questions:
- Are we building a user-facing email client (Gmail-style — read/compose/search), a transactional email sender (SendGrid-style — API to send emails at scale), or both?
- What's the storage model — do we need to store received email, or just send?
- What's the scale — users, messages per day?
- What protocols — SMTP for sending, IMAP/POP3 for retrieval?
- Search requirements — full-text search over email body?
Interviewer: Gmail-style — user email client with sending, receiving, storing, and searching. 1 billion users, 10 billion emails per day sent and received. Full-text search over emails. Standard protocols: SMTP in/out, IMAP for client access.
Candidate: Let me size this:
Average email size ~75 KB (headers + body + small attachment):
But most emails are stored for months/years. With 5-year retention:
Each user has a 15 GB quota (like Gmail). Average utilization 20%:
Interviewer: What are the core requirements?
Candidate:
- Send email: compose → queue → deliver via…
In the full tutorial
- Phase 2 — High-Level Architecture
- Phase 3 — Deep Dive & Evolution
- Phase 4 — Robustness & Operations