Loading...
The Event Window
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
A real-time monitoring service tracks events and counts how many occurred in the last 5 minutes (300 seconds). Design a hit counter class with a hit method that records a timestamp and a get_hits method that returns the count of hits within the last 300 seconds of a given timestamp.
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.