They gave two function API, register() and event_fire(). register is used for register callbacks, e.g. register(cb1),and event_fire() is like a trigger, once the event_fire() is called all registered callbacks will be executed. And they ask you to give a solution to make this process correct.
Anonymous
There are many follow-up questions on multi-thread when you finish the basic version answer.
Check out your Company Bowl for anonymous work chats.