This question evaluates competency in concurrency control, synchronization, API and low-level system design, and messaging system concepts by combining a rate limiter implementation with a pub/sub API.
You have two coding/design (low-level design) tasks.
Design and implement a rate limiter with an API like:
boolean allow(String clientId)
or
boolean allow(String key)
It should enforce a policy such as:
Discuss (and ideally implement) thread-safety and how you would adapt it for multiple application instances.
Design and implement a simple Pub/Sub component (Java-like interfaces are fine), supporting:
publish(topic, message)
subscribe(topic, subscriber)
unsubscribe(topic, subscriber)
Clarify delivery semantics (best-effort vs at-least-once), ordering per topic, and how you handle slow consumers.