Design a Rate Limiter

medium
algorithms
caching
distributed-systems

Problem brief

A rate limiter caps how many requests a client (a user, an API key, an IP) can make in a given time window, rejecting or delaying the rest. The mechanics are simple to describe but the interesting decisions are all in the details: which algorithm, where it lives in the request path, and how it stays correct and fast when there's more than one server enforcing the limit.

Practice workspace

Guided practice or a locally saved 45-minute mock.

Step 1 of 8

Functional Requirements

What does the rate limiter need to decide on every request, and what should happen to a request that's over the limit?

Reference solution hidden

Try answering in the workspace above first. Reveal the full worked solution — data model, architecture, and trade-offs — whenever you want to compare.

Open the full solution page →