Cascadiq

Design a Rate Limiter

project · Level 2 · 35 min

Description

Design and implement a simple rate limiter: given a user/key and a limit (e.g. 100 requests per minute), return whether the request is allowed or throttled.

Requirements

  • Support configurable limit and window (e.g. per minute)
  • Per-key (or per-user) counting
  • Return allowed vs throttled

Constraints

In-memory is fine. Explain how you would scale to multiple servers.

Deliverables

Code for the rate limiter plus a short note on distributed rate limiting.

Tags

System DesignBackendScalability