About this question
Medium · architecture & logic · Quant Developer interview question · algorithms, system design, rate limiting, cpp
High-frequency trading systems utilize rate limiters to adhere to exchange protocols and prevent order rejection or penalties. The Token Bucket algorithm is a standard mechanism for this purpose, allowing for controlled burstiness while enforcing an average transmission rate. This approach ensures that order flow remains compliant with exchange limits by managing a finite supply of transmission tokens. Task Implement a token bucket rate limiter to process a stream of order requests. Given a buc