Google Interview Experience | L4 | SDE III #google #interviewexperience #DSA
Anonymous User
1084
Jul 27, 2026
Round 1 (DSA / API Design)
You have to design an API with the following methods:
- InsertAd(adContent, score)
- GetAd()
InsertAd
- Insert an advertisement with its content and score.
GetAd
- Return the advertisement with the highest score.
- Once an advertisement is returned, its score decreases by 1.
- The same advertisement should never be returned in consecutive calls, regardless of its score.
Follow-up
Each advertisement has one additional property: delay.
After an advertisement is returned, it cannot be returned for the next delay GetAd() calls.
Round 2 (Googlyness / Behavioral)
- The round consisted of several behavioral and situational questions.
- Most questions were based on collaboration, ownership, conflict resolution, and decision-making.
- I answered all the questions using the STAR (Situation, Task, Action, Result) framework.
- The interviewer asked follow-up questions to understand my thought process and the impact of my actions.
Round 3 (DSA / Route Matching)
You have to create two functions:
- registerHandler(route) — takes a route string and stores it.
- getRouteHandler(url) — takes a URL and returns the route that matches it.
It should work the same way route matching works in a web framework.
Example:
- Register:
"/users/{id}/pictures/{pictureId}" - Get:
"/users/101/pictures/1"→ should return the first route. - If there is no matching route, it should return null.
Follow-up
It should also return the parameters and their values for the URL, along with the matched route.
For the example above:
{ route: "/users/{id}/pictures/{pictureId}", params: { id: "101", pictureId: "1" } }Round 4 (Graphs / Trees)
There is an undirected acyclic graph. We need to find all the possible nodes in this graph that satisfy the following conditions:
- When the graph is rooted at that node, it should form a valid binary tree (each node has at most 2 children).
- Each level should have a different alternating color, like
BWBWBorWBWBWB(all nodes on the same level share one color, and adjacent levels alternate between the two colors).
Follow-up
Find the minimum number of node color changes required to meet the conditions.
Verdict: Selected
Comments (4)


