Calculate Expected Streaks in Coin Toss Sequence
UpstartData Scientist · OnsiteLast updated
Calculate Expected Streaks in Coin Toss Sequence evaluates statistical assumptions, formulas, estimation strategy, uncertainty, edge cases, and interpretation in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Scenario
Tech interview round 1 – probability puzzle about streaks
Question
We toss a fair coin 1,000 times. Each time the outcome differs from the previous toss, a new streak begins (the first toss also starts a streak). What is the expected number of streaks? Generalise the expected streak count when the coin shows heads with probability p.
Hints
Indicator for change between toss i and i+1; linearity of expectation.
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.