OfferUp interview question

How would you implement rate-limiting in code?