Google Interview Guide
Google is the most algorithm-purist of the big five, and the single most useful thing to internalise is that the first solution is the entry fee, not the answer. The interview is the ladder of follow-ups that comes after it — tighten the constraint, remove the extra space, make it work on a stream — and your score is decided by how you handle rungs three and four.
The second thing to internalise is structural: your interviewer does not hire you. An independent hiring committee that never met you reads their notes. Anything you thought but did not say does not exist.
The most algorithm-purist of the big five. Expect a clean problem, then layers of follow-ups that keep tightening the constraints until you are designing rather than recalling.
The loop
The bar
What they lean on
This is the durable part. Which pattern families a company favours is far more stable than which individual problems it uses, so prepare in this order:
-
graph-traversal-and-connected-components -
binary-search-on-answer -
two-dimensional-dp-and-knapsack -
tries -
sliding-window -
monotonic-stack -
shortest-paths-dijkstra-bellman-ford-and-floyd-warshall
Quirks worth knowing
- The follow-up ladder is the real interview. Getting the first solution fast buys you harder questions, not an early finish.
- Complexity analysis is graded explicitly. State time and space before you are asked, every time.
- Expect "now make it O(1) space" or "now the input is a stream" on almost every problem.
- Hiring committee review means the process is slow. Weeks between onsite and offer is normal, not a bad sign.
Reported problems
- 1Two Sumeasy
- 20Valid Parentheseseasy
- 3Longest Substring Without Repeating Charactersmedium
- 56Merge Intervalsmedium
- 146LRU Cachemedium
- 200Number of Islandsmedium
- 72Edit Distancemedium
- 139Word Breakmedium
- 207Course Schedulemedium
- 300Longest Increasing Subsequencemedium
- 322Coin Changemedium
- 1143Longest Common Subsequencemedium
- 133Clone Graphmedium
- 208Implement Trie (Prefix Tree)medium
- 743Network Delay Timemedium
- 787Cheapest Flights Within K Stopsmedium
- 875Koko Eating Bananasmedium
- 4Median of Two Sorted Arrayshard
- 42Trapping Rain Waterhard
- 76Minimum Window Substringhard
- 295Find Median from Data Streamhard
- 297Serialize and Deserialize Binary Treehard
- 84Largest Rectangle in Histogramhard
- 127Word Ladderhard
- 212Word Search IIhard
- 239Sliding Window Maximumhard
- 269Alien Dictionarypremiumhard
Pitfalls
Section titled “Pitfalls”- Solving it silently. The hiring committee reads notes, not your code. Unexplained correct code scores below explained near-miss code, because the notes cannot record reasoning you never voiced.
- Treating the first solution as the finish line. Expect two to four follow-ups per problem. Budget time for them: a polished optimal solution with no time left for follow-ups scores worse than a good solution plus two rungs climbed.
- Skipping the brute force because you recognised the pattern. Recognition is exactly what makes you vulnerable here — the follow-up ladder often starts by breaking the assumption your pattern relied on.
- Not asking about constraints. Google interviewers frequently leave them out deliberately, and the missing constraint is usually the hinge of the whole problem.
Interview follow-ups
Section titled “Interview follow-ups”| They ask | What they’re checking | The answer |
|---|---|---|
| “Now do it in space.” | Whether your solution’s space is incidental or understood | Name what the extra space is for. If it is a hash map for lookups, the answer is usually sort-plus-two-pointers; if it is a recursion stack, an explicit stack or Morris-style traversal. |
| “The input is now a stream you cannot store.” | Whether your state is bounded | Say what state you must keep and whether it is bounded. A running max or a size- heap survives; anything needing a sort or random access does not. |
| “What if the values can be negative?” | Whether you checked your invariant | The classic window-breaker. If your approach assumed a monotonic running sum, say so and switch to prefix sums plus a hash map. |
| “Scale it to a thousand machines.” | Whether you can leave the single-machine frame | Partition by key, compute locally, merge. Name the shuffle as the expensive step. This is where the L5+ system design round starts leaking into the coding round. |
Recall card
Section titled “Recall card”- The follow-up ladder is the interview. Budget time for rungs three and four; the first solution is the entry fee.
- A hiring committee that never met you reads the notes. Narrate everything — unvoiced reasoning does not exist.
- Ask for the constraints. They are often withheld on purpose, and the missing one is usually the hinge.
- Expect the space follow-up. Know the -space variant of every pattern you claim.
- State the brute force even when you recognise the pattern — the ladder often begins by breaking your assumption.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading