Compute probability with colored balls draws
Virtu FinancialData Scientist · Technical ScreenLast updated
This interview question evaluates statistical assumptions, formulas, estimation strategy, uncertainty, edge cases, and interpretation in a realistic interview setting. A strong answer for Compute probability with colored balls draws states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Question
You have 5 red, 5 blue, and 5 green balls in a bag. You draw balls one at a time without replacement, but each time you draw a green ball you return it to the bag. You keep any red or blue balls drawn. When you have three balls in hand, what is the probability that at least two of them are red? Follow-up: If instead the bag initially contains 10 red balls (with the same 5 blue and 5 green), what is the probability that at least two of the three balls held are red?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.