Citadel Securities Interview Question

Design a random generator given a list of probabilities