JS Interview Classics
The functions every frontend loop asks you to write from memory — promiseAll, an emitter, deep equality, a memoized call. No library, no notes.
Challenge: write promiseAll from scratch
advancedchallengeImplement the semantics of Promise.all — results in input order, first rejection wins, plain values pass through — without calling Promise.all.
Challenge: a tiny event emitter
advancedchallengeImplement on, off, once and emit — the pub-sub primitive every framework interview expects you to know cold.
Challenge: deep equality by hand
advancedchallengeDecide whether two unknown values are structurally identical — primitives by identity, arrays element-wise, objects key by key.
Memoize a single-argument call
intermediateblankComplete the caching wrapper — the table that holds results, the lookup that short-circuits, and the write that pays for the next call.
Review: promiseAll that loses the order
advancedreviewA hand-rolled Promise.all is correct while inputs settle in order, and scrambles results the first time one resolves late. Find the line that writes by arrival instead of by position.