← All posts

Blog

JavaScript interview questions: what each one predicts on the job

11 min readFour-Leaf TeamUpdated
interviewsjavascripttechnicalfrontendsoftware engineeringpreparation

You can find a hundred lists of JavaScript interview questions in ten seconds. Most are the same shape. Here's the question, here's the answer, memorize it. They treat each question as a quiz item instead of what it actually is, a probe for a specific on-the-job behavior.

JavaScript shows up in interviews because it shows up in work. It was the most-used language in the 2025 Stack Overflow Developer Survey at 66%, ahead of every other language. If you're interviewing for frontend, full-stack, or anything Node-shaped, a JavaScript screen is close to guaranteed. That ubiquity is why generic lists fail you. A list of thirty questions stays shallow to cover the surface, so you drill hoisting trivia while the questions that separate candidates go unpracticed.

This guide walks the families that keep showing up. For each one it names what a strong answer predicts about how you'd perform on the job, plus a trivia-tax flag when the question rewards having seen it before more than it rewards skill. Pair it with our Python interview questions guide and our data structures interview questions guide.

The families at a glance

The whole list compresses into one table. Each family maps to a runtime behavior that bites people in production.

Question familyWhat it screens forTrivia tax?
Closures, hoisting, TDZScope reasoning, stale-state debuggingPartial
this, bind/call/applyReal shipping mileage, callback debuggingPartial
Promises, async/await, event loopAsync timing, parallelization instinctNo
Type coercion, == vs ===Defaulting to safe equality on purposeYes
DOM, events, renderingFrontend performance judgmentPartial
State, data flow, perf budgetsArchitectural judgment (mid-level and up)No

Why JavaScript interviews keep using the same dozen families

Live JavaScript screens are still standard despite the argument that coding interviews are obsolete. In interviewing.io's 2025 survey of 67 interviewers, including 52 at FAANG companies, not one of those 52 reported their company had moved away from algorithmic questions. More than half expect them to fade in two to five years, but the present-day reality is unchanged.

What's changed is the pressure around them. The same survey found 81% of interviewers suspected candidates of using AI to cheat, and 75% believed AI assistance lets weaker candidates pass interviews they'd otherwise fail. The response has been more follow-up questions, more "walk me through why that logs in that order." A memorized answer survives the first question and falls apart on the second.

The families reuse because they map to the parts of the language that hurt in production. Each is a runtime-model question wearing a quiz-question costume. Learn the model, because the model is what transfers, and spot the pure trivia so you can give it five minutes instead of fifty. The calls below are editorial judgment from time on the interviewing side, not a formal study. Where semantics are quoted, they link to the canonical MDN reference.

Closures, hoisting, and the temporal dead zone

These predict debugging behavior better than almost anything else on the list. A closure is a function bundled with references to its surrounding scope, so it keeps access to outer variables after the outer function returns (MDN). The classic trap is a for loop with var that logs the same final value every time, fixed by let, which creates a fresh binding per iteration.

The temporal dead zone is the companion question. It's the span where a let or const variable exists but can't be touched yet, "from the start of the block until code execution reaches the place where the variable is declared," per MDN. var declarations hoist and initialize to undefined; let and const hoist but stay uninitialized, so touching them early throws a ReferenceError.

Signal: high. A candidate who explains why the var loop misbehaves and reaches for let unprompted is showing the scope reasoning that keeps a real callback from capturing the wrong value. It's the bug class behind a lot of "why is my event handler using stale state" tickets.

Trivia tax: partial. Reciting the hoisting table is rote. Explaining why a closure captures a variable by reference is the part interviewers probe with a follow-up.

this, bind, call, and apply

Context questions predict whether you've shipped real code, because the way this breaks is the way real bugs arrive. The value of this is set by how a function is called, not where it's defined (MDN). A method call binds this to the object, a plain call leaves it undefined in strict mode, and arrow functions inherit this from the enclosing scope.

The discriminating follow-up is usually a method passed as a callback that loses its binding, fixed with .bind(this), an arrow function, or storing a reference. call and apply invoke a function with an explicit this and differ only in how they take arguments.

