Percentile Estimator: p50, p95, p99
Xem dạng PDF
Gửi bài giải
Điểm:
100,00
Giới hạn thời gian:
2.0s
Giới hạn bộ nhớ:
256M
Tác giả:
Dạng bài
Ngôn ngữ cho phép
Python
Task
Given n latency values, compute the p50, p95, and p99 percentiles using linear interpolation (NumPy default).
Input
- Line 1: integer
n - Line 2:
nspace-separated floats (latencies in ms, unsorted)
Output
Three space-separated floats: p50 p95 p99
Example
Input:
10
10 20 15 30 25 50 100 12 18 22
Output:
21 68.5 95.5
Scaffolding
def percentile_estimates(x: list[float]) -> tuple: ...
Notes
Track M: use numpy.percentile(x, q) with default interpolation. Derive why p99 > mean for right-skewed latency distributions — p99 catches tail latency that mean hides.
Bình luận