Design Yahoo Mail Storage and Search for Hundreds of Millions of Users

Last updated: November 29, 2026

Quick Overview

Design the backend that stores mail for Yahoo Mail's user base and lets each user search their own mailbox by sender, subject, body text, and date within a second. Cover ingestion, storage layout, indexing, and how old mail is kept cheaply.

Yahoo
System Design
Software Engineer
Yahoo
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the backend that stores mail for Yahoo Mail's user base and lets each user search their own mailbox by sender, subject, body text, and date within a second. Cover ingestion, storage layout, indexing, and how old mail is kept cheaply.

Yahoo Mail is one of Yahoo's largest properties, with decades of mail per user and very uneven mailbox sizes. Interviewers want a design that partitions by user, separates metadata from blobs, builds per-user search indexes, and uses storage tiering to keep cost under control.

What the Interviewer Expects
  • Estimate scale: users, daily inbound messages, average size, total petabytes
  • Partition by user ID so each mailbox lives on one shard
  • Separate message metadata from bodies and attachments stored as blobs
  • Build per-user inverted indexes, updated asynchronously from ingestion
  • Tier old mail to cheaper storage and dedupe large attachments
  • Cover durability, replication, and spam or virus scanning in the ingest path
Key Topics to Cover
sharding by user
blob storage
inverted index
storage tiering
asynchronous ingestion
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you handle a single mailbox with 5 million messages?
  • How do you rebuild a corrupted search index for one user without downtime?
  • How would you support cross-folder conversation threading?
  • How would you implement account deletion so data is truly removed everywhere?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: receive mail via SMTP, store it durably, list folders with pagination, read messages, and search the user's own mailbox by fields and full text. Non-functional: 11 nines durability for sto...

High-Level Design
  1. Edge MTA accepts SMTP, runs spam and malware scoring, and writes the raw message to a durable queue.
  2. Delivery workers resolve the recipient, write the body and attachments to a **blob st...

Submit Your Answer
Markdown supported

Related Questions