System Design Interview: Mini Google Search
This is an allegedly common system design interview question. Every candidate is guaranteed to have used it. The use journey is relatively straightforward. The backend technology, however, can be insanely complex. So it’s a reasonably good question to see how the candidate navigates through the different components of the system. I’ll try to sketch out how I’d approach the question. As always, comments and feedback are welcome.
Let’s start simple and define the three components of a mini Google search system:
- A very simple UI is needed. It has a text box for the search query, which gets sent to a search backend. The search backend returns matched sites sorted by relevance, each with a URL, title and snippet. The UI then displays them to the user.
- A search backend that accepts the search query, looks up its search index, and responds to the UI.
- An index builder that’s constantly running to build and refine the search index for the search backend.
Let’s go through them one by one.
The UI
First, the UI. The UI is so straightforward that many people probably wouldn’t list it as a major component adjacent to the other two. I listed it mainly to highlight the user experience and requirements. Nevertheless, simplicity is exactly the point. One reason Google search won the search engine war was because they firmly believed that the search interface had to be simple. The more you can dumb down…