CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· Data Flow

Search Autocomplete (Typeahead)

How search suggestions appear as you type: a prefix index built offline from past searches, served from memory, and refreshed regularly.

More System Design Interview Classics templates

Drawing diagram…

What this diagram shows

  • Suggestions come from a prefix trie held in memory
  • The trie is rebuilt every hour from search logs
  • Top suggestions per prefix are pre-computed

Prompt used

Data flow for search autocomplete: every search is logged to Kafka. An hourly Spark job counts queries, removes blocked terms and builds a trie with the top 10 suggestions for each prefix. The trie is stored in object storage and loaded by suggestion servers into memory. As a user types, the app calls the suggestion service, which answers from the in-memory trie; a CDN caches popular prefixes.

Mermaid code
flowchart LR
  U[User types] -->|Prefix| CDN[CDN Cache]
  CDN -->|Cache miss| SUG[Suggestion Service]
  TRIE[(In-memory Trie)] -->|Top 10 for prefix| SUG
  SUG -->|Suggestions| U
  S[Search Service] -->|Search queries| K[Kafka Search Log]
  K -->|Queries| SP[Hourly Spark Job]
  BL[(Blocked Terms)] -->|Filter list| SP
  SP -->|New trie| OS[(Object Storage)]
  OS -->|Load on refresh| TRIE

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

SequenceSystem Design Interview Classics

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

Data FlowSystem Design Interview Classics

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

C4 ArchitectureProSystem Design Interview Classics

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.