Engineering

JavaScript Developer mock interview questions

19 questions a JavaScript Developer panel actually asks, with what each one tests and what a strong answer contains, then practice any of them live. Language fundamentals and browser rounds for JavaScript developer interviews.

No account needed

Answer one real JavaScript Developer question now

A question a JavaScript Developer panel actually asks, answered out loud, scored on what you said and how you said it. Under two minutes, and nothing to sign up for.

“What order do these log: a console.log, a setTimeout with zero delay, and a resolved promise's then callback? Explain why.”

We never store the audio. Your answer is deleted within 24 hours unless you save the result.

  • Adaptive follow-ups, not a fixed question list
  • Rubric scorecard with evidence from your answers
  • Voice or text, with delivery coaching on voice sessions

Thinking past the interview? Carmen can help with your whole JavaScript Developer career: a switch, a raise, or what comes next.

19 javascript developer mock interview questions

The questions a JavaScript Developer panel actually asks, with what each one is testing and what a strong answer contains. Click any question to run it in a live session: your AI interviewer will cover it and score how you answer.

  1. 1.

    What order do these log: a console.log, a setTimeout with zero delay, and a resolved promise's then callback? Explain why.

    Why they ask it: The event loop question. It tests whether you understand the difference between the call stack, microtasks and tasks.

    A strong answer: The synchronous log runs first, then the promise callback, then the timeout. Promise callbacks are queued as microtasks, which run as soon as the current script finishes and before the next task, while setTimeout schedules a task that waits for the next turn of the event loop. Explaining that a long chain of microtasks can delay rendering shows depth.

  2. 2.

    Implement a debounce function, then tell me how it differs from throttle.

    Why they ask it: A standard coding exercise that tests closures, timers and handling of this and arguments.

    A strong answer: A function returning a closure that stores a timer id, clears the existing timer on each call and sets a new one, and calls the original function with the correct this and arguments. Debounce waits for a pause in calls, throttle guarantees at most one call per interval. Mentioning leading and trailing options and cancellation is a plus.

  3. 3.

    How is the value of this determined in JavaScript, and why do arrow functions behave differently?

    Why they ask it: this is a frequent source of bugs, especially in callbacks and event handlers.

    A strong answer: this depends on how a function is called: as a method it is the object, called plainly it is undefined in strict mode, with new it is the new instance, and call, apply and bind set it explicitly. Arrow functions do not have their own this and use the value from the enclosing scope, which is why they work well for callbacks inside methods but not as methods themselves.

  4. 4.

    A single page app gets slower and uses more memory the longer it stays open. How do you find the leak?

    Why they ask it: Browser memory debugging is a practical skill that separates experienced developers.

    A strong answer: Take heap snapshots in the browser devtools before and after repeating an action, compare them to find objects that keep growing, look for detached DOM nodes, event listeners that are never removed, intervals that keep running, and caches or closures holding references. Fix by cleaning up listeners and timers when components are removed.

  5. 5.

    Explain how prototypal inheritance works and how class syntax relates to it.

    Why they ask it: Tests whether you understand the object model rather than just the class keyword.

    A strong answer: Objects have an internal link to a prototype, and property lookups walk up this chain. Class syntax is a cleaner way to set up constructor functions and prototype methods, with extends linking prototypes. Methods defined in a class live on the prototype, so they are shared across instances.

  6. 6.

    How do you handle errors in asynchronous code, and what happens to a rejected promise that nobody handles?

    Why they ask it: Error handling in async code is often done poorly, leading to silent failures.

    A strong answer: Use try and catch with await or catch on promise chains, handle errors at a level that can act on them, and use Promise.allSettled when partial failure is acceptable. An unhandled rejection triggers an unhandledrejection event in the browser, and in Node.js recent versions terminate the process by default. Logging these globally helps catch them.

  7. 7.

    Tell me about a time you had to work in a JavaScript codebase with no clear structure. What did you do?

    Why they ask it: Many JavaScript roles involve messy code. The interviewer wants to see pragmatic improvement.

    A strong answer: The state of the code, the specific problems it caused, how you introduced structure gradually such as modules, linting, type checking with TypeScript or JSDoc, and tests around risky areas, and how you got others to follow the changes.

How the JavaScript Developer interview runs

Usually a recruiter screen, then a technical round on the language itself: scope and closures, this, prototypes, asynchronous behaviour and the event loop. Expect a live coding exercise in plain JavaScript, often implementing something like debounce, a promise utility or DOM manipulation without a framework. Later rounds cover browser behaviour, performance and debugging, and how you structure code in a larger front end.

What the panel scores

Language fundamentals

Whether you understand how JavaScript actually works.

  • Explains the event loop, microtasks and tasks
  • Knows how this and closures behave
  • Understands prototypes beneath class syntax

Asynchronous code

Whether async code is correct and handles failures.

  • Handles rejections deliberately
  • Chooses the right promise combinator
  • Avoids race conditions

Browser and performance

Whether you can debug and optimise in the browser.

  • Uses devtools for memory and performance
  • Cleans up listeners and timers
  • Understands rendering costs

