Design a Distributed Rate-Limiting Service
Company: Pinterest
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Online Assessment
Quick Answer: Design a distributed rate limiter for per-user, per-tenant, route, and global API policies under a tight latency budget. Make accuracy and availability trade-offs explicit across token algorithms, atomic counters, sharding, hot keys, local leases, bounded regional overshoot, partitions, and fail-open or fail-closed behavior.