LinkedIn's "Design Typeahead Suggestions" is a system design interview question focused on building a scalable autocomplete feature for search bars, common in web/mobile apps. It emphasizes real-time suggestions using data structures like Tries, with considerations for caching, ML ranking, and backend scalability.[2][9]
Design a typeahead (autocomplete) system that provides relevant search suggestions as users type in a search box, prioritizing popular or trending terms. The system must handle high query volumes from web and mobile clients, support daily data updates (e.g., new terms), and deliver top results quickly while incorporating caching for performance.[6][9][2]
Input: q="san"
Output:
{ "suggestions": [ "san francisco", "santa clara", "sandwich", "san diego" ] }
(Top 4 by frequency; actual count varies by design).[4][2]
Input: q="a" (broad prefix)
Output: Top 10 popular terms starting with "a" (e.g., "apple", "amazon"), fetched from cache.[2]
Uses a Trie where nodes store word completion counts/frequencies for ranking; cache popular prefixes in Redis. ML can refine via user history, but base on aggregate logs.[4][2]