KatInterview

Building a Multi-Source Autocomplete System for Workplace Search

System DesignModel answer
MediumModel answerSystem Designautocompletesearchfrontend-architecture

Last updated

Design the frontend and backend for a workplace search autocomplete that blends history, colleagues, files, applications, and filter chips in real time.

You're designing the autocomplete experience for a workplace search platform. When a user types into the search input, the interface displays live suggestions pulled from multiple data sources:

  • Search history: queries the user has run before
  • People: colleagues in the organization
  • Documents: files the user can access
  • Applications: internal tools and services
  • Filter suggestions: scoped refinements (e.g., "modified:last-week", "type:spreadsheet")

Each suggestion type triggers different behavior when selected—some execute a search, others navigate directly to a resource, and filters modify the query scope.

Design both the client-side architecture and the supporting service layer. Your design should address:

  • How the client manages typing input, network requests, and response ordering
  • How suggestions from different sources are retrieved, ranked, and combined
  • Permission enforcement so users only see resources they can access
  • Latency targets and how to handle slow or failing data sources
  • Accessibility requirements for keyboard and assistive technology users
  • Caching strategy and observability

Assume organizations range from hundreds to tens of thousands of employees, with document counts in the millions per tenant.

Hints

Hint 1

Consider debouncing vs. throttling and when to cancel in-flight requests as typing continues

Hint 2

Think about how to handle a scenario where one data source is slow—should you wait or show partial results?

Hint 3

Each suggestion type may need different permission checks; search history is private, documents require ACL evaluation