Didi Chuxing interview question

Can you implement a publisher-subscriber pattern?