Code quality

Whether you leave code easier to work with.

  • Introduces structure incrementally
  • Uses linting, types and tests
  • Writes readable, modular code

Common questions in every interview

These come up in almost every JavaScript Developer interview regardless of the company or the round.

  1. 8.

    Tell me about yourself.

    Why they ask it: Opens the interview and sets the frame. The interviewer is checking whether you can select what matters for this job rather than narrate your whole history.

    A strong answer: A 60-90 second arc: where you are now, one or two proof points that match the posting, and why this role is the logical next step. Present, past, then future.

  2. 9.

    Why do you want this role?

    Why they ask it: Tests whether you read the job description or mass-applied. Weak answers are about what the candidate gets; strong answers connect to the work itself.

    A strong answer: Two specifics from the posting or the company's actual work, plus an honest line about what you want to get better at here.

  3. 10.

    Walk me through your resume.

    Why they ask it: Checks that your story holds together and that the transitions were deliberate rather than accidental.

    A strong answer: Chronological but fast, with a reason attached to each move and more time on the roles closest to this one.

  4. 11.

    Tell me about a time you failed.

    Why they ask it: Tests self-awareness and whether you own outcomes. Interviewers are listening for a real failure, not a disguised strength.

    A strong answer: A genuine miss, what you specifically got wrong, the cost, and the concrete thing you changed afterwards that has since held up.

  5. 12.

    Tell me about a conflict with a coworker or manager.

    Why they ask it: Predicts how you behave when the team disagrees. The trap is blaming the other person.

    A strong answer: The substance of the disagreement, what you did to understand their position, how it resolved, and what the working relationship looked like after.

  6. 13.

    What's your greatest strength?

    Why they ask it: Checks whether you know what you're actually good at and can prove it.

    A strong answer: One strength that maps to the posting, plus a short example where it produced a measurable result.

  7. 14.

    What's your greatest weakness?

    Why they ask it: Tests honesty and whether you're actively working on something. Rehearsed non-answers ('I work too hard') read as evasive.

    A strong answer: A real limitation that isn't core to the job, the system you built to manage it, and evidence it's improving.

  8. 15.

    Tell me about a time you had to influence someone without authority.

    Why they ask it: Almost every role depends on getting people who don't report to you to change course.

    A strong answer: What you wanted, why they resisted, the evidence or framing that moved them, and what actually shipped as a result.

  9. 16.

    Where do you see yourself in five years?

    Why they ask it: Tests whether this job fits your trajectory, which is a retention question in disguise.

    A strong answer: A direction rather than a title, and a line about the skills this role would build toward it. Vague ambition and rigid title-chasing both land badly.

  10. 17.

    Why are you leaving your current job?

    Why they ask it: Screens for red flags. Interviewers listen for how you talk about people you no longer work with.

    A strong answer: Forward-looking and specific about what you're moving toward. Criticism of a former employer costs you more than it gains, even when it's deserved.

  11. 18.

    What are your salary expectations?

    Why they ask it: Checks whether you've done market research and whether you're in range before anyone spends more time.

    A strong answer: A researched range with your target near the bottom of it, framed against the scope of the role. Deflect once if the posting has no band, then answer.

  12. 19.

    Do you have any questions for us?

    Why they ask it: The most under-prepared question in the interview, and the one that most changes the final impression.

    A strong answer: Two or three questions about how the team actually works: what the first 90 days look like, how success is measured, what the hardest part of the job is.

Every round ends in a scorecard like this

Your JavaScript Developer answers, quoted back, scored on what this role is judged on, with the line to say instead.

Round Zero interview scorecard: a quoted answer flagged 'Light on metrics', a suggested fix, and an overall score of 84 out of 100.Round Zero interview scorecard: a quoted answer flagged 'Light on metrics', a suggested fix, and an overall score of 84 out of 100.

Real screen from the app. Sample from a product design round.

Related roles

All Engineering →

No spam. Unsubscribe anytime.

Ready to practice as a JavaScript Developer?

Sign up free, no card. 30 voice minutes and unlimited typed interviews, each ending in the complete scorecard: rubric scores, strengths, and what to fix next. Nothing is blurred.

  • ✓ Predefined role or paste any job description
  • ✓ Rubric scores with evidence quotes
  • ✓ 888+ roles to choose from

Questions & answers

Is the JavaScript Developer mock interview free?
Yes. 30 voice minutes and unlimited typed JavaScript Developer interviews, no card. You get the complete rubric scorecard every time, with the evidence quoted from your own answers. Nothing is blurred.
Can I use my own job description instead?
Yes. Predefined roles are starting points. Paste any JD in the setup form and your AI interviewer will tailor questions to that posting.
How is scoring tailored to this role?
We pre-fill a realistic JavaScript Developer job description and interview format so questions and the scorecard match how this role is actually interviewed.
Should I tailor my resume before practicing?
Run a resume fit check against a JavaScript Developer job description first, then practice the interview with the same JD for a tighter loop.