InterviewDB Question

Tokens - Implement a Token Bucket Rate Limiter

Question Details

Round 1 - Coding / OOD Problem Implement a token bucket rate limiter. Each bucket refills at a constant rate (tokens per second) up to a maximum capacity. A request consumes one token; if the bucket is empty the request is rejected. Example Follow-ups How do you make this thread-safe for concurrent requests? How do you implement a per-user rate limiter using a dict of buckets with LRU eviction? How does token bucket differ from a leaky bucket and sliding window algorithms? How would you distribu…

Full Details

🔒

Unlock all Flexport questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a flexport interview during the phone round.

It covers the following topics: Sliding Window, Coding, Phone, Onsite .