Stripe interview question

Design a system to detect and implement API rate-limiting for a server.