Swiggy Interview Question

Design a pub-sub system with components.