返回题库

Quant Interview Practice Questions

专题
concurrency
难度
L2
来源
MyntBit

题目详情

High-frequency trading and market data processing systems often rely on producer-consumer queues to pass messages, such as market ticks or order updates, between threads. A bounded queue prevents memory exhaustion and provides natural back-pressure to producers when downstream consumers cannot keep up with the message rate. Task Implement a thread-safe bounded queue in C++ that processes double values. Your class BoundedQueue must provide the following methods:

  • BoundedQueue(int capacity): Ini