PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Statistics & Math/LinkedIn

Derive expectation for two consecutive heads

Last updated: Mar 29, 2026

Quick Overview

This question evaluates mastery of probability theory and stochastic processes, specifically expectation and variance calculations, Markov-chain or recurrence reasoning, and pattern waiting times in Bernoulli trials relevant for a Data Scientist role.

  • medium
  • LinkedIn
  • Statistics & Math
  • Data Scientist

Derive expectation for two consecutive heads

Company: LinkedIn

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

Let T be the number of fair coin flips until the pattern HH (two consecutive heads) appears for the first time. (a) Derive E[T] using a state-based recursion or Markov-chain argument and give the exact numeric value. (b) Generalize E[T] for a biased coin with P(H) = p (0 < p < 1). (c) For the fair coin, derive Var(T). State all steps and justify your recurrence setup.

Quick Answer: This question evaluates mastery of probability theory and stochastic processes, specifically expectation and variance calculations, Markov-chain or recurrence reasoning, and pattern waiting times in Bernoulli trials relevant for a Data Scientist role.

Related Interview Questions

  • Derive mean and variance of x̄ - LinkedIn (medium)
  • Sketch distributions and compare mean/median/mode - LinkedIn (easy)
  • Choose better bank queue and describe distributions - LinkedIn (easy)
  • Compare queues and interpret distributions - LinkedIn (medium)
  • Measure Causal Impact of Self-Selected App Redesign - LinkedIn (hard)
LinkedIn logo
LinkedIn
Oct 13, 2025, 9:49 PM
Data Scientist
Technical Screen
Statistics & Math
4
0

Waiting Time Until First HH (Two Consecutive Heads)

Setup

Let T be the number of coin flips required until the pattern HH (two consecutive heads) appears for the first time. Assume independent flips.

Tasks

(a) For a fair coin, derive E[T] using a state-based recursion (or an equivalent Markov-chain argument) and give the exact numeric value.

(b) Generalize E[T] for a biased coin where P(H) = p with 0 < p < 1.

(c) For the fair coin, derive Var(T). Show your recurrence setup and solution steps clearly.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More LinkedIn•More Data Scientist•LinkedIn Data Scientist•LinkedIn 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.