Google Early Career II (US) Onsite
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)
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]]
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.
Merged Interval (Tweaked a little)