About this question

Latency Histogram

Medium · architecture & logic · Quant Developer interview question · systems, performance, c++

High-frequency trading systems require precise latency monitoring on the critical path without incurring garbage collection overhead or dynamic memory allocation costs. A fixed-width histogram enables efficient, zero-allocation data recording to track performance distributions and calculate percentiles during intense market activity. Task Implement a LatencyHistogram class to record latency measurements into pre-allocated buckets and calculate percentiles. The class must support initialization