Google L5 Interview | January 2025
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-11Added By Anonymous
Source: Link
Hi Everyone,
I appeared for Google L5 interview in January 2025. Here are the questions I was asked. Hope this will help people preparing for the same role.
Round 1:
1You are given a list of worker shifts, where each shift is
2represented as a list [name, start, end]. The name is a string
3representing the worker's name, start is an integer representing the
4start time of the shift, and end is an integer representing the end
5time of the shift. The goal is to generate a schedule that shows the
6intervals of time and the workers present during each interval.
7
8Example:
9Given the input:
10[["Abby", 10, 100], ["Ben", 50, 70], ["Carla", 60, 70],
11["David", 120, 300]]
12
13The output should be:
14[[10, 50, ["Abby"]], [50, 60, ["Abby", "Ben"]],
15[60, 70, ["Abby", "Ben", "Carla"]], [70, 100, ["Abby"]],
16[120, 300, ["David"]]]Round 2:
1Given an undirected acyclic connected graph where each node has
2at most 3 edges, find a node which, when made the root, converts
3the graph into a binary tree.
4
5Follow-up:
6The nodes are colored Black or White, find a root such that:
7• The graph becomes a binary tree.
8• The tree alternates in color across layers (e.g., Depth 0: White,
9Depth 1: Black, Depth 2: White, etc.).
10Either White or Black can be the starting color.
11
12Follow-up:
13The nodes are colored Red (R), Blue (B), or White (W), find a
14root such that:
15• The graph becomes a binary tree.
16• The layers of the tree follow a fixed color sequence
17e.g., RBWRBW… or BWRBWR… or WRBWRB).Round 3:
The third round question was Range Module
The query part was a single value instead of the range.
Follow-up: The query part was now a range.
Hope this helps.