Python Interview with a Meta engineer.

Python Interview with a Meta engineer

Interview Summary

Problem type
Closest Pair Sum

Interview question

  1. Find and return a pair of integers in a sorted array (all integers are positive) that, when summed up, bring you the closest to the value of k.

  2. Given the root of a binary tree, imagine yourself standing on the right side of it and your best friend standing on the left side, both observing the tree from their respective sides. Return the values of the nodes you can both see, first from the left side (bottom to top), followed by those from the right side (top to bottom)

Interview Feedback

Feedback about Exquisite Platypus (the interviewee)
Advance this person to the next round?
Yes
How were their technical skills?
4/4
How was their problem solving ability?
4/4
What about their communication ability?
4/4

What went well:

She was amazing. She did a great job first asking clarifying questions. She then took notes and helped visualize what she was thinking. Her explanations were clear and she explained her thought process during the code as well. She followed the 8 step process to coding interviews perfectly and I have no doubt in my mind that she will succeed in her future interviews.

Additional tips: Writing down the steps of how to solve problem is optional but I believe it can help some candidates when it comes to communication.

Feedback about Platinum Warrior (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

He provided me with a very detailed guidance on what to do during an interview. Really appreciate it!

Interview Transcript

Platinum Warrior: Okay, so today I'll ask you a couple of coding. ...

Exquisite Platypus: I see, perfect. Let me make sure I understand the question correctly. ...

Platinum Warrior: Yeah, that makes sense. So how would you check that your sum is closest to K?
Exquisite Platypus: I see, so that's a great question. So to check if from the closest to K, I can have like a variable to store, ...

Platinum Warrior: When I reach this step here, we're going to get to the current sum will be 31, I equal 2 and J equals 3. ...

Exquisite Platypus: Okay, cool. ...

Platinum Warrior: Okay, cool, cool. Yeah, I have a couple of questions for you. ...

Exquisite Platypus: My code will return 825 because ...

Platinum Warrior: Okay, cool.

Time Complexity

The new complexity would be O(n) because we only go through all elements in the array at most once. The space complexity should be O(1) as we only use a few variables to store the results.

Dry Run Approach

Platinum Warrior: You can do a dry run with either the given input or your own. ...

Exquisite Platypus: Okay, sounds good. I can just use the given input. ...


Second Problem: Binary Tree Views

Platinum Warrior: Alright, the next question is, you're given the root of a binary tree. ...

Exquisite Platypus: I actually have done this question before. ...

Conclusion