Shopee interview question

Q: create a random generator with predefined probability