Google Phone Screen | Jul 2024
Summary
I recently had a phone screen interview with Google in July 2024. The main focus was a challenging coding question that required grouping objects based on shared properties.
Full Experience
My Google phone screen in July 2024 involved a single technical question. The problem presented an array of objects, each with a unique ID and several properties (p1, p2, p3). The task was to group these objects such that any two objects sharing at least one common property would belong to the same group. I was given an example demonstrating the input and the expected output structure. I discussed my approach, which involved identifying connections between objects through their properties.
Interview Questions (1)
Given an array of objects, group them into a single group if they have any property in common.
Object structure:{
id,
p1, p2, p3;
}p1, p2, p3 are properties and can be shared, while id will be unique for each object.
For Example:
Input :
E1 : id1, p1, p2, p3
E2 : id2, p1, p4, p5
E3 : id3, p6, p7, p8
E4 : id4, p9, p10, p5
Output :{{id1, id2, id4}, {id3}}