Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Implement a rate-limited logger that allows printing an event only after a specified cooldown window has passed since its last print.
Maintain state by recording the last printed timestamp for each unique event name.
Return the event name if the rate limit condition is met, otherwise return an empty string.
What This Tests
Hash Map usage for constant-time lookups and updates
Stateful class design with instance variables
Logic implementation based on numerical comparisons and constraints
Common Patterns
Hashing
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected