Google PhoneScreening SDE2
Summary
I had a phone screening for an SDE2 role at Google where I was asked to implement a movie recommendation system based on transitive similarity. I was rejected due to nervousness, mixing up syntax, and using the wrong heap type.
Full Experience
YOE : 4Y+
Question Similar to
movie recommendation system. Each movie has a title and a rating, if the process has marked movie A as similar to movie B, and movie B similar to movie C, we will also consider movie A as similar to movie C
Given a movie from the list, return its N similar movies with highest rating.
For example, if we have the following four movies:
"Movie A" with rating 6 "Movie B" with rating 7 "Movie C" with rating 8 "Movie D" with rating 9 and the process has determined the following similarities:
"Movie A" is similar to "Movie B" "Movie B" is similar to "Movie C"
Solution I gave
https://leetcode.com/playground/YvepGCT9
Verdict : Reject
I was not prepare for the Interview got very nervous about approach so I mixed up with java and C++ syntax as it was just a normal text editor didn;t get noticed
Instead of min heap used Max heap
But this was the overall code that I used
Interview Questions (1)
Implement a movie recommendation system. Each movie has a title and a rating. If a process marks movie A as similar to movie B, and movie B as similar to movie C, then movie A is also considered similar to movie C (transitive property).
Given a movie from the list, return its N similar movies with the highest rating.
For example, if we have the following four movies: "Movie A" with rating 6 "Movie B" with rating 7 "Movie C" with rating 8 "Movie D" with rating 9
And the process has determined the following similarities: "Movie A" is similar to "Movie B" "Movie B" is similar to "Movie C"