About this question

Chained PMR Resources

Hard · memory_optimization · Quant Developer interview question · c++17, memory-management, low-latency, data-structures, pmr, c++

In low-latency trading systems, dynamic memory allocation during the critical path can cause unacceptable latency spikes. To mitigate this, C++17 introduced Polymorphic Memory Resources (std::pmr) which allow developers to chain memory resources and create optimized allocation hierarchies. Implementing a tiered memory strategy—such as a front-line pool backed by a contiguous buffer and a system fallback—ensures deterministic performance for high-frequency order book operations. Task Implement t