Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Coin Betting Probability Algorithm

HardStatistics & Probability00:00
Practice interviewer
In session
5 left
00:00

Your question is Coin Betting Probability Algorithm. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Write an algorithm for a game where you place a bet and flip a coin, starting with 100 dollars. If you get heads you win your bet, if you get tails you lose. Your bet changes based on the previous bet and the result of the last flip. You are done if you lose all your money or finish all the flips.