bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

System Design Question

Design a Search Autocomplete System

bugfree Icon

Hello, I am bugfree Assistant. Feel free to ask me for any question related to this problem

Functional Requirements:

  • Prefix-based Suggestions: Given a query prefix, return autocomplete suggestions that start with the prefix.
  • Top-K Results: For each prefix, return the top K (e.g., 5) most popular or relevant suggestions.
  • Case Insensitivity: Suggestions should be case-insensitive ("App" and "app" are treated the same).
  • Alphabetic Characters Only: Ignore special characters and numbers in suggestions.
  • No Spell Correction: The system does not handle typos or fuzzy matching.

Non-Functional Requirements:

  • Low Latency: Suggestions should be returned quickly (within ~100ms per request).
  • Scalability: The system should support a large number of users and queries per second.
  • High Availability: The system should be resilient to failures and remain available.
  • Data Growth: Should handle increasing numbers of queries and growing suggestion lists gracefully.
  • Graceful Degradation: In case of failures, the system should serve stale data rather than fail completely.

System Design Diagrams

Zoom In and Out via trackpad or posture