Google L5 Interview | January 2025

google logo
google
SDE III
March 11, 20250 reads

Summary

I appeared for a Google L5 interview in January 2025 and was asked a series of challenging Data Structures & Algorithms questions across multiple rounds, including scheduling, graph theory, and range management problems.

Full Experience

I appeared for Google L5 interview in January 2025. I was asked a series of challenging questions across three rounds. The first round involved a scheduling problem to determine worker presence during time intervals. The second round focused on graph theory, specifically finding a root to convert an acyclic graph into a binary tree, with complex follow-ups involving color-alternating and sequence-following layers. The third round was based on the LeetCode Range Module problem, with variations on the query part.

Interview Questions (3)

Q1
Worker Shift Schedule
Data Structures & AlgorithmsMedium

You are given a list of worker shifts, where each shift is represented as a list [name, start, end]. The name is a string representing the worker's name, start is an integer representing the start time of the shift, and end is an integer representing the end time of the shift. The goal is to generate a schedule that shows the intervals of time and the workers present during each interval.

Example:
Given the input:
[["Abby", 10, 100], ["Ben", 50, 70], ["Carla", 60, 70], ["David", 120, 300]]

The output should be:
[[10, 50, ["Abby"]], [50, 60, ["Abby", "Ben"]], [60, 70, ["Abby", "Ben", "Carla"]], [70, 100, ["Abby"]], [120, 300, ["David"]]]

Q2
Convert Graph to Binary Tree with Color Constraints
Data Structures & AlgorithmsHard

Given an undirected acyclic connected graph where each node has at most 3 edges, find a node which, when made the root, converts the graph into a binary tree.

Follow-up 1:
The nodes are colored Black or White, find a root such that:

  • The graph becomes a binary tree.
  • The tree alternates in color across layers (e.g., Depth 0: White, Depth 1: Black, Depth 2: White, etc.).

Either White or Black can be the starting color.

Follow-up 2:
The nodes are colored Red (R), Blue (B), or White (W), find a root such that:

  • The graph becomes a binary tree.
  • The layers of the tree follow a fixed color sequence e.g., RBWRBW… or BWRBWR… or WRBWRB).
Q3
Range Module with Single Value and Range Queries
Data Structures & AlgorithmsHard

The third round question was Range Module.

The initial query part involved a single value instead of a range.

Follow-up: The query part was then extended to a range.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!