The Event Window
A medium 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
- medium
- Seniority
- L4
Interview Prompt
A request-tracking service for an API needs to answer one question on demand: how many hits landed in the last five minutes. Implement a `HitCounter` whose `hit(timestamp)` records an event at a given second and whose `get_hits(timestamp)` reports that count, then the graded entrypoint `event_window(operations, arguments)`, which replays a list of operation names and a parallel list of argument lists against a single counter and returns one result per operation.
Summary
A five-minute window is all that matters.
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