← Optiver Interview Insights

Optiver·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Optiver Data Scientist interview with a probability/statistics problem that looks deceptively clean but has a real bite to it once you start working through the gap distribution. The follow-ups were no joke either.

Questions Asked (5)

Q1

Buses on a route are scheduled every x minutes. Each bus independently arrives on time with probability 1/2, or exactly x/2 minutes late with probability 1/2. You arrive at the stop at a uniformly random time. What is your expected waiting time in terms of x?

Algorithms & Data StructuresProduct Analytics & Metrics
Author's notes

I went straight for the naive E[G]/2 and felt pretty good about it for a moment.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the bus arrival process as a renewal process where interarrival times are either x or 3x/2 with equal probability. Use the inspection paradox to compute the expected waiting time as the ratio of the second moment to twice the first moment of the interarrival time distribution.

Pro tip: Explicitly state that you are using the inspection paradox and that the expected waiting time is not simply half the mean interarrival time. This shows you understand the subtlety and can avoid the common trap.

1. Define the interarrival time distribution

Let the time between consecutive buses be T. Since each bus is independently late by 0 or x/2 with equal probability, T can be x (if both on time or both late) or 3x/2 (if one on time and one late). Compute the probabilities: P(T=x)=1/2, P(T=3x/2)=1/2.

2. Compute the first and second moments

Calculate E[T] = (1/2)x + (1/2)(3x/2) = 5x/4. Calculate E[T^2] = (1/2)x^2 + (1/2)(9x^2/4) = 13x^2/8.

3. Apply the inspection paradox formula

For a renewal process, the expected waiting time for a randomly arriving passenger is E[T^2]/(2E[T]). Plug in the moments: (13x^2/8) / (2 * 5x/4) = (13x^2/8) / (5x/2) = (13x^2/8) * (2/(5x)) = 13x/20.

4. Verify with an alternative method (optional)

If time permits, confirm by conditioning on the state of the previous bus and using the memoryless property of the uniform arrival time. This can catch errors and demonstrate thoroughness.

Key Points to Mention

  • The interarrival times are not constant; they follow a two-point distribution.
  • The inspection paradox: a randomly arriving passenger is more likely to land in a longer interval.
  • The formula for expected waiting time in a renewal process: E[T^2]/(2E[T]).
  • The correct calculation of E[T] and E[T^2] from the distribution.
  • The final answer: 13x/20.
  • The common mistake of assuming the expected waiting time is half the mean interarrival time (which would give 5x/8).

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

Q2

How does your answer change if each bus's delay is uniform on [0, x/2] instead of the binary on-time or x/2-late setup?

Algorithms & Data Structures
Author's notes

Didn't get to fully work this out under pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the original problem setup and the binary delay model, then explain how replacing it with a continuous uniform distribution changes the expected waiting time and variance. Use linearity of expectation and the properties of the uniform distribution to derive the new expected delay, and discuss the implications for the overall system.

Pro tip: Show that you can generalize the solution by considering the distribution of the sum of delays and applying the Central Limit Theorem for large numbers of buses, which demonstrates deeper statistical insight.

1. Clarify the original model

Restate the original problem: each bus is either on time (delay 0) or late by x/2 with some probability. Identify the expected delay and variance in that case.

2. Define the new distribution

State that now each bus's delay is uniformly distributed on [0, x/2]. Compute the mean and variance of a single bus's delay: mean = x/4, variance = (x/2)^2 / 12 = x^2 / 48.

3. Compute the new expected total delay

For n buses, the expected total delay is n * (x/4) by linearity of expectation. Compare this to the original expected total delay (which was n * (x/2) * p, where p is the probability of being late).

4. Analyze variance and distribution

The variance of the total delay is n * x^2 / 48. For large n, the total delay is approximately normally distributed by the CLT. Discuss how this affects the probability of exceeding a threshold.

5. Discuss implications and edge cases

Consider how the change affects the worst-case delay (now bounded by n*x/2 instead of possibly n*x/2 if all late) and the shape of the distribution. Mention that the uniform assumption may be more realistic for continuous delays.

Key Points to Mention

  • Linearity of expectation: expected total delay is n times the expected single-bus delay.
  • Mean and variance of a uniform distribution on [0, x/2]: mean = x/4, variance = x^2/48.
  • Comparison with the binary model: if the binary model had probability p of delay x/2, the expected delay per bus is p*x/2; setting p=1/2 gives the same mean as the uniform case.
  • Central Limit Theorem: for many buses, the total delay is approximately normal, enabling probabilistic statements.
  • The uniform model has lower variance than a binary model with the same mean (if p=1/2), because the uniform distribution spreads the delay continuously.
  • Practical implication: the uniform model may better capture real-world variability in bus delays.

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

Q3

Generalize: if a bus is late by d minutes with probability p and on time otherwise (with d < x), what is the expected wait as a function of x, p, and d?

Algorithms & Data Structures
Author's notes

This one I actually liked.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem setup: a bus arrives either d minutes late with probability p or on time with probability 1-p, and you arrive at a random time. Then compute the expected wait by conditioning on the bus state: if on time, expected wait is x/2; if late, expected wait is x/2 + d. Combine using linearity of expectation to get E[wait] = x/2 + p*d.

