20 questions · JavaScript Developer

JavaScript Developer Interview Questions

A hiring manager's question bank for JavaScript developers — closures, the event loop, async behaviour, prototypes, and the kind of bugs that only show up in real code. Built to separate people who can recite definitions from people who actually understand how the language runs.

JavaScript is deceptively easy to write and genuinely hard to master, which makes interviewing for it tricky. Almost any candidate can build a working feature; the question that matters is whether they understand the parts of the language that quietly cause bugs — closures capturing the wrong variable, the event loop reordering what looks like sequential code, this binding changing depending on how a function is called, and equality coercion doing something surprising. A strong JavaScript developer is not someone who has memorized that "JavaScript is single-threaded"; it is someone who can explain why an await inside a loop serializes your requests, why a forgotten await swallows an error, or why two objects that look identical are not equal. The questions below move from core language mechanics into asynchronous behaviour and then into practical debugging, because that progression mirrors how seniority actually shows up. Pair a couple of fundamentals questions with one async scenario and one real debugging story, and you will quickly learn whether a candidate has shipped JavaScript under pressure or only studied it. Listen especially for people who reach for a small concrete example to explain an abstract concept — that habit is one of the most reliable signals of genuine fluency.

How to use these questions

Pick six to eight questions across two or three categories rather than running the whole list. Start with one or two Core Language questions to set a baseline, then spend real time on an Async & the Event Loop scenario and a Debugging story. Follow every clean answer with "why?" or "when would that break?" — the follow-up is where fluency separates from memorization.

Core Language

  1. What is a closure? Give me a concrete example where you have used one deliberately.
  2. Explain the difference between var, let, and const, and what hoisting actually does to each.
  3. How does the value of this change depending on how a function is called?
  4. Walk me through JavaScript's prototype chain — what happens when you access a property that is not on the object itself?
  5. What is the difference between == and ===, and can you name a coercion case that surprises people?
  6. What is the difference between null and undefined, and when does each show up in practice?

Async & the Event Loop

  1. Explain the event loop. Why can JavaScript do non-blocking I/O while running on a single thread?
  2. What is the difference between the microtask and macrotask queues, and why does a Promise resolve before a setTimeout of 0?
  3. What problem do Promises solve over callbacks, and what does async/await add on top of Promises?
  4. You await several independent API calls in a for loop and it is slow. What is happening and how do you fix it?
  5. How do you handle errors in async/await code, and what happens to an unhandled rejected Promise?

ES6+ & the DOM

  1. What does destructuring give you, and when do default values inside it actually apply?
  2. Explain the difference between an arrow function and a regular function beyond syntax.
  3. What is event delegation, and why is it useful when binding handlers to a long list?
  4. What is the difference between map, filter, and reduce, and when would you reach for reduce?

Debugging & Judgement

  1. Tell me about a JavaScript bug that took you a long time to track down. How did you finally find it?
  2. A value is undefined when you expect it to be set. Walk me through how you debug that.
  3. How do you decide between mutating state and creating a new copy, and why does it matter?
  4. How would you approach finding a memory leak in a long-running single-page app?
  5. A teammate writes code that works but you find it hard to read. How do you handle that in review?

Tips for interviewing JavaScript candidates

  • Reward candidates who explain a concept with a tiny concrete example — it is the clearest sign of real fluency.
  • Probe async deeply; most production JavaScript bugs live in timing and unhandled rejections.
  • Do not penalize someone for not memorizing every Array method name if their reasoning is sound.
  • Ask for a real debugging story — how someone narrows a bug tells you more than any definition.
  • Watch for over-engineering; strong JavaScript developers reach for the simplest thing that works.

Frequently asked questions

Hiring JavaScript developers? JuggleHire ranks, screens, and schedules candidates for you.

JuggleHire goes beyond simple job posting. Leverage custom forms, powerful screening filters, and automated social media previews to find the perfect fit for your team.