How would you implement a thread-safe rate limiter? | Palo Interview Question