Signal: high. Anyone who's debugged a React class component or an event handler has been burned by a detached this, and naming the fix unprompted is a strong tell of real mileage. Candidates who know the textbook rules but can't predict what a stray callback binds tend to be newer than their resume suggests.

Trivia tax: partial. Memorizing the call/apply argument difference is trivia. Predicting how this resolves in an unfamiliar snippet is the real skill.

Promises, async/await, and the event loop

This is the family that matters most on the job, because every real frontend juggles network calls and the bugs are timing bugs. The event loop is the runtime mechanism that runs JavaScript's single thread, processing queued jobs to completion one at a time. Interviewers test ordering. Per MDN, "microtasks have higher priority and the microtask queue is drained first before the task queue is pulled," which is why a promise callback runs before a setTimeout(fn, 0) queued earlier.

Promises represent a future value in one of three states (MDN). async/await is syntax over promises, so a missing await returns a pending promise instead of the value, and an unhandled rejection bubbles like a thrown error. The strong candidate reaches for Promise.all to parallelize independent calls instead of awaiting them one at a time.

A candidate who can predict the log order of mixed setTimeout and .then calls is showing the instinct that keeps a real page from waterfalling six sequential fetches.

Signal: very high. Async reasoning is the single most job-relevant family here. Watching someone reason about the queue is more informative than watching them write a sort.

Trivia tax: none worth flagging. Even the "what logs first" puzzle tests a model you use constantly.

Type coercion and == vs ===

This family is mostly trivia tax with a real signal hiding inside. Type coercion is JavaScript automatically converting a value from one type to another, which the loose equality operator does to operands before comparing. That's why, per MDN, "1" == 1 and 0 == false both return true. Strict equality (===) skips coercion and is what you should use almost everywhere.

The trap questions stack coercion until the result is absurd ([] == ![] is true). Knowing the answer to those proves you memorized a coercion table, not that you can ship.

Signal: the genuine signal is whether you default to === and can explain the one common exception, == null to catch both null and undefined in a single check. That shows you know the rules well enough to bend them on purpose.

Trivia tax: yes, for the deep coercion puzzles. Know that == coerces and === doesn't, default to ===, and don't spend an evening memorizing why [] == ![].

DOM, events, and rendering for frontend roles

For frontend roles, the language questions give way to questions about the browser the language runs in. The recurring families are event delegation, bubbling versus capturing, and the cost of touching the DOM.

Event delegation predicts the most. Instead of attaching a listener to every list item, you attach one to the parent and read event.target, which relies on bubbling. A candidate who reaches for delegation on a "handle clicks on a thousand rows" prompt is showing the same instinct that keeps a real app from leaking a thousand listeners.

The rendering questions probe whether you know that DOM reads and writes are expensive, that layout thrashing comes from interleaving them, and why frameworks batch updates instead of touching the DOM on every state change. If an interviewer wants React internals, that's a framework round.

Signal: moderate to high for frontend. Event delegation and a grasp of why DOM writes are costly predict whether you've built something that stayed fast as it grew.

Trivia tax: partial. Reciting the bubbling-versus-capturing phases is rote. Knowing when delegation earns its complexity is not.

State, data flow, and performance budgets on senior screens

Senior screens push past syntax into how you'd structure an application. The questions sound open-ended on purpose. How would you manage shared state across components, what's your performance budget for this page.

These predict architectural judgment, the thing that separates an engineer who can close a ticket from one who can own a surface. The strong answer names a tradeoff out loud. Lifting state up versus a store, the cost of prop drilling, when memoization earns its keep. Debouncing a search input and lazy-loading a heavy route are the concrete moves that show you think in budgets, not just features.

Signal: high for mid-level and up. Naming a tradeoff and a thing you'd measure is the senior tell. Jumping straight to a tool ("I'd add Redux") without saying what problem it solves reads as cargo-culting.

What the first three sentences of your answer should say

