Design a Distributed Rate Limiter
A rate limiter counts the requests each caller makes and turns away the ones over its limit. In this version the callers are other services. Orders calls Inventory to reserve stock, and Risk calls Payments to check a charge. Those calls go over HTTP or gRPC, a widely used framework for calls between services. The limiter sits in the path and makes sure no caller takes more than its share of a backend API. At Apple this prompt comes up on backend and services teams, as a 45-minute phone-screen design and as a 45 to 60 minute onsite round. It shows up mostly at ICT3, Apple's mid level, plus some senior loops, and often on teams in Hyderabad. That's earlier than most Apple distributed design, which tends to start at ICT4, so mid-level candidates shouldn't skip it. The product is small. What makes it hard is holding one limit across dozens of servers without slowing every call down, and without the limiter becoming the reason Payments goes offline.
ApplePremium lesson · System design round
The Apple design, worked end to end.
- The API and data modelSystem design · Signature problem
- The design, drawn out2 diagrams
- 6 deep divesWith the tradeoffs
$49 a year · all 107 companies · instant access
387 Apple interview reports · guide updated
Apple interview guideKnow what Apple asks before you walk in.
22 coding · 6 system design · 30 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.