Statement
Let there be some service X, all the API hit count of the service is passed to you through an API call every hour.
Example, at end of an hour, lets say at 04:01, you would receive a call on your API with value“10” denoting that between 03:00–04:00 the service got 10 requests.
Task
Your task is to create a dashboard which sends an alert to teams if the maximum API hit count in last K hours exceeds a defined threshold limit T.
Contraints
Both K and T are configurable and the team can define them, but would be constant once the dashboard is created.
Assumptions
For ease of solving you can assume a method call instead of API which would be called every hour with last hour API call count.
We are only interested in developing the backend logic here, please consider K and T passed as some method parameter.
Also please assume a pre defined method ”notify()” to notify the team.