Find expected tosses to see a coin pattern

Quick Overview

Assesses probabilistic reasoning and stochastic-process modeling skills, focusing on expected stopping times for pattern occurrences in repeated independent trials and related concepts like state-space representation and overlap effects.

Find expected tosses to see a coin pattern

Company: Bnp

Role: Data Scientist

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

A fair coin is tossed repeatedly until a target length-3 pattern appears as a **consecutive** substring (e.g., HHH, HTH, HTT, etc.). 1) Describe a general method to compute the expected number of tosses to see a given pattern. 2) Compute the expected number of tosses for **HHH** and for **HTH**.

Overview: Assesses probabilistic reasoning and stochastic-process modeling skills, focusing on expected stopping times for pattern occurrences in repeated independent trials and related concepts like state-space representation and overlap effects.

|Home/Software Engineering Fundamentals/Bnp
Bnp logo
Bnp
Jan 5, 2026
easyData ScientistTechnical ScreenSoftware Engineering Fundamentals
2
0

A fair coin is tossed repeatedly until a target length-3 pattern appears as a consecutive substring (e.g., HHH, HTH, HTT, etc.).

  1. Describe a general method to compute the expected number of tosses to see a given pattern.
  2. Compute the expected number of tosses for HHH and for HTH .
Loading comments...