Box interview question

Was asked to implement an EventEmitter from scratch.