...

/

Feature #4: Request Limiter

Feature #4: Request Limiter

Description

The Facebook Status API queues requests using the requested Status ID and a timestamp. We want to implement a throttling mechanism on the requests that limits one request for a particular Status ID at a pre-configured time interval. Any additional requests for the same Status ID in this interval will be dropped. Multiple requests for different Status IDs can occur at the same time.

We’ll be provided with the name of the request and the time it arrived. Our system will have to decide whether to accept the request or reject it based on its arrival time. In this scenario, we’ll use a time limit of five days before a similar request can be sent from the same or different platform.

Solution

The hashtable data structure will be used to implement this feature. This data structure can uniquely store all ...

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy