Question d’entretien chez Amazon

coding question about weighted random number generator