Quant Interview Practice Questions
题目详情
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