C++ Interview with an Amazon engineer.
C++ Interview with an Amazon engineer
Watch someone solve the what are my friends buying problem in an interview with an Amazon engineer and see the feedback their interviewer left them. Explore this problem and others in our library of interview replays.
C++ interview with an Amazon engineer: What are my friends buying
Interview Summary
Problem type
What are my friends buying
Interview question
An online retailer is releasing a new feature called "What are my friends buying?". The feature lists a set of products that you have not already purchased from the things that your friends have bought, in order of most bought to least bought.
Instead of your friends, what about your social circle? A social circle of a person is defined as the person's friends and their friends.
Interview Feedback
Feedback about Manxome Possum (the interviewee)
Advance this person to the next round?
Yes
How were their technical skills?
3/4
How was their problem solving ability?
3/4
What about their communication ability?
4/4
Context
Conducting a mock virtual onsite interview for a mid-level software engineer. Evaluating the candidate on technical questions only. I posed one technical question, targeted at evaluating coding with a focus on data structures and algorithms.
Summary
You met the requirements for a mid-level software engineer. You have a solid problem solving approach and appropriately used data structures and algorithms to solve the problem. You did not reach any extensions to the problem.
Technical Evaluation
You have a solid problem solving approach, clarified requirements well, proactively used examples to clarify requirements. You needed a minor hint to focus on solving the right problem. You solved the right problem. Specifically, you used appropriate data structures and algorithms and could state the time and space complexity of your solution.
Suggestions for improvement:
- Try to start the question faster. You don't need to re-write the problem statement out, just a verbal confirmation is sufficient. This would have saved 4-5 minutes and in this case would have let you start one of the extension questions.
- Inserting into a heap-based priority queue is O(log n) per insert, hence if you construct a priority queue based on inserts it will be O(n log n). One way of remembering this is that nothing can ever come for free - if you insert n times into a data structure that promises to allow you to always get the min/max element in O(1) time, there must be some kind of rebalancing going on internally. See: Efficiency of the STL Priority Queue.
However, if you construct a priority queue based on a sorted array there is a special optimization that allows you to construct it in O(n) time if you have all of the values available ahead of time by using Floyd's Algorithm, see: Priority Queue.
- When refactoring code to address extensions try to stick to using helper methods, as you were doing. For a mid-level SDE or higher, interviewers are looking at what your instincts are as requirements or problem statements change or become more complicated. Does the candidate just hack the code in-place or do they start generalizing to handle the new requirements and minimizing the code changes needed?
Feedback about Orange Malamute (the interviewer)
Would you want to work with this person?
Yes
How excited would you be to work with them?
4/4
How good were the questions?
4/4
How helpful was your interviewer in guiding you to the solution(s)?
4/4
Excellent interviewing skills and asked multiple follow-up questions. Guided the interview in the right direction.
Interview Transcript
Orange Malamute: Hello, can you hear me?
Manxome Possum: Yes, how about me?
Orange Malamute: I can hear you clearly. How are you doing?
Manxome Possum: I'm doing good. Thank you. How are you doing?
Orange Malamute: Great. Thank you. So before we get started, I wanted to ask you a few questions just to make sure I give a kind of interview. Is this the first time that you're using interviewing.io?
Manxome Possum: Oh, no, I have been using it. This month, last month.
Orange Malamute: Okay, and what position are you interviewing for?
Manxome Possum: So I am interviewing for the software engineering positions. So I have an interview coming up at Facebook next week.
Orange Malamute: And what level are you interviewing for?
Manxome Possum: I'd be interviewing e4 level.
Orange Malamute: Is that an entry-level software engineer or is it like a mid level?
Manxome Possum: Mid level, is like next to the entry level position. Which is SD to position kind of.
Orange Malamute: Okay. And how prepared do you think you are?
Manxome Possum: I think I'm prepared. I've been preparing for the last month.
...
**[The transcript continues extensively detailing the back-and-forth dialogue during the interview on coding questions and problem-solving strategies.]
Conclusion
In the interview setting, candidates are evaluated on their technical skills, problem-solving abilities, and communication skills. The feedback provided would help candidates improve for future interviews by focusing on clarifying questions and efficiently structuring their responses.