System design · Cases — three designs, worked end to end

Design search typeahead

Suggestions must appear in under 100 ms while the user is still typing, which rules out ranking anything at read time. This derives the latency budget, builds a trie whose nodes cache their own answers, and then handles the parts that make it a real system — updating popularity from a stream, trimming memory, and personalisation.

26 min read Full lesson in the app Patterns: trie, precomputed-top-k, stream-aggregation

What you'll be able to do

Before this: caching-and-stampedes, consistent-hashing

Log in to read the rest of this lesson

Suggestions must appear in under 100 ms while the user is still typing, which rules out ranking anything at read time. This derives the latency budget, builds a trie whose nodes cache their own answers, and then handles the parts that make it a real system — updating popularity from a stream, trimming memory, and personalisation. This walkthrough runs about 26 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.

Log in to continue

The first module of every track is free to read on the web: see what's open in System design.