About this question
Easy · memory_optimization · Quant Developer interview question · memory, allocator, free-list, low-latency, c++, data-structures
In high-frequency trading, predictable low-latency is critical, but standard memory allocation introduces unacceptable overhead. A free-list memory pool, or slab allocator, avoids this by managing a pre-allocated buffer of fixed-size blocks. This technique provides deterministic O(1) allocation and deallocation, eliminating OS calls and heap fragmentation on the critical path. Task Implement the FreeListPool class, a fixed-block memory allocator that operates on a caller-provided buffer. The co