PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Statistics & Math/Upstart

Analyze HT vs HH stopping-time probabilities

Last updated: Apr 20, 2026

Quick Overview

This question evaluates understanding of discrete probability, stopping-time analysis, pattern occurrence in Bernoulli sequences, derivation of PMFs and expectations, and the ability to generalize results to biased coins.

  • medium
  • Upstart
  • Statistics & Math
  • Data Scientist

Analyze HT vs HH stopping-time probabilities

Company: Upstart

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

We repeatedly flip a fair coin until either the pattern HT appears (A wins) or the pattern HH appears (B wins), whichever occurs first. Ties cannot occur. 1) Compute P(A wins) and P(B wins) exactly. 2) For m ≥ 2, derive the probability mass function of the stopping time: P(A wins at flip m) and P(B wins at flip m). 3) Compute the expected stopping time E[T]. 4) Extend part (1) to a biased coin with P(H)=p and provide closed-form expressions for P(A wins) and P(B wins). 5) Validate your results by simulation (≥ 10^6 trials) and compare empirical PMFs to theory.

Quick Answer: This question evaluates understanding of discrete probability, stopping-time analysis, pattern occurrence in Bernoulli sequences, derivation of PMFs and expectations, and the ability to generalize results to biased coins.

Related Interview Questions

  • Correct length-biased sampling from family-size survey - Upstart (easy)
  • Compute decay, OLS, and classic probability results - Upstart (easy)
  • Solve core probability/statistics mini-problems - Upstart (medium)
  • Combine noisy thermometers; compute random-walk correlations - Upstart (easy)
  • Solve drunk-passenger probability and simulate outcome - Upstart (medium)
Upstart logo
Upstart
Oct 13, 2025, 9:49 PM
Data Scientist
Technical Screen
Statistics & Math
6
0

Coin-Flip Stopping Game: HT vs HH

You repeatedly flip a coin until either the pattern HT appears (Player A wins) or the pattern HH appears (Player B wins), whichever occurs first. These are evaluated on the last two consecutive flips; ties cannot occur because only one ordered pair can appear at a time.

Assume the coin is fair unless otherwise stated.

  1. Compute P(A wins) and P(B wins) exactly for a fair coin.
  2. For m ≥ 2, derive the probability mass function (PMF) of the stopping time by outcome: P(A wins at flip m) and P(B wins at flip m).
  3. Compute the expected stopping time E[T].
  4. Generalize part (1) to a biased coin with P(H) = p (so P(T) = 1 − p = q). Provide closed-form expressions for P(A wins) and P(B wins).
  5. Validate by simulation with at least 10^6 trials and compare empirical PMFs to the theoretical results.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More Upstart•More Data Scientist•Upstart Data Scientist•Upstart Statistics & Math•Data Scientist Statistics & Math
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.