MongoDB interview question

Design a rate limiter and code it up.