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

The rest of this lesson is in the app

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.

Continue in ChannelPulse

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