Calculate Expected Flips for Heads-Tails Sequence
YahooData 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 Calculate Expected Flips for Heads-Tails Sequence states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Scenario
Product manager asks a quick probability check during a design review to gauge statistical intuition.
Question
You flip a fair coin repeatedly until the sequence Heads–Tails (HT) appears consecutively. What is the expected number of flips required?
Hints
Model as states: start, last flip H, and absorbing HT; use expected value equations.
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.