Reviewed by Aditya Kumar · Last reviewed 2026-03-24
Rate limit = restrict requests per user per window. ALGORITHMS: (1) Token bucket—refill rate, consume per request; smooths bursts. (2) Sliding window—exact count in window; more accurate, more state. (3) Fixed window—simple but burst at boundaries. WHY: Protect backends, ensure...
Rate limit = restrict requests per user per window. ALGORITHMS: (1) Token bucket—refill rate, consume per request; smooths bursts. (2) Sliding window—exact count in window; more accurate, more state. (3) Fixed window—simple but burst at boundaries. WHY: Protect backends, ensure fair usage, cost control. IMPLEMENTATION: Redis for distributed state—INCR + EXPIRE (fixed); Lua script (sliding). SCALABILITY: Redis cluster for high throughput; per-user keys can cause hot partitions—shard by user_id hash. COST: Redis memory scales with users × window; consider in-memory for single-node APIs.
Red Flag: 'We use a library' without describing algorithm. Pro-Move: 'We use sliding window in Redis with Lua for atomicity; apply at API gateway; return Retry-After header; log for tuning—reduced abuse by 30%.'
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.