Question: code for : 1 . Rate Limiter In each second i , a gateway receives a request from the domain request [ i ] .

code for :
1. Rate Limiter
In each second i, a gateway receives a request from the domain request[i]. The gateway allows at most 2 requests from a domain within 5 seconds, and at most 5 requests within 30 seconds.
Given the array requests, for each request return the string" (status: 200, message: OK}" if the request can be processed. Otherwise return "{status: 429, message: Too many requests)".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!