Google Winter Intern 2025 - Interview Question and Experience!
Anonymous User
1356

Problem:
Imagine you are standing at an incoming conveyor belt of items that need to be packaged into boxes of exactly three items that all fit together (for a later definition of "fit") and placed on a second, outgoing, conveyor belt. You have sufficient storage space to place items off to the side while you wait for a full triplet that all fit together.

Conveyor belt items are floating point numbers.
Three items that "fit together" means that all items are within distance d of each other.

input1 = [1.0,11.0,12.0,13.0,2.0,3.0]
d = 3

Output:
[[1.0,2.0,3.0],[11.0,12.0,13.0]]

Distance is calculated by absolute values of the items for example
|1.0-2.0| = 1 <= 3
|2.0 - 3.0| = 1 <= 3
|1.0-3.0| = 2 <= 3

Constraints: We shouldnt sort as it will change the order of the items and not use extra data structure.

About Me:
Final Year Student , planning to go to Abroad. Not a CP guy , I dont know how I got shortlisted to be honest.

Experience:
Initially came up with a solution , but I figured out this edge case and I couldnt solve. Interviewer wasnt friendly, it was not a typical Google Interview Experience , mine didnt went well at all. Interviewer mentioned that they have joined Google 4 months back. So yeaa... Just unlucky. Gotta move forward!

Also please drop the solution if you guys are able to solve!!

Comments (7)