Ctrl K
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Как вы выстроите защиту API, через которое мобильное приложение получает данные о счетах клиента, — на всём пути от приложения до базы? SeniorСпроектируйте сервис переводов по номеру телефона между клиентами банка: от нажатия кнопки «Перевести» до зачисления денег получателю. SeniorСпроектируйте сервис лимитов: у клиента есть дневные и месячные лимиты на переводы и снятия наличных, и каждую операцию нужно проверить до проведения. SeniorDesign a search bar with autocomplete for a large marketplace: from typing a character to displaying the suggestions. Senior

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