Python Interview with a FAANG engineer.
Python Interview with a FAANG engineer
Interview Summary
Problem type
Random Pick with Weight
Interview question
- You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.
You need to implement the functionpickIndex(), which randomly picks an index in the range[0, w.length - 1](inclusive) and returns it. The probability of picking an index i is w[i] / sum(w).
For example, if w = [1, 3], the probability of picking index 0 is 1 / (1 + 3) = 0.25 (i.e., 25%), and the probability of picking index 1 is 3 / (1 + 3) = 0.75 (i.e., 75%).
- Given the root of a binary tree, return the vertical order traversal of its nodes' values. (i.e., from top to bottom, column by column).
If two nodes are in the same row and column, the order should be from left to right.
Interview Feedback
Feedback about Admiral Samurai (the interviewee)
Advance this person to the next round? Yes
How were their technical skills? 4/4
How was their problem solving ability? 3/4
What about their communication ability? 4/4
03/29/2024: 16:00, Analog Armadillo, ML System Design [Meta Finals]
- Excellent vibes, easy to talk to and understand.
- Don't mention if you have seen the question, this may ‘raise the bar’ for you. Act oblivious, and run through the question generically, starting simple, detailing the complexities, and then proposing a more efficient approach and run with it. Incorporate cues that show ‘thinking’
- Chose simplicity, I would even advise against writing too many notes except for the complexities. Try and get to code within 3 minutes of proposing solutions, implement the best you have and roll with it.
Interview Transcript
The Legendary Avenger: Hello?
Admiral Samurai: Hello?
The Legendary Avenger: Can you hear me? All right, I can hear you well, hope you can hear me.
Admiral Samurai: Yep.
The Legendary Avenger: Awesome. All right. How's your day going?
Admiral Samurai: Good, good, yeah. I am preparing for an interview with Facebook next week. It's a final round interview.
The Legendary Avenger: For sure. Awesome. Okay, so I'll do this because I don't ran you through the process, but the way meta works. So let me just take a few minutes to first run you through that before we switch into interview mode. But for technical interviews, it's typically about 45 minutes. Right. And they're strict.
Admiral Samurai: Is that true even for the final round?
The Legendary Avenger: Exactly. And that's going to be the same case. So if you stuck to the practice, in fact, just go there, sort it by popularity, and solve them in that order, they're going to ask you pretty much the same questions.
The Legendary Avenger: So, okay, that's actually an interesting question. So python is and exclusive stat. Inclusive. Right. So you say 21. It might, yeah, exactly. Okay, so you start from zero. Yeah, this makes sense. Yeah. So you start from the minimum, you go to the maximum, you pick a random one and then you find.
Admiral Samurai: Yes. Okay.
The Legendary Avenger: And then this can then follow the conditions you said. So range, no range, start to end. So that makes things a lot simpler because you're just using the values that are here. All right, so this is good. This makes sense to me and I think it's actually an optimal solution. So feel free to code it out and let's see how that works.
Unique ID Generation
- Interviewer: Microsoft Engineer
- Candidate: Golden Possum
- Watch interview
Order Statistic of an Unsorted Array
- Interviewer: Google Engineer
- Candidate: Supersonic Taco in Java
- Watch interview
Most Frequent Integer and Pairs of Integers Sum
- Interviewer: Google Engineer
- Candidate: Propitious Bear in Java
- Watch interview
Triplet Array
- Interviewer: Google Engineer
- Candidate: Whirlwind Alligator in C#
- Watch interview
We know exactly what to do and say to get the company, title, and salary you want.
Interview prep and job hunting are chaos and pain. We can help. Really.