ESC

Type to search the knowledge base.

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

  1. Mental models — event loop, closures, this, prototypes
  2. Correctness under time — edge cases, not only the happy path
  3. Platform literacy — DOM events, fetch/abort, storage, security basics
  4. 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 localStorage vs IndexedDB
  • XSS sinks (innerHTML, URL assignment)

Answer framework (use it)

  1. Clarify inputs, outputs, constraints
  2. Naive solution so you’re not silent
  3. Improve complexity / API
  4. 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)

  1. debounce / throttle
  2. Promise.all (and talk failure modes)
  3. Event emitter
  4. Deep clone + when structuredClone is enough
  5. Flatten nested arrays
  6. LRU cache
  7. Retry with backoff + abort
  8. Array.prototype.map polyfill (sparse arrays!)

Topic guides on this site

External practice