# Design a search spell correction system: system design interview question

> Query correction with tight latency limits, context-sensitive choices, and protection for valid names and rare terms.

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


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a service that detects spelling errors in search queries and suggests or applies corrections. The service works with an existing search system."

## What to clarify first

- Product and language
- Query traffic
- Query size
- Vocabulary
- Read:write mix
- Latency
- Actions and accuracy
- Consistency and availability
- Freshness and durability
- Data, privacy, and exclusions

## Scope of a strong answer

Core requirements:

- Detect probable spelling errors in English search queries.
- Return a correction, offer a suggestion, or keep the query unchanged.
- Keep the original query available after any correction.
- Add new names and terms without a service restart.

Usually out of scope:

- Build the search index or the document ranker.
- Translate queries.
- Rewrite queries for grammar or style.
- Build a separate model for each user.

## What interviewers probe

### Meaning of a query

A nearby common word is not always the intended word. A rare name can look like a spelling error.

### Response time under load

Each token can produce many candidates. Full query combinations can exceed the time budget even when the vocabulary fits in memory.

### New names and terms

New names must become visible quickly. Untrusted query counts can also promote errors or abusive terms.

### Evidence that a change helps

Clicks do not prove that a correction preserved intent. Automatic changes also alter the data that future models learn from.

## Common mistakes

- The design treats dictionary membership as a complete test for spelling errors.
- The service chooses the nearest common word without considering the full query.
- The service applies every proposed correction without checking accuracy or preserving the original query.
- The design ignores candidate growth across several tokens.
- The service learns directly from query volume without controls for abuse or previous corrections.
- The evaluation measures correction volume instead of accuracy, coverage, and harm to valid queries.

## The bar by level

- **Senior:** Controls expansion across tokens and meets the latency budget. Defines action thresholds and evaluation groups. Handles durable updates, compatible releases, and rollback.
- **Staff+:** Defines measurable harm limits for valid queries and rare names. Designs experiments that account for feedback bias. Balances freshness, abuse resistance, memory cost, and availability.

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


---
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.
