Requirements of the Typeahead Suggestion System’s Design

Lesson 163 of 25610 min readPremium lesson preview
In this lesson5 sections

Requirements of the Typeahead Suggestion System’s Design

Scope the suggestion behavior before sizing it. The number of completed searches differs from the number of prefix requests, and a response contains several complete suggestions rather than one character.

Requirements

We will design a typeahead suggestion system that meets the following functional and non-functional requirements.

Functional requirements

The system suggests the top frequent and relevant terms based on the user’s input.

Non-functional requirements

  • Low latency: Use 200 ms as an initial end-to-end latency target for this exercise, then choose a percentile and test it under load. Typing speed varies; 160 ms is an illustrative interval, not a universal average. Tag requests so a late response for an older prefix cannot replace current suggestions.

  • Fault tolerance: The system must provide suggestions even if individual components fail.

  • Scalability: The system must support an increasing number of users and queries over time.

Resource estimation

Use a hypothetical workload of 3.5 billion completed searches per day. This is a sizing assumption, not a current Google statistic. Assume 15 characters per query and initially one suggestion request per typed character; later client optimizations can reduce that request count.

Storage estimation

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.