Algorithm · Airtable · Medium
Design a class that maintains an efficient histogram-based approximation of percentiles for streaming numeric metrics. A metric is a named sequence of non‑negative measurements (e.g., response times). The n‑th percentile of a metric is the value below which n percent of all reported measurements fall. Instead of storing every measurement, you will group values into fixed‑width buckets and use bucket counts to estimate the requested percentile when asked. Estimating a…