Amazon interview question

design an API function (rate limiter)