Design Per-App Graph API Rate Limits With Business Use Case Quotas

Last updated: November 29, 2026

Quick Overview

Design the rate limiting layer for Meta's Graph API so each third-party app and each business use case (ads, pages, Instagram) gets its own call quota, with headers that tell developers how close they are to the limit.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the rate limiting layer for Meta's Graph API so each third-party app and each business use case (ads, pages, Instagram) gets its own call quota, with headers that tell developers how close they are to the limit.

This appears in Meta's product-infrastructure system design rounds because the Graph API serves millions of apps with very different traffic shapes. The interviewer checks whether you can key limits on the right dimensions (app, user, business, endpoint), keep the check off the hot path's latency budget, and communicate usage to developers.

What the Interviewer Expects
  • Choose limit keys (app id, app plus user token, business id plus use case) and justify each
  • Pick an algorithm such as sliding window or token bucket and explain the trade-off
  • Keep the limiter check under a few milliseconds at very high QPS
  • Return usage headers and clear error codes so developers can back off
  • Handle multi-region counting without a global lock
Key Topics to Cover
token bucket
sliding window counters
usage headers
multi-tenant quotas
regional counting
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How would you let a large partner temporarily burst above their quota during a launch?
  • What changes if limits must be cost-weighted, where some endpoints are 10x more expensive?
  • How do you prevent one app from exhausting a shared user-level quota for other apps?
  • How would you roll out a tighter limit without breaking existing integrations?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: enforce call budgets per app, per app-user pair, and per business use case (for example Marketing API calls scale with ad spend tier). Return X-App-Usage style headers with percent o...

High-Level Design

Requests hit the API gateway (the PHP/Hack web tier). Before dispatching, the gateway computes a set of limit keys and calls a local limiter agent on the host. The agent keeps in-memory token buck...


Submit Your Answer
Markdown supported