Stripe Interview Question

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