Back to problems

Event Logger with Rate Limiting

Object-Oriented Programming · Netflix · Easy

Problem You are building a rate-limited event logger for a streaming platform. Events arrive one at a time, each having a name and a timestamp, and they are guaranteed to appear in non-decreasing timestamp order. To avoid flooding the output, the logger must suppress an event if an event with the same name has already been printed within the last window seconds. Implement the EventLogger class: EventLogger(int window) – Constructor that sets the minimum cooling-off interval…

Checking your access…