KatInterview

Picking a Retry Cap for Flaky Audio Streaming

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentssurvival-analysisexperimentationcensoring

Last updated

Use logged interruption events to pick a maximum retry count that balances playback recovery against battery cost, and explain how to correct for bias and validate the choice before launch.

You are on the team that owns audio playback for a mobile streaming app. While a track is playing, the connection sometimes drops. Two situations look identical at first:

  • Transient drop: a few more reconnect attempts would restore the stream.
  • Real outage: no connectivity is available, and every extra attempt just wakes the radio and drains the battery.

You have a historical log with one row per interruption event:

ColumnTypeMeaning
retry_countintegerHow many reconnect attempts were made before the event closed.
is_successbooleanWhether the app ultimately reconnected and received audio data.

Product wants a single cap T: the app retries at most T times and then stops and shows a graceful failure state.

Question. How would you use this log to choose a good value of T? In your answer, cover:

  1. How you interpret each row and which quantity you estimate.
  2. The metrics and the objective, including the reliability vs. battery trade-off.
  3. The statistical method, including uncertainty.
  4. Biases and limitations in the historical data.
  5. How you would validate the choice before a full rollout.

Hints

Hint 1

Think about what a row with is_success = false really tells you: you know the event lasted at least that many retries, but not whether the next one would have worked. How does that change the way you estimate recovery by retry number?

Hint 2

Frame the choice as a marginal one: at retry k, what is the chance the next attempt succeeds given all earlier ones failed, and is that chance worth the extra battery cost? Consider both a cost-per-recovery rule and a constrained 'near-max recovery within a battery budget' rule.

Hint 3

The log only reflects whatever cap the app used before. Ask what that implies for any T above the old cap, whether retry count is a good stand-in for elapsed time, and what randomized experiment and guardrail metrics you would run to confirm the answer.