Lesson 14 of 15
34. Design Search Autocomplete (Typeahead)

Sources

3 min read+10 XP

Source notes

  • Tries, prefix search and edge n-grams: see Chapter 19. Count-min sketch, top-K and HyperLogLog: see Chapter 20.
  • All traffic numbers, query counts, prefix ratios and pruning factors are interview assumptions agreed in Step 1, not figures for any real service. Arithmetic computed 2026-10-08.
  • Trie vs flat-table equivalence, top-K building, decayed trend blending and prefix-length traffic shares: tested 2026-10-08 (code/ch34_autocomplete.py, all checks pass; synthetic query log).