Measure fan-out amplification and the value of hedging
CodingIntermediate⏱ 1 hourAI Systemsfan-outtail latencyhedgingorder statisticssimulation
Problem
Quantify what fan-out does to a tail, and what a hedged request buys back.
required_child_quantile(n, p)andparent_tail(n, child_tail)— the closed forms.simulate_max_quantile(n, mean, p, trials, seed)— the empirical -quantile of the maximum of exponential latencies.hedged_samples(mean, d, trials, seed)— latencies when a duplicate attempt starts at delay and the first response wins.hedge_extra_load(p)— expected attempts per logical request when hedging at the -quantile.
Then confirm that the simulated hedged tail matches for .
Implement it, then check the implementation against something you can verify independently.
Write it
Solve it here9 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 90s · draft saved in this browser
9 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.
Hints
Hints — 0 of 2 revealed
Solution
Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.
Related problems
All problems| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| Budget a latency target across a fan-out | AI Systems | Numerical | 15 min | ||
| Simulate distance contrast run | Classical ML | Coding | 30 min | ||
| Balls into bins, with one choice and with two run | AI Systems | Coding | 1 hour | ||
| Cache hit rates under Zipf popularity run | AI Systems | Coding | 1 hour | ||
| Measure anisotropy in an embedding space run | RAG | Coding | 1 hour |