JavaScript Interview Guide
A map of what strong FE interviews probe — language, async, DOM, performance — with practice prompts, not a 200-question dump.
intermediate2 min read
- interview
- javascript
Good frontend interviews are not trivia night. They check whether you can model the runtime, write small correct functions, and talk tradeoffs. Sites like GreatFrontEnd structure this as quiz + coding + system design; language depth still starts with material like javascript.info and MDN.
What interviewers score
- Mental models — event loop, closures,
this, prototypes - Correctness under time — edge cases, not only the happy path
- Platform literacy — DOM events, fetch/abort, storage, security basics
- Communication — structure: clarify → naive → improve → production notes
Language fluency table
| Topic | Can you… |
|---|---|
| Scope / TDZ | Explain var vs let with a closure loop |
| Closures | Build a private counter; mention retention |
this |
Predict call-site binding; arrow vs method |
| Prototypes | Describe lookup; when class is just sugar |
| Equality | Avoid == traps; know Object.is |
| Types | Coercion without cargo cult |
Async (almost every loop)
| Topic | Can you… |
|---|---|
| Event loop | Macrotask vs microtask; paint between tasks |
| Promises | Chain, all vs allSettled, error fall-through |
| async/await | Sequential vs parallel; try/catch |
| Cancellation | AbortController with fetch |
| Scheduling | Chunk long work without starving the UI |
Prompt: “What prints, in order?” — mix console.log, setTimeout(0), Promise.then, async function. Walk the queues out loud.
DOM & browser
- Capture / bubble / delegation
- Reflow vs repaint; layout thrash
IntersectionObserver,ResizeObserver- Cookies vs
localStoragevs IndexedDB - XSS sinks (
innerHTML, URL assignment)
Answer framework (use it)
- Clarify inputs, outputs, constraints
- Naive solution so you’re not silent
- Improve complexity / API
- Production — errors, a11y, perf, abort
Example for debounce: trailing vs leading? Cancel? Then implement, then mention AbortSignal or framework utilities if the codebase already has one.
Practice set (write code)
debounce/throttlePromise.all(and talk failure modes)- Event emitter
- Deep clone + when structuredClone is enough
- Flatten nested arrays
- LRU cache
- Retry with backoff + abort
Array.prototype.mappolyfill (sparse arrays!)