MongoDB Interview Question

Design a rate limiter and code it up.