The Throttle Wall
A hard Python mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L4
Interview Prompt
We throttle each client of our API gateway on its own, letting a client keep at most `max_requests` accepted calls within any `window_ms` stretch of time. The `operations` list opens with an `['init', max_requests, window_ms]` setup step followed by `['is_allowed', client_id, timestamp]` checks; return one result per entry, `None` for the setup and `True` or `False` for whether each call is let through.
Summary
Stop the abusers. Let the rest through.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write and run your Python against test cases
- Answer the interviewer's follow-up questions, then get a hire or no-hire decision