Interviewers read your first few sentences before you've written a line, and those sentences decide a lot. Across every family, lead with the runtime model or the tradeoff, then solve.

  • Closures and scope: name the binding behavior first. "This logs the final value each time because var is function-scoped, so every closure shares one binding."
  • this: say how it's bound before you fix it. "This callback loses its this because it's called detached from the object, so I'll bind it or use an arrow function."
  • Async: state the ordering rule. "These fetches don't depend on each other, so I'll run them with Promise.all instead of awaiting in sequence."
  • Coercion: default to strict. "I'll use === here so there's no coercion, unless I want == null to catch undefined too."
  • Frontend: name the tradeoff. "I'd delegate to the parent so I'm not attaching a thousand listeners, at the cost of one indirection through event.target."

Narrating the model is half the score. A memorized answer can't narrate a model it doesn't understand, which is exactly why the rise in AI-cheating suspicion has made interviewers want to hear the reasoning out loud.

What to drill if your interview is in less than a week

Spend your time where the signal density is highest.

  1. Async ordering. Practice predicting the log order of mixed setTimeout, .then, and await. Highest-value family, hardest to fake.
  2. The this binding. Trace this through method calls, detached callbacks, and arrow functions until you can predict it on sight.
  3. Closures and the var/let loop. Know why the loop misbehaves and why let fixes it. It's the same bug as stale state in a callback.
  4. One debugging rep per day. Take a broken async snippet or a this bug and fix it out loud. Reading a stack trace calmly is a real on-the-job skill that whiteboard questions miss.
  5. Skip the deep coercion puzzles. Know that == coerces and === doesn't, default to ===, and spend nothing more on [] == ![].

Comparing prep tools first? Our coding interview prep guide covers the field, and our technical interview preparation guide walks the full loop.

How to practice so the answer comes out clean under pressure

Reading answers builds recognition. It doesn't build the ability to produce a clean answer while someone watches and the clock runs. The gap between knowing your answer and delivering it under pressure is where good candidates lose offers.

The fix is to practice out loud, under something close to real conditions. Trace an async snippet you haven't seen, talk through the ordering, and get feedback on where your explanation went fuzzy. That's the gap Four-Leaf's voice mock interviews are built to close. You answer real JavaScript questions out loud, get scored on substance and delivery, and drill the spots where you freeze. The free trial includes every feature for three days, or a $5 one-time 5 Day Pass covers a single upcoming loop.

The families here are a map of what gets tested. Knowing the answer to each is table stakes. Knowing what each one tells a hiring manager about how you'll write real code is the part that turns the map into an offer.

Frequently asked questions

What JavaScript topics come up most in technical interviews?+

Five families carry most of the load: closures and scope, the `this` binding, asynchronous JavaScript (promises, async/await, the event loop), type coercion and equality, and DOM and event handling for frontend roles. Past those, the returns on breadth drop off fast. The candidates who do well can reason through the runtime model out loud rather than recite answers.

Are JavaScript coding interviews going away because of AI?+

Not at the companies that run them. In interviewing.io's 2025 survey of 67 interviewers, none of the 52 at FAANG companies reported moving away from algorithmic questions. Delivery is what's changing: 81% suspected candidates of using AI to cheat, so expect more in-person rounds, screen sharing, and follow-ups that test whether you understand the code you wrote.

Should I memorize answers to JavaScript interview questions?+

Memorize the runtime model, not the answers. Interviewers can tell within a minute when someone is reciting versus reasoning, and reciting reads as a red flag now that AI makes canned answers cheap. The questions worth your time transfer to bugs you haven't seen. The ones flagged with a trivia tax in this guide teach you nothing you'd use writing real code.

Is JavaScript still worth interviewing well on in 2026?+

JavaScript was the most-used language in the 2025 Stack Overflow Developer Survey at 66%, ahead of every other language. Any frontend, full-stack, or Node-heavy screen leans on it. Good interviewers care less about whether you can recite hoisting rules and more about whether you can debug an async race or trace a `this` binding.

What is the highest-value JavaScript family to drill?+

Asynchronous JavaScript: promises, async/await, and event-loop ordering. Every real frontend juggles network calls, the bugs are timing bugs, and the family is the hardest to fake. If you have one evening, practice predicting the log order of mixed `setTimeout`, `.then`, and `await`.

Try it free

Ready to ace your next interview?

Practice with AI-powered mock interviews, tailor your resume, and negotiate your salary, all in one platform.

Start your free trial

3-day trial. No credit card required.