Ctrl K
Course · step 22 of 26Back to stepNext
Backend · Mid-level · System design

Design a rate limiter for a public API: for example, no more than 100 requests per minute per API key. The service runs on several instances.

~10 min by voice

How to approach it

This checks whether the candidate can design a distributed component: choose an algorithm and understand its trade-offs, move state into a shared store, make updates atomic, and think through behavior on failures and when the limit is exceeded.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsWrite a thread-safe RateLimiter class: the constructor takes how many requests per second are allowed, and the tryAcquire method, without waiting, returns true if the request can be let through and false if the limit is exhausted. It will be called concurrently from many threads. SeniorСпроектируйте сервис переводов по номеру телефона между клиентами банка: от нажатия кнопки «Перевести» до зачисления денег получателю. SeniorWrite a rate limiter for an API using the token bucket algorithm: an allow function takes a client identifier and returns whether its request can go through. Each client has a bucket capacity and a token refill rate per second, and the limiter itself is called from many threads at once. SeniorWalk me through how you structure your answer in a system design interview: where do you start, what questions do you ask, and how do you estimate the load? Mid-levelExplain the cache-aside strategy: how data is read and written, how you deal with stale data, and what happens when lots of keys expire at once. Mid-level

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~10 min