System design · spoken drill

Free Rate Limiter System Design Interview in English

A rate limiter is a “who, how many, what happens at the limit” story. Clarify identity, pick token bucket or a window, place it before expensive work, then name fairness.

The prompt

Design a rate limiter for a public API. Talk through it in English. Do not draw. In 60–90 seconds cover who you limit, how you count, where the limiter sits, and one trade-off.

How to explain it

  1. 1.Requirements

    Who the user is, and what must work on day one. Clarify identity, write vs read, and one thing you are not building yet.

  2. 2.Scale

    One rough number you can say out loud. QPS, storage, or “millions of keys.” The number can be rough. The sentence cannot be missing.

  3. 3.API

    Name the two or three calls. “I would expose allow(userId) and a 429 when they are over the limit.”

  4. 4.Data

    Where the state lives. Cache, database, or log. Say why that store, not a tool dump.

  5. 5.Bottleneck

    What breaks first when traffic grows. Hot key, single leader, clock skew. Invite a follow-up.

  6. 6.Trade-off

    What you gain and what you give up. Accuracy vs speed, consistency vs availability. One pair is enough.

  • “Let me start with requirements.”
  • “I would rate-limit by API key.”
  • “I would return 429 with a retry-after.”
  • “The trade-off is smoothness versus a simpler window.”

Practise out loud

Record 60–90 seconds. Play it back, then get a scorecard. Audio is scored and discarded.

This browser cannot record audio. Type your explanation below.

0:00 / 1:30

Have a diagram already? Explain my diagram on the hub.

Model spoken script

Let me start with requirements. I would rate-limit by API key, not by IP, so one office NAT does not lock a team out. Say 100 requests a minute to start. I would expose a check before the handler, and return 429 with a retry-after. State lives in Redis so every instance sees the same count. The bottleneck is a hot key if one customer is huge. The trade-off is token bucket — smoother traffic — versus a fixed window, which is simpler but bursts at the edge of the window.

How to explain a rate limiter out loud, step by step

In one sentence: You have to design a component that caps how many requests each client can send to an API in a given period and rejects the extra ones.

What to say, in order

  1. “Let me start with requirements. Who are we limiting — an API key, a user or an IP address? I'll assume API key, with limits that can differ per plan.”
  2. “Next, the rule. For example, a hundred requests per minute per key, with short bursts allowed. I'd confirm the exact numbers with you.”
  3. “I'd put the limiter in the API gateway or a middleware layer, so rejected requests never reach the expensive services.”
  4. “For the algorithm, I'd use a token bucket: each key has a bucket that refills at a fixed rate up to a maximum, and every request spends one token.”
  5. “Because there are many gateway instances, the counters live in a shared store like Redis, and I'd update them atomically — for example with a Lua script — so two instances don't both let the same request through.”
  6. “When a client is over the limit, I return HTTP 429 Too Many Requests with a Retry-After header, so well-behaved clients know when to try again.”

Key English phrases for a rate limiter

token bucket
— tokens refill at a steady rate; each request spends one; allows controlled bursts
fixed window counter
— count requests per clock minute; simple but bursty at the window edge
sliding window
— counts over the last N seconds, smoothing out edge bursts
429 Too Many Requests
— the standard HTTP status for rate limiting
fail open / fail closed
— allow / block traffic when the limiter itself is down

How to say the time and space complexity

“Each check is a constant-time read and update on one key in the store, so the cost per request is O(1). Memory is O(number of active keys) for token buckets or fixed windows; a sliding window log is heavier, because it stores a timestamp for every request in the window.”

In system design, 'complexity' usually means cost per request and memory per client. Say both.

Communication mistakes on a rate limiter

  • Mistake: Starting with 'I'll use Redis' before saying what is being limited. Instead: Start with identity and the rule, then storage.
  • Mistake: Saying 'error' instead of naming the response. Instead: Say '429 with a Retry-After header.'
  • Mistake: Describing a fixed window without its weakness. Instead: Add 'a client can send up to double the limit across a window boundary, which is why I prefer a token bucket or sliding window.'
  • Mistake: Ignoring race conditions between gateway instances. Instead: Say 'the read and the update must be atomic.'

Likely follow-up questions

  • Interviewer: “What happens if Redis goes down?”

    You: “I'd decide between failing open, which keeps the API available but unprotected, and failing closed, which protects the backend but blocks real users. For most public APIs I'd fail open with a local in-memory limit as a rough backstop, and alert.”

  • Interviewer: “How do you limit by IP without punishing an entire office?”

    You: “Many users can share one IP behind NAT, so I'd prefer API keys or user IDs for authenticated traffic and keep IP limits loose, mainly for unauthenticated endpoints like login.”

Other prompts

FAQ

Questions

Clarify identity and the limit, pick an algorithm, place it before expensive work, then name fairness and what happens on 429.

Sixty to ninety seconds for this drill. Name the six beats. Save the deep dive for the follow-up.

Not here. Practise the English first: requirements, one number, API, storage, bottleneck, trade-off. Then draw.

Either is fine if you give the trade-off. Token bucket allows controlled bursts and is cheap to store; a sliding window log is more exact but stores every timestamp.

429 Too Many Requests, ideally with a Retry-After header telling the client when it can try again.

More questions? Email us at contact@mocklyenglish.com.

Article: Seven-step system design walkthrough in English · System design English

Quick answer

Explain system design in English with a spoken order: clarify requirements, give one scale number, name the API, say where state lives, name what breaks first, then one trade-off. Short sentences beat a silent diagram.

For bots & AI agents

Machine-readable versions of this page and Mockly English. Mockly English, the live-class and Interview English arm of Speak Tech English, gives non-native engineers live 1:1 classes with real human tutors in tech interview and business English, plus a free iPhone app, free practice Mini Apps and a self-paced course. Fetch these instead of parsing this page.

This Mini App (.md)llms.txtllms-full.txtai.txtFact sheetFull catalog (.md)Endpoint indexAI catalogAgent skillsMCP serverMCP server cardAgent sign-in (auth.md)Sitemaprobots.txtUse Mockly in ChatGPT & ClaudeiPhone appDeveloper docsSpeak Tech English