Verily Screening - Initial Interview (USA)
Summary
I attended Verily's initial screening interview on 09/03 and was asked a problem about finding related IDs based on shared properties.
Full Experience
I attended Verily interview on 09/03. Here is the question asked :
You're given a list of elements. Each element has a unique id and 3 properties. Two elements are considered related if they share any of the 3 properties. Please write a function that takes the input and returns all the related IDs.
- E1: id1, p1, p2, p3
- E2: id2, p1, p6, p5
- E3: id3, p3, p7, p8
Expected output: [["id1", "id2"], ["id1", "id3"]]
Interview Questions (1)
Find Related IDs based on Shared Properties
You're given a list of elements. Each element has a unique id and three properties. Two elements are considered related if they share any of the three properties. Write a function that takes the input list and returns all pairs of related IDs.
Example input:
- E1: id1, p1, p2, p3
- E2: id2, p1, p6, p5
- E3: id3, p3, p7, p8
Expected output: [["id1", "id2"], ["id1", "id3"]]