Calculate Expected Flips for Heads-Tails Sequence

Quick Overview

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.

Calculate Expected Flips for Heads-Tails Sequence

Company: Yahoo

Role: Data Scientist

Category: Statistics & Math

Difficulty: easy

Interview Round: Technical Screen

##### 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.

Overview: 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.

|Home/Statistics & Math/Yahoo
Yahoo logo
Yahoo
Aug 4, 2025
easyData ScientistTechnical ScreenStatistics & Math
2
0

Calculate Expected Flips for Heads-Tails Sequence

Probability Check — Waiting Time for HT

Setup

  • You repeatedly flip a fair coin (independent flips; P(H)=P(T)=1/2).
  • Stop as soon as the consecutive pattern HT appears for the first time.

Question

What is the expected total number of flips required until HT first appears?

Hint: Model states as Start (no useful last flip), H (last flip was H), and an absorbing state (HT seen). Set up and solve expected-value equations.

Clarifying Questions to Ask Guidance

  • Clarify the random variables, distributional assumptions, independence assumptions, and desired output.
  • Show enough derivation for the interviewer to follow the reasoning.
  • Explain how you would validate the result with simulation or sensitivity checks.

What a Strong Answer Covers Guidance

  • A correct setup with definitions, formulas, and boundary conditions.
  • A step-by-step derivation or estimation plan.
  • Interpretation of the result, including uncertainty and practical limitations.
  • Checks for assumptions, edge cases, and numerical stability.

Follow-up Questions Guidance

  • How would the result change if the assumptions were relaxed?
  • Can you verify the answer with a simulation?
  • What is the most likely source of estimation error?
Loading comments...