Expected Hours Until Two Consecutive Surge Hours

Last updated: November 29, 2026

Quick Overview

Each hour, an area is independently in surge with probability p. What is the expected number of hours until you first observe two surge hours in a row? Solve for p = 1/2 and in general.

Uber
Statistics & Math
Data Scientist
Uber
November 29, 2026
Data Scientist
Onsite
Statistics & Math
Hard

0

0

0 solved


Each hour, an area is independently in surge with probability p. What is the expected number of hours until you first observe two surge hours in a row? Solve for p = 1/2 and in general.

Markov chain expectations are a staple of harder Uber statistics rounds, and the pattern-waiting framing comes up when reasoning about streaks in marketplace states. The interviewer checks state definitions, first-step analysis and a sanity check by simulation.

What the Interviewer Expects
  • Define states by the length of the current surge streak
  • Write first-step equations
  • Solve for p = 1/2 to get 6
  • Derive the general formula (1 + p) / p^2
  • Validate with a quick simulation
Key Topics to Cover
Markov chains
first-step analysis
expected waiting time
pattern matching
simulation
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What is the expected wait for surge then no surge (SN) instead?
  • Why do SS and SN have different waiting times with the same probability?
  • How would autocorrelation between hours change the answer?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Hours are independent, P(S)=pP(S) = p, P(N)=q=1−pP(N) = q = 1 - p. We count hours until the second consecutive S is observed, including it....

Approach

States: E0E_0 = expected remaining hours when the last hour was N (or at start); E1E_1 = expected remaining hours when the last hour was S (streak of 1).

E0=1+pE1+qE0E_0 = 1 + p E_1 + q E_0

$E_1 = 1 + p \cdot...


Submit Your Answer
Markdown supported