Google Onsite Reject
Company: Google
Role: unknown
Interview Stage: Onsite
Location: Bangalore / Hyderabad
Year: unknown
Original Post Content:
I recently gave Google interviews for Bangalore/Hyderabad openings and was asked the following questions:
Phone Interview:
Design LRU Cache : I used Ordered Dictionary in Python to do the implementations. The feedback was good.
Onsite Interviews:
Round 1: Given a list of people each with a preference of activities from the set [A, B, C, D, E], I had to divide them into teams of 5 people such that maximum people got their preferences. Getting a preference was not a requirement but a good to be in situation.
For implementation I divided people into 5 buckets and then assigned the people for each team for each activity.
Feedback: Need to be more logical, code readability not good and the edge cases not covered, (Though I dry ran on the edge cases and examples shared by the interviewer).
Round 2: Given a list of cafes and the starting point for each friend and the list of adjacent points we need to return the cafe that minimizes the maximum distance any friend has to travel to reach the cafe.
My solution: Worked on the multi-source BFS approach, coded it, shared the output and dry ran on the examples and edge cases: Feedback for this round was good.
Round 3: You are given a dump of logs with timestamp and name of people who became friends:
timestamp1, p1, p2
timestamp2, p2, p3
timestamp3, p3, p4
timestamp4, p5, p1
You need to tell the timestamp when everyone became friends:
My solution: Treat the logs as an edge for the graphs with timestamps as the weight and run union find to get the timestamp where everyone becomes friends. I wasn't able to optimise it beyond the usual implementation of union find.
Wrote the solution, dry ran on the example shared, had few minutes, told the interviewer he can ask the follow up question if he wants. The interviewer asked about the 6 link problem. Basically the theory that states that any 2 people will be connected with each other between 6 links. How would I test this theory.
I told him if we were checking on two people we would use BFS if we want to test on everyone we can test using multi-source BFS.
Feedback: Negative. Was told that I need to be more structured, logical and there was no time for the follow up question.