Pinterest: Typeahead service that starts small but can grow
Prompt. Design a typeahead (search autocomplete) service. The interviewer wanted a design suited to a modest starting scale that can still grow as demand increases.
Candidate's direction. An in-memory trie instead of a search engine's built-in completion suggester.
Areas the interviewer probed.
- The read path (prefix lookup and returning the top suggestions) and the write path.
- How keyword scores are updated over time.
- Rebuilding the trie and hot-swapping the new copy in without downtime.
- Trie internals and how keywords are stored.
- Scaling the trie without adding external services, including how to shard it.
Context. This was one of several onsite rounds. The candidate passed the design round but was rejected over a newly added AI-assisted coding round. In that round they had to add a read-through cache to a GET endpoint in an existing repo. The feedback was to understand the context fully before prompting the AI.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.