Google Early Career II (US) Onsite

google logo
google
Early Career IIUS
July 12, 20257 reads

Summary

I had an onsite interview for an Early Career II role at Google in the US, which included a phone screen and two onsite interviews with specific data structure and algorithm questions.

Full Experience

Phone Screen - 45 Min

Q - You’re given an endless stream of integers and a non-negative threshold d; your job is to pull off three numbers as soon as they “fit together,” meaning the difference between the smallest and largest of the three is at most d, discard those three so they can’t be reused, and continue until the stream ends, returning the list of all triplets in the order they were completed

d = 2 inputStream: [10, 5, 7, 6, 8, 3, 4, 1, 2] Result - [[5, 6, 7], [1, 2, 3]]

Interview 1 - 45 Min

Q - Given a directed graph of n nodes labeled from 0 to n-1, find the minimum number of edges in any path from a start node A to a target node B, excluding any “obstacle” nodes through which traversal is forbidden. If no such path exists, return -1.

Interview 2 - 45 Min

Q - Merged Interval (Tweaked a little)

Interview Questions (3)

Q1
Find Triplet in Stream with Threshold
Data Structures & Algorithms

You’re given an endless stream of integers and a non-negative threshold d; your job is to pull off three numbers as soon as they “fit together,” meaning the difference between the smallest and largest of the three is at most d, discard those three so they can’t be reused, and continue until the stream ends, returning the list of all triplets in the order they were completed

d = 2 inputStream: [10, 5, 7, 6, 8, 3, 4, 1, 2] Result - [[5, 6, 7], [1, 2, 3]]

Q2
Minimum Edges in Graph Path Excluding Obstacles
Data Structures & Algorithms

Given a directed graph of n nodes labeled from 0 to n-1, find the minimum number of edges in any path from a start node A to a target node B, excluding any “obstacle” nodes through which traversal is forbidden. If no such path exists, return -1.

Q3
Merged Intervals (Tweaked)
Data Structures & Algorithms

Merged Interval (Tweaked a little)

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!