Google makes a search engine, Maps, Gmail, YouTube, the Android phone system and the Chrome browser, all used by people in many languages. A fresher here needs strong basics in data structures and algorithms, and the habit of asking what happens when the input becomes very large. Prepare to think aloud, to test your own ideas with odd inputs, and to explain college projects simply. What to show here: clear thinking aloud about basics at very large size. Each question below has what the interviewer is checking, an answer frame and a sample spoken answer to adapt.
How Google hires, in its own words, and its questions for every job →
“I would use a trie, a tree where each node is one character and each path from the root spells a prefix. To find suggestions, I walk down the letters typed so far, and everything below that node is a match. The walk takes as many steps as letters typed, no matter how many queries are stored. A sorted list with binary search also works and uses less memory, so I would mention it. Since we only show a few suggestions, I would store the most popular completions at each node, so we do not explore the whole subtree on every key press.”
Weak answers scan every stored query for each letter typed, or forget that only the top few suggestions are needed.
“I would model the map as a graph: junctions are nodes, roads are edges, and the weight of each edge is the time to travel it. Dijkstra's algorithm finds the quickest path when weights are not negative, using a priority queue to always extend the closest node. Traffic does not change the algorithm, only the weights, so a jammed road gets a larger time. Since traffic changes during a journey, the route should be checked again along the way. On a map of a whole country, plain Dijkstra explores too much, so I would guide the search towards the destination, as the A star method does.”
Weak answers use road distance only and cannot say how traffic would enter the model.
“I would use edit distance, the smallest number of single character inserts, deletes or replacements to turn one word into the other. It is computed with dynamic programming: a table where each cell holds the distance between the first part of one word and the first part of the other, filled row by row from the three neighbouring cells. The cost is the product of the two lengths. Comparing the typed word with every dictionary word is too slow, so I would first narrow the candidates, for example to words of similar length that share several letter pairs. Among close candidates, I would prefer the more common word.”
Weak answers compare letters position by position, which fails as soon as one letter is missing.
“Each message would have its own identifier and a field naming the message it replies to. A conversation is a group of messages linked through those fields, like a tree. I would keep a hash map from message identifier to conversation identifier. When a reply arrives, I look up its parent in the map, find the conversation and add the reply in constant time on average. If the parent is unknown, because messages arrived out of order, I create a new conversation and merge the two when the parent shows up. I would not rely on the subject line alone, since unrelated mails can share a subject.”
Weak answers group mails only by subject text, or search all messages to find the parent.
“In your project, a search feature for our college library, everything worked in my tests. Then a classmate searched for a book title in Hindi and the app crashed. I had assumed each character was one byte, and my code cut a string in the middle of a character. I fixed it by using proper string functions that understand characters. More important, I changed how I test. I now keep a small file of awkward inputs: empty text, very long text, other scripts, emoji and leading spaces, and I run every text feature against it. After that, your result.”
Weak answers say their code had no bugs, or fix the single case without changing how they test.
“In your project, a teammate and I disagreed on how to store words for a text search feature. He wanted a sorted array and I wanted a hash table. We argued for an hour without progress. I suggested we each spend one evening building a small version and run both on the same data and the same searches. His approach was slower on exact lookups but much better for prefix search, which our feature needed. I had been wrong about what mattered. We used his design, and I wrote the tests for it. The project your result. Measuring took less time than the argument.”
Weak answers win the argument by insisting, or never find out who was right.
“I would take it as useful feedback, not as criticism. I would ask the reviewer what input size is realistic, then work out the cost of my code. Perhaps I have a loop inside a loop, which is fine for a thousand items and hopeless for billions. I would look for the step that grows fastest and ask whether a hash map, sorting first, or processing in a stream would remove it. I would also check memory, since loading everything at once may not fit. Then I would generate a much larger input, measure before and after, and share the numbers in the review.”
Weak answers argue that the tests pass, or make changes without measuring whether they helped.
“What interests me is that the problems look simple from outside and are very deep inside. Finding the right page for three typed words, or a route through a city, is something I use daily without thinking. When I built your project, a small search tool, I found how hard even a tiny version is, from spelling mistakes to ranking. I would like to work where those problems are taken seriously at full size, for users in many languages, including my own. I hope to learn how to write code that stays correct and fast when the input is far larger than anything I have seen.”
Weak answers talk about the brand or the office and cannot name a problem they find interesting.
No figures on this page: pay depends on the level, the city and the offer in front of you. When the offer comes, the free salary negotiation script helps with that part.
ClapAssist is an AI interview assistant for Mac and Windows. It listens to the interview on your computer and shows you what to say, in short lines you can read while you talk. Your live interview audio and screen are never stored. Your resume and notes are saved to your account so the app fills them in on any computer. It is hidden from screen share on every plan, including Free; only you can see it.