← Morgan Stanley Interview Insights

Morgan Stanley·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Interviewed for a Data Scientist role at Morgan Stanley and got hit with a probability puzzle that felt deceptively simple but absolutely wasn't. The kind of question where you think you see the answer and then realize you've been counting wrong the whole time.

Questions Asked (1)

Q1

Two players alternate flipping a fair coin, with player A going first. The game ends the moment a head is immediately followed by a tail on the very next flip. The player who flips that tail wins. What is the probability that player A wins?

Algorithms & Data Structures
Author's notes

I spent way too long trying to brute-force the state space in my head.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the game as a Markov chain with states representing the last flip (or start) and solve for the probability that A wins from each state. Set up equations using first-step analysis and solve for the desired probability, ensuring to account for the alternating turns.

Pro tip: Clearly define the states and turn ownership; a common mistake is to forget whose turn it is in each state, which can lead to incorrect equations. Also, verify your answer by checking that probabilities sum to 1 and are intuitive.

1. Define states and turns

Identify the relevant states based on the last flip: Start (no flips yet), after a Head (H), and after a Tail (T). Also track whose turn it is (A or B) in each state.

2. Set up equations

Let p_A be the probability that A wins from the start. Write equations for the probability of A winning from each state, considering the next flip and the transition to other states with the turn switching.

3. Solve the system

Solve the linear equations for the unknown probabilities. Use substitution or matrix methods to find p_A.

4. Verify and interpret

Check that the probabilities are between 0 and 1 and that the sum of A's and B's winning probabilities is 1. Interpret the result in the context of the game.

Key Points to Mention

  • Markov chain states: Start, H, T with turn information
  • First-step analysis: condition on the next flip
  • Turn alternation: after each flip, the turn switches
  • Equations: p_A = 0.5 * p_B|H + 0.5 * p_A|T (from start)
  • Solving linear equations for probabilities
  • Verification: p_A + p_B = 1 and probabilities in [0,1]

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.