Implement a Publish-Subscribe Event Bus in JavaScript or TypeScript
Company: Tradedesk
Role: Frontend Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
Overview: A front-end coding question asking the candidate to implement an in-process publish-subscribe utility in JavaScript or TypeScript with subscribe, publish, and unsubscribe. It tests API design, choice of data structures, safe iteration when subscribers change during a publish, isolation of subscriber errors, and cleanup that avoids memory leaks.