返回题库

Quant Interview Practice Questions

专题
architecture & logic
难度
L2
来源
MyntBit

题目详情

In high-frequency trading systems, exchange gateways impose strict rate limits to prevent malicious or runaway algorithms from overwhelming the matching engine. A sliding window rate limiter provides a precise mechanism to enforce message limits over a rolling time window, ensuring compliance with exchange rules. Task Implement a RateLimiter class to enforce a sliding window rate limit. The class must include the following methods:

  • RateLimiter(int window_size_ms, int max_requests): Initialize