The utility functions frontend interviews ask for again and again: debounce, Promise.all, an event emitter, and event loop ordering. For each: what's being tested, a strong answer, the follow-ups, and an implementation with real tests.
Frontend coding rounds rarely ask for algorithm puzzles. They ask you to build the small utilities that frontend code depends on: debounce and throttle, Promise.all, an event emitter, deep clone, a memoize or LRU cache, flattening arrays, a tiny pub-sub store. The question is easy to state, so the interviewer learns a lot from how you work.
What interviewers write down
this?", "What happens with an empty array?", "Do you want a cancel method?" Asking these is part of the answer, not a delay.A reliable 5-step routine (about 25 minutes per question):
The rest of this installment works through four classic questions. Each challenge has real tests: implement it yourself before opening the hints.