Pro tip: Always state your assumptions explicitly (e.g., uniform arrival time, independence) and sanity-check the result with edge cases like p=0, p=1, or d=0. This shows rigor and prevents miscommunication.

1. Clarify the scenario

Confirm that you arrive at a uniformly random time within the interval [0, x] and that the bus's lateness is independent of your arrival time. Define the bus's arrival time as either 0 (on time) or d (late).

2. Compute conditional expected waits

If the bus is on time (prob 1-p), your wait is uniform on [0, x], so expected wait = x/2. If the bus is late by d (prob p), your wait is uniform on [d, x+d], so expected wait = x/2 + d.

3. Apply law of total expectation

Combine the conditional expectations: E[wait] = (1-p)*(x/2) + p*(x/2 + d) = x/2 + p*d.

4. Sanity-check and interpret

Verify that when p=0, E[wait] = x/2; when p=1, E[wait] = x/2 + d; and when d=0, E[wait] = x/2. Discuss how the expected wait increases linearly with both p and d.

Key Points to Mention

  • Assumption of uniform arrival time within the interval [0, x].
  • Independence between bus lateness and your arrival time.
  • Conditional expectation: E[wait | on time] = x/2, E[wait | late] = x/2 + d.
  • Law of total expectation: E[wait] = (1-p)E[wait|on time] + pE[wait|late].
  • Final formula: E[wait] = x/2 + p*d.
  • Edge cases: p=0, p=1, d=0, and d < x ensures no overlap issues.

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

Q4

Using your gap-based formula, explain intuitively why irregular headways always increase a random rider's expected wait, even when the mean headway stays the same.

Product Analytics & MetricsTechnical Trade-offs
Author's notes

Jensen's inequality basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the gap-based formula for expected wait time, then intuitively explain how irregular headways increase the probability of longer waits. Use a simple example with two buses to illustrate the convexity effect, emphasizing that the average wait is driven by the second moment of headways.

Pro tip: Connect the concept to the inspection paradox: riders are more likely to arrive during longer gaps, which disproportionately increases their expected wait. This shows deep understanding and practical relevance.

1. Define the gap-based formula

State that for a random rider, expected wait time is E[H^2] / (2 E[H]), where H is the headway. This formula assumes random arrival and independent headways.

2. Explain the role of variance

Show that for a fixed mean E[H], increasing variance (irregularity) increases E[H^2], which in turn increases the expected wait. This is because the function is convex.

3. Illustrate with a simple example

Use two buses with headways alternating between 0 and 2m (mean 1m) versus constant 1m. Compute expected waits: irregular gives 1m, regular gives 0.5m, demonstrating the increase.

4. Connect to the inspection paradox

Explain that riders are more likely to arrive during longer gaps, so their wait is biased toward longer headways, further increasing the average wait.

5. Conclude with implications

Summarize that even with the same mean headway, irregularity always increases expected wait, highlighting the importance of consistency in service frequency.

Key Points to Mention

  • Expected wait time formula: E[H^2] / (2 E[H])
  • Convexity of the square function: variance increases E[H^2]
  • Inspection paradox: riders disproportionately arrive during longer gaps
  • Example with alternating headways (0 and 2) vs constant (1)
  • Implication: regularity reduces average wait for the same mean headway
  • Assumption of random arrival and independent headways

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

Q5

How would the expected wait change if buses arrived as a Poisson process with mean headway x instead of the scheduled setup?

Algorithms & Data Structures
Author's notes

Memoryless property means the expected wait is just x regardless of when you show up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the scheduled setup: if buses arrive exactly every x minutes, the average wait is x/2. Then, for a Poisson process with rate 1/x, use the memoryless property to show the wait time is exponential with mean x. Conclude that the expected wait doubles from x/2 to x.

Pro tip: Emphasize that this is the inspection paradox: random arrivals make you more likely to land in a longer gap, increasing average wait. This shows you understand the practical implications beyond the math.

1. Clarify the scheduled scenario

Assume buses arrive exactly every x minutes. A passenger arriving at a random time waits uniformly between 0 and x, so expected wait is x/2.

2. Define the Poisson process

Buses arrive as a Poisson process with rate λ = 1/x, so interarrival times are exponential with mean x.

3. Apply memorylessness

Due to the memoryless property, the waiting time from a random arrival until the next bus is also exponential with mean x.

4. Compare expected waits

The expected wait increases from x/2 to x, i.e., it doubles.

5. Explain the intuition

This is the inspection paradox: random arrivals are more likely to occur during longer gaps, raising the average wait.

Key Points to Mention

  • Scheduled setup: deterministic headway x, average wait x/2.
  • Poisson process: interarrival times ~ Exponential(mean x).
  • Memoryless property: wait time from random arrival is Exponential(mean x).
  • Expected wait doubles from x/2 to x.
  • Inspection paradox: random arrivals bias toward longer gaps.
  • Assumption: passenger arrival time is independent and uniformly random.

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