Case study: design typeahead
Interview question: design the suggestions under a search box. Half a billion searches a day, and as each person types, the five most popular ways to finish their words must appear before they type the next letter. Where do you start?
In this lesson you'll learn to
- Turn the typeahead question into requirements and numbers, and see how much debouncing saves.
- Size a pruned trie with the top k stored at each node, and explain why it fits in memory.
- Build suggestions offline from query logs, keep them fresh with a trending layer, and swap them in safely.
- Serve typeahead with full copies, edge caching and a client that debounces and drops stale answers.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.