I was asked this question in one of the interview recently but I didn't know how to approach. Can someone help understanding this?
You have an app running in a client that calls on a server to process a stream of objects with the code:
for obj in stream:
process(obj)
You are told that occasionally, but only occasionally, this code overloads the server so you are asked to restrict the maximum request rate to R requests per unit time.