# Design an email search system: system design interview question

> Search across private email content with fresh results, low query latency, and strict mailbox access checks.

Source: https://sysround.com/questions/design-email-search-system
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design an email search service. Users search message headers, bodies, and attachments. Keep results fresh, return them quickly, and enforce mailbox access."

## What to clarify first

- Search behavior
- Stored data
- Traffic and read-to-write mix
- Query latency
- Freshness
- Mailbox permissions
- Deletion
- Attachments
- Durability and availability
- Boundaries

## Scope of a strong answer

Core requirements:

- Search message headers, bodies, and supported attachment text.
- Filter results by sender, recipient, date, and attachment type.
- Return ranked result pages with current mailbox access checks.
- Reflect message changes within the freshness targets.
- Enforce completed deletions before returning results.

Usually out of scope:

- Send or deliver email.
- Search scanned images, encrypted attachments, or standalone archive files.
- Support semantic search or conversation groups.
- Provide exact result counts.
- Provide organization-wide administrator search.

## What interviewers probe

### Search latency across mailboxes

Each user searches a small part of a large corpus. Large shared mailboxes can cause uneven query load.

### Freshness after message changes

Message changes and attachment results arrive at different times. Retries can restore old content or recreate a deleted result.

### Access to search results

Access can end before the index changes. Results, snippets, caches, and page cursors can expose mail after access ends.

### Search within attachments

Small attachment files can contain much larger data. Slow or unsafe files must not delay other messages or conceal freshness failures.

## Common mistakes

- The design treats the search index as the authority for mailbox access or deletion.
- Every query searches the full corpus without a plan to limit its scope.
- Header and body updates wait for attachment extraction.
- Duplicate events, old events, or delayed extraction results restore obsolete content.
- The freshness promise ignores queue delay, extraction limits, or index refresh time.
- Snippets, caches, or later result pages expose obsolete or unauthorized text.

## The bar by level

- **Senior:** Proves revocation and deletion safety despite index lag. Defines version rules, query scope, extraction limits, and freshness budgets. Handles cursor checks and partial failures.
- **Staff+:** Defines the revocation boundary across services. Plans rebuilds, busy mailbox placement, regional failure, and bulk imports. Quantifies capacity and cost. Identifies guarantees that require refusal.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=email-search


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
