K Nearest Points (C++)
C++ Interview with a Microsoft engineer
Watch someone solve the k nearest points problem in an interview with a Microsoft engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.
C++ interview with a Microsoft engineer: K closest points
Interview Summary
Problem type
K nearest points
Interview question
- Find the K nearest points to a vertex.
- Change your solution under the condition that you have an input file of size 500 Petabytes.
Interview Feedback
Feedback about Pseudo Gyroscope (the interviewee)
Advance this person to the next round?
No
How were their technical skills?
3/4
How was their problem solving ability?
2/4
What about their communication ability?
3/4
It was a pleasure interviewing with you. Unfortunately I would have said no to passing you for an offer (although I would have advanced you to onsite). For the most part your technical ability is pretty good, you were able to write out clean functioning code...
Feedback about Indelible Raven (the interviewer)
Would you want to work with this person?
Yes
How excited would you be to work with them?
2/4
How good were the questions?
3/4
How helpful was your interviewer in guiding you to the solution(s)?
3/4
Please let me know the resource for design prep in case you remember it. Thanks!
Interview Transcript
Pseudo Gyroscope: Hello? Can you hear me? Hello?
Indelible Raven: Can you hear me?
Pseudo Gyroscope: Hi yes, I can hear you now...
Indelible Raven: ... So I guess kind of how I do it, I work in Microsoft and formerly Google...
Pseudo Gyroscope: Yes.
Indelible Raven: What's your primary language?
Pseudo Gyroscope: C++
...
Pseudo Gyroscope: ... So I'm returning a vector of neighbors that are within... oh wait... oh, you're saying the K closest neighbors?
Indelible Raven: Yes.
...
Indelible Raven: What if I gave you ten billion points and K is equal to three?
...
Indelible Raven: ... So I would look at if... so I want to read like a... not sure how to do this but look for a way to read parts of a file...
...
Indelible Raven: ... I'll just tell you alright? ...
Pseudo Gyroscope: Ok, what was the O(1) time?
Indelible Raven: That, you could do some sort of pre calculation to almost return... or return probably with some sort of accuracy threshold ...
Overall, you did okay. I would not have passed you, but you weren't bad either. That's kind of my feedback, do you have any questions?
Pseudo Gyroscope: So yeah, definitely the... I'm just really starting to look into design stuff...
Indelible Raven: ... So you should take a look at a Google's Flume framework for MapReduces...
Pseudo Gyroscope: Ok.