Design an Incremental Spelling and Grammar Assistant
Build a writing assistant that detects errors while a user types, offers corrections, and keeps suggestions aligned with the current document.
Problem statement
For this exercise, assume an English-language editor sends a bounded text context while its owner types. The assistant detects spelling and grammar issues and returns replacement suggestions; it changes text only after the owner accepts a suggestion. Each document has one active editing owner.
Results for an older document revision must not be applied to a newer revision. Design the model data lifecycle and the online product. Collaborative editing, full-document rewriting, translation, and automatic acceptance are outside scope.
What to build
- Detect spelling and grammar issues in the current text context and return replacement text with affected ranges.
- Let the owner accept or reject a suggestion; never change text without acceptance or apply a correction to stale content.
- Use permitted annotated examples and feedback to evaluate, version, and safely deploy improved models.
At scale
- For this exercise, assume 100,000 concurrent editors and a peak of 20,000 suggestion requests per second.
- For this exercise, each request contains at most 2 KB of UTF-8 text and suggestion latency has a 200 ms p95 target.
- For this exercise, inference outages must leave ordinary typing available; suggestions may be temporarily unavailable.
- For this exercise, training copies of text require owner permission and are retained for at most 30 days.