Loading...
The Velvet Rope
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid, senior
Problem
Build a class that enforces per-user API rate limits using a sliding time window. It should track each user independently and decide whether a new request from that user falls within the allowed call budget. Callers supply an explicit timestamp so the behavior is fully deterministic.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.