Syllabus
Interview walkthrough: clarify the prompt, design Strategy + Manager, implement algorithms, then harden for concurrency and multi-instance.
The interview
The prompt lands. Clarify requirements and set a delivery plan before you pick an algorithm.
Design
Entities, Strategy contracts, Manager, and Factory — what you put on the board before coding.
Implement core
Wire Result, Config, Factory, and Manager with client > API > default priority.
Algorithms
Token Bucket first, then fixed/sliding windows and Leaky Bucket — trade-offs out loud.
Concurrency
Per-client locks, ConcurrentHashMap, and a stress test that proves exactly `limit` succeed.
Multi-instance
Why in-memory quotas split across pods — Redis and DB sketches for shared counters.
Ship it
Decision matrix and how to run the `hub/scripts/rate-limiter-sourced/` project.