Python Interview with a FAANG engineer.

Python Interview with a FAANG engineer

Interview Summary

Problem type
Random Pick with Weight

Interview question

  1. 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 function pickIndex(), 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%).

  1. 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]

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

Order Statistic of an Unsorted Array

Most Frequent Integer and Pairs of Integers Sum

Triplet Array


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.