Design a distributed rate limiter for Google Cloud APIs
by zenith2608
58
332
Got asked to design a rate limiter that works across multiple data centers. The interviewer was pretty chill and let me drive the conversation.
Started with clarifying requirements. They wanted something that could handle 10M+ requests per second globally. I talked about using a sliding window approach with Redis clusters in each region.
The tricky part was synchronization between regions. I proposed eventual consistency with a gossip protocol for sharing rate limit counters. The interviewer pushed back on this and asked about edge cases where a user could exploit the delay between syncs.
Ended up discussing a hybrid approach: local rate limiting with a global backstop. Each region enforces its own limit at 80% of the quota, and a centralized service handles the remaining 20% for overflow.
Overall went well. The interviewer seemed satisfied with the tradeoffs discussion. Got the offer about 2 weeks later.