PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Morgan Stanley

Compute win probability in coin-toss game

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of probability theory and stochastic processes, focusing on win probability in an alternating coin-toss game and reasoning about pattern occurrence and stopping times in random sequences.

  • easy
  • Morgan Stanley
  • Coding & Algorithms
  • Data Scientist

Compute win probability in coin-toss game

Company: Morgan Stanley

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Two players, A and B, play the following game with a fair coin: - They toss the coin alternately: A tosses first, then B, then A, then B, and so on. - The sequence of results (H for heads, T for tails) is recorded in order. - The game ends as soon as the subsequence "HT" (a head immediately followed by a tail on the next toss) appears for the first time. - The person who tosses the **tail** in this first "HT" subsequence wins the game. Assuming the coin is fair and the game continues indefinitely until it ends, what is the probability that player A wins the game?

Quick Answer: This question evaluates understanding of probability theory and stochastic processes, focusing on win probability in an alternating coin-toss game and reasoning about pattern occurrence and stopping times in random sequences.

Related Interview Questions

  • Implement Factorial and Squares - Morgan Stanley (medium)
  • Compute maximum non-overlapping meetings - Morgan Stanley (medium)
  • How do you escape the circle? - Morgan Stanley (medium)
  • Count decodings of a digit string - Morgan Stanley (Medium)
  • Compute minimal cost to merge numbers - Morgan Stanley (Medium)
Morgan Stanley logo
Morgan Stanley
Oct 21, 2025, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
2
0

Two players, A and B, play the following game with a fair coin:

  • They toss the coin alternately: A tosses first, then B, then A, then B, and so on.
  • The sequence of results (H for heads, T for tails) is recorded in order.
  • The game ends as soon as the subsequence "HT" (a head immediately followed by a tail on the next toss) appears for the first time.
  • The person who tosses the tail in this first "HT" subsequence wins the game.

Assuming the coin is fair and the game continues indefinitely until it ends, what is the probability that player A wins the game?

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Morgan Stanley•More Data Scientist•Morgan Stanley Data Scientist•Morgan Stanley Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,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.