返回题库

Quant Interview Practice Questions

专题
难度
L3
来源
MyntBit

题目详情

High-frequency trading systems often suffer from latency spikes due to frequent dynamic memory allocation during critical paths. A reference-counted object pool mitigates this by reusing objects, effectively eliminating new and delete overhead. By enforcing Last-In, First-Out (LIFO) reuse, the pool also maximizes cache locality for rapidly recycled trade objects. Task Build a generic ObjectPool<T> class in C++ that manages a pool of reusable objects. It should provide a std::shared_ptr<T> to an