Question d’entretien chez Meta

In the coding round, I was asked to solve a standard sampling question. Sample some items based on their weights.

Réponse à la question d'entretien

Utilisateur anonyme

11 oct. 2024

Convert weights to probabilities, then arrange these probabilities in a line. Sample a random number between 0 and 1, and finally use binary search to find the interval that this sampled number lies in