What should you focus on for a JavaScript interview?
Which basics should you check first?
The most asked question compared var, let, and const. It appeared in 20 of 172 interviews. Use it to check more than whether you remember the names:
- Can you compare their scope and reassignment rules?
- Can you separate hoisting from initialization?
- Can you explain the temporal dead zone?
Reviews found answers that did not clearly separate hoisting from initialization: var starts as undefined, while let and const stay inaccessible until initialized. Make that difference clear in your answer.
Also check whether you can explain == versus === and when you would use each. For closures, can you explain how a function keeps access to outer variables?
How clearly can you explain async code?
Async and the event loop was the most common topic in these interviews, appearing in 60 of 172 interviews. Check whether your answer covers both the runtime and the order in which code runs.
Reviews found answers that left out how the browser or runtime handles asynchronous operations and queues callbacks for later execution. Answers about execution order also missed a key sequence: synchronous code finishes first, then the microtask queue drains before the next timer task runs.
Can you use that sequence to explain the order of code with promises, timers, and await continuations? Can you explain what a callback is and when you would use a promise?
What coding tasks can you try?
Coding tasks appeared in 17 of 172 interviews. Try these tasks from the interviews:
- Return the first repeating character in a string.
- Write a function that checks for a palindrome.
- Write a binary search implementation in JavaScript.
- Select objects from an array whose score is greater than 45.
The arrays and coding topic also covers time and space complexity. After writing your code, can you explain how its running time and memory use change as the input grows?
What should you check beyond core JavaScript?
React, Redux, and RxJS appeared in 38 of 172 interviews. Can you explain what Redux is, how components share state, and what hooks do?
Use the other topics to check specific gaps:
- Browser: can you explain how you would change the DOM and handle an event?
- Performance: can you explain debouncing and throttling?
- Testing: can you describe how you would debug a test and check edge cases?
The page also has questions on Node.js, TypeScript, memory leaks, and reusable application design.
Who gets asked JavaScript
The 20 most asked JavaScript questions
Counted by interview, not by mention: a question asked twice in one conversation counts once.
How do var, let, and const differ in scope, reassignment, hoisting, and the temporal dead zone?
Asked in 20 of 172 interviews · last asked Oct 8 · Concept · Junior
Show answer
Inside functions, `var` is function-scoped; `let` and `const` are block-scoped. `var` and `let` allow reassignment; `const` does not. All three are hoisted, but only `var` starts as `undefined`. `let` and `const` remain inaccessible in the temporal dead zone until initialization.
- At the top level, `var` is global in scripts but module-scoped in modules.
- `const` prevents reassignment, not changes to an object's properties or an array's contents.
- `var` allows repeated declarations; `let` and `const` cannot be redeclared in the same scope.
- Prefer `const`; use `let` when reassignment is needed. Avoid `var` in new code.
JavaScriptconsole.log(a); // undefined var a = 1; try { console.log(b); } catch (error) { console.log(error.name); // ReferenceError } let b = 2; const item = { value: 1 }; item.value = 2; // Allowed: item still refers to the same object.What the interviewer checks: The interviewer checks whether you understand scope, binding changes, and access before initialization.
Common mistake (in 4 of 9 reviewed answers): Many answers forget that hoisting is not initialization: `let` and `const` are hoisted but cannot be accessed before initialization.
Other ways it was asked
- “What is the difference between var, let, and const in JavaScript?”
- “What is the difference between var, let, and const?”
- “In JavaScript, can you differentiate between let, var, and const?”
How does the JavaScript event loop work?
Asked in 16 of 172 interviews · last asked Oct 8 · Concept · Mid-level
Show answer
The event loop coordinates when queued JavaScript callbacks run. Synchronous code runs on the call stack, while the browser or Node.js runtime handles asynchronous operations and queues callbacks when ready. Queued callbacks run only when the stack is empty. Promise microtasks run before the next task, such as a timer callback.
- Long-running synchronous code blocks other callbacks from running.
- Microtasks include Promise handlers and queueMicrotask callbacks; newly added microtasks also run before the next task.
- A timer delay is a minimum wait, not a guaranteed execution time.
- Node.js uses event loop phases for timers and I/O, plus a separate process.nextTick queue.
JavaScriptconsole.log('start'); setTimeout(() => console.log('timer'), 0); Promise.resolve().then(() => console.log('promise')); console.log('end'); // Output: start, end, promise, timerWhat the interviewer checks: The interviewer checks whether you can explain callback scheduling and predict execution order.
Common mistake (in 4 of 6 reviewed answers): Many answers forget that the runtime handles asynchronous work and queues callbacks to run after the call stack is empty.
Other ways it was asked
- “What is the event loop in JavaScript?”
- “Can you explain the event loop?”
- “What does the event loop do in Node.js?”
What is the difference between == and === in JavaScript, and when would you use each?
Asked in 12 of 172 interviews · last asked Sep 29 · Concept · Junior
Show answer
=== compares values without converting their types. == may convert types before comparing, so values of different types can be equal. Use === by default for predictable comparisons. Use == only when you want its conversion rules, such as value == null to check for null or undefined.
- === returns false when the operands have different types.
- == can produce surprising results, such as 0 == false being true.
- Both operators compare objects by reference, not by their contents.
- NaN is not equal to itself with either operator.
JavaScriptconsole.log(5 == "5"); // true console.log(5 === "5"); // false console.log(null == undefined); // true console.log(null === undefined); // falseWhat the interviewer checks: The interviewer is checking whether you understand type conversion and can choose comparisons that avoid unexpected results.
Other ways it was asked
- “What is the difference between == and === in JavaScript?”
- “What is the difference between `==` and `===` in JavaScript?”
- “When would you use ==, and when would you use ===?”
What is a closure in JavaScript, and how does it retain access to outer variables?
Asked in 12 of 172 interviews · last asked Oct 15 · Concept · Junior
Show answer
A closure is a function together with access to variables from its outer scope. JavaScript keeps this access based on where the function was created, even after the outer function finishes. It retains access to the variables, not copies of their values.
- Closures follow lexical scope: where a function is created determines which outer variables it can access.
- An inner function can read and update outer variables after the outer function returns.
- Closures are useful for private state, callbacks, and function factories.
JavaScriptfunction makeCounter() { let count = 0; return function () { return ++count; }; } const counter = makeCounter(); console.log(counter()); // 1 console.log(counter()); // 2What the interviewer checks: The interviewer checks whether you understand lexical scope and how functions keep access to outer variables.
Other ways it was asked
- “What is a closure in JavaScript?”
- “Why are closures used in JavaScript?”
- “What is a closure in JavaScript, and how does it work?”
What is hoisting in JavaScript, and how does it affect var, let, and const?
Asked in 10 of 172 interviews · last asked Oct 21 · Concept · Junior
Show answer
Hoisting means JavaScript sets up declarations before running code in their scope; it does not move the code. A var variable starts as undefined, so you can read it before its declaration. let and const are also hoisted, but reading them before their declarations run throws a ReferenceError. This waiting period is called the temporal dead zone.
- var has function, module, or global scope; let and const have block scope.
- Initializers run where they appear in the code, not during hoisting.
- const must have an initializer in a normal declaration and cannot be reassigned.
JavaScriptconsole.log(count); // undefined var count = 3; { console.log(total); // ReferenceError: temporal dead zone let total = 5; }What the interviewer checks: The interviewer checks whether you can explain scope, initialization, and access before a declaration.
Other ways it was asked
- “What is hoisting in JavaScript?”
- “What is hoisting?”
- “Tell me about hoisting in JavaScript.”
How do microtasks, timers, and await continuations run relative to synchronous code in the JavaScript event loop?
Asked in 10 of 172 interviews · last asked Oct 8 · Concept · Senior
Show answer
Synchronous code finishes first, then microtasks drain before the next timer callback. Promise handlers run as microtasks when their promises settle. An await pauses its async function, and its continuation runs as a microtask, even for an already fulfilled promise.
- Microtasks added while draining also run before the next timer; repeated microtasks can delay timers and I/O.
- A timer delay is a minimum wait, not a guaranteed execution time.
- Node.js process.nextTick uses a separate queue, usually drained before promise microtasks; ES modules can differ.
- Node.js setImmediate runs in the check phase; its order against setTimeout depends on context.
JavaScriptconsole.log('start'); setTimeout(() => console.log('timer'), 0); (async () => { await Promise.resolve(); console.log('await'); })(); Promise.resolve().then(() => console.log('then')); console.log('end'); // Output: start, end, await, then, timerWhat the interviewer checks: The interviewer checks whether you can predict execution order and explain how microtasks can delay other work.
Common mistake (in 3 of 6 reviewed answers): Many answers forget that synchronous code finishes first and queued microtasks drain before the next timer callback.
Other ways it was asked
- “In Node.js, what's the practical difference between the event loop's microtask queue (Promises and queueMicrotask) and macrotask queue (setTimeout and setImmediate), and when would you choose one over the other?”
- “In Node.js, what's the difference between the microtask queue (promises and process.nextTick) and the macrotask queue (setTimeout and setImmediate), and how can this affect production latency?”
- “In JavaScript's event loop, how do microtasks (promises) and macrotasks (setTimeout) differ in scheduling, and what's the practical impact on execution order?”
What is JavaScript?
Asked in 8 of 172 interviews · last asked Sep 24 · Concept · Junior
Show answer
JavaScript is a programming language used to make web pages interactive. It handles user actions, updates page content, and requests data without reloading the page. It also runs outside browsers, such as on servers using Node.js.
- HTML defines page structure, CSS controls appearance, and JavaScript adds behavior.
- JavaScript is dynamically typed: values have types, but variables are not fixed to one type.
- JavaScript and Java are different languages.
What the interviewer checks: The interviewer is checking whether you understand JavaScript’s role on the web and where else it runs.
Other ways it was asked
- “What is JavaScript? Explain it.”
- “What is JavaScript, and why is it used?”
What is a callback function in JavaScript?
Asked in 7 of 172 interviews · last asked Sep 30 · Concept · Junior
Show answer
A callback is a function passed to another function so that it can call it. Callbacks let you provide code to run during an operation or after it finishes. They can run immediately, like callbacks in array methods, or later, like timer callbacks.
- Pass the function itself, rather than calling it and passing its result.
- Callbacks can be synchronous or asynchronous.
- Common uses include array methods, event handlers, and handling results from asynchronous operations.
JavaScriptfunction greet(name, callback) { callback(`Hello, ${name}`); } greet("Sam", (message) => { console.log(message); // Hello, Sam });What the interviewer checks: The interviewer is checking whether you understand passing functions as values and know that callbacks are not always asynchronous.
Other ways it was asked
- “Can you explain what a callback function is?”
- “What is a callback function?”
- “What is a callback function used for in JavaScript?”
What is a JavaScript promise, and when would you use one?
Asked in 7 of 172 interviews · last asked Oct 5 · Concept · Junior
Show answer
A JavaScript Promise is an object that represents the eventual result of an operation, usually asynchronous. It starts pending, then becomes fulfilled with a value or rejected with a reason. I use promises for tasks like network requests, so I can handle results and errors without blocking other code.
- Once fulfilled or rejected, a promise cannot change its state or result.
- Use .then() for success, .catch() for errors, and .finally() for cleanup.
- These methods return new promises, so you can chain operations.
- Async functions can use await to read promise results and try/catch to handle rejections.
What the interviewer checks: The interviewer checks whether you understand asynchronous results, promise states, and error handling.
Other ways it was asked
- “What is a promise?”
- “What is a JavaScript Promise, and how does it work?”
- “What is a JavaScript Promise used for, and when would you use one?”
How does the DOM work in JavaScript?
Asked in 7 of 172 interviews · last asked Sep 7 · Concept · Junior
Show answer
The DOM (Document Object Model) is an object tree that represents a web page. JavaScript uses browser APIs to read and change this tree, update styles, and handle events. These changes can update the page without reloading it.
- Elements and text are nodes in the tree.
- The document object is the main entry point for accessing the page.
- JavaScript can find, create, change, and remove nodes.
- The DOM is a browser API, not part of the JavaScript language itself.
JavaScript// Run after the page's body exists. const message = document.createElement('p'); message.textContent = 'Hello!'; document.body.appendChild(message);What the interviewer checks: The interviewer checks whether you understand how JavaScript reads and changes a web page through the DOM.
Other ways it was asked
- “What is the DOM?”
- “What is the DOM, and what is it used for in JavaScript?”
- “What is the DOM used for in JavaScript?”
What is Redux?
Asked in 7 of 172 interviews · last asked Oct 15 · Concept · Junior
Show answer
Redux is a JavaScript library for managing shared application state in a central store. You dispatch actions to describe changes, and reducers calculate the next state. With React, React Redux connects components to the store. Redux Toolkit is the recommended way to write Redux logic with less code.
- Redux works with React, but it can also be used without React.
- Reducers must be pure and must not mutate existing state.
- Redux Toolkit uses Immer so you can write updates that look like mutations but produce immutable state.
- Redux helps with complex shared state; local component state is often enough for simpler needs.
What the interviewer checks: The interviewer checks whether you understand Redux’s data flow, its role with React, and when it is useful.
Other ways it was asked
- “Can you explain what Redux does?”
- “What is Redux, and how does it help manage application state?”
- “What is Redux, and how is it used with React?”
How do CommonJS require and ES module import differ?
Asked in 7 of 172 interviews · last asked Oct 19 · Concept · Junior
Show answer
`require()` is CommonJS syntax and loads modules synchronously; CommonJS exports use `module.exports`. ES modules use `import` and `export`; static imports are processed before the module runs. You can call `require()` conditionally, but static `import` must be at the top level. Dynamic `import()` works in both systems and returns a promise.
- In Node.js, `.cjs` means CommonJS, while `.mjs` means ES modules.
- For `.js` files, the nearest package.json's `type` field can explicitly select the module system.
- Static imports help build tools analyze dependencies and remove unused code through tree shaking.
- Recent Node.js versions can require ES modules only if their dependency graph has no top-level `await`.
What the interviewer checks: The interviewer checks whether you understand module syntax, loading behavior, and Node.js module support.
Other ways it was asked
- “What is the difference between require and import in Node.js?”
- “Could you clarify the syntax differences between require and import, and explain how their loading mechanisms affect module behavior in Node.js?”
- “What is the difference between `require` and `import` in Next.js?”
What is the difference between Java and JavaScript?
Asked in 6 of 172 interviews · last asked Jul 2 · Concept · Junior
Show answer
Java and JavaScript are different programming languages, despite their similar names. Java uses static types and usually runs on the Java Virtual Machine (JVM). JavaScript uses dynamic types and runs in browsers or runtimes like Node.js. I would use Java for many backend or Android projects, and JavaScript for interactive web pages or Node.js backends.
- Java checks types before execution; JavaScript checks types at runtime.
- Java uses class-based inheritance; JavaScript uses prototype-based inheritance, even with class syntax.
- Both can run on servers; JavaScript is the standard language for browser scripting.
What the interviewer checks: The interviewer is checking whether you can distinguish their type systems, runtimes, and common uses.
Other ways it was asked
- “What is the difference between Java and JavaScript, and when would you use each?”
- “What is the difference between JavaScript and Java?”
When would you use Promise.all, Promise.allSettled, or sequential awaits, and how would you handle failures?
Asked in 6 of 172 interviews · last asked Oct 7 · Concept · Mid-level
Show answer
Use `Promise.all` for independent operations when you need every result. Use `Promise.allSettled` when partial success is useful and you need every outcome. Use sequential awaits when operations depend on earlier results or must run one at a time. Catch rejections from `Promise.all` and sequential awaits; with `Promise.allSettled`, inspect each result and handle failures individually.
- `Promise.all` rejects on the first rejection, but does not cancel other operations.
- `Promise.allSettled` waits for every operation and returns fulfilled values or rejection reasons.
- Both return results in input order, not completion order.
- For sequential execution, start each operation after the previous one finishes; awaiting already-started promises does not serialize them.
What the interviewer checks: The interviewer checks whether you can choose concurrency based on dependencies and handle partial or complete failure.
Other ways it was asked
- “What is the difference between Promise.all and Promise.allSettled?”
- “When you have multiple independent API calls, how do you decide between Promise.all, Promise.allSettled, and sequential awaits?”
- “When you write an async function that awaits multiple API calls, how do you decide between running them sequentially versus in parallel with Promise.all? And how do you handle partial failures?”
What’s the difference between null and undefined?
Asked in 5 of 172 interviews · last asked Sep 2 · Concept · Junior
Show answer
In JavaScript, `undefined` usually means a variable has no assigned value or a property is missing. `null` is normally set on purpose to mean “no value.” Both are primitive values, but they have different types.
- You can also explicitly assign `undefined`; it is not only produced automatically.
- `typeof undefined` returns `"undefined"`; `typeof null` returns `"object"` because of a historical JavaScript bug.
- `null == undefined` is true, but `null === undefined` is false.
What the interviewer checks: The interviewer is checking whether you understand missing values, intentional absence, and JavaScript’s type and equality rules.
Other ways it was asked
- “What is the difference between null and undefined?”
- “What is the difference between null and undefined in JavaScript?”
- “What is the difference between undefined and null?”
What does TypeScript add to JavaScript, and what benefits does it provide?
Asked in 5 of 172 interviews · last asked Aug 25 · Concept · Junior
Show answer
TypeScript adds static type checking to JavaScript, with features like type annotations, interfaces, and generics. It catches many type errors before code runs and improves autocomplete, code navigation, and refactoring. TypeScript compiles to JavaScript, so its types do not check data at runtime.
- Type inference often checks types without explicit annotations.
- Type definitions make function inputs and outputs clearer.
- Editor tools use types to suggest code and help rename symbols safely.
- Static checks do not replace tests or runtime validation of external data.
What the interviewer checks: The interviewer is checking whether you understand static typing, tooling benefits, and the limits of compile-time checks.
Other ways it was asked
- “Why use TypeScript, and what benefits does it offer?”
- “Can you explain why TypeScript is useful and what tooling it adds?”
- “What does TypeScript add on top of JavaScript, and what tooling benefits does it provide?”
What is the temporal dead zone, and how does it differ from accessing a hoisted var?
Asked in 4 of 172 interviews · last asked Sep 29 · Concept · Mid-level
Show answer
The temporal dead zone is the time from entering a scope until a `let` or `const` binding is initialized. Accessing it during this time throws a `ReferenceError`. A hoisted `var` starts as `undefined`, so reading it before any assignment returns `undefined`.
- `let` and `const` are hoisted, but remain uninitialized during the temporal dead zone.
- Even `typeof` throws a `ReferenceError` for a variable in its temporal dead zone.
- A `let` declaration without an initializer sets the variable to `undefined` when that declaration runs.
JavaScriptconsole.log(a); // undefined var a = 1; console.log(b); // ReferenceError: b is in its temporal dead zone let b = 2;What the interviewer checks: The interviewer is checking whether you distinguish hoisting from initialization and know when variable access throws an error.
Other ways it was asked
- “How would you explain the practical difference between a hoisted var being initialized to undefined and the temporal dead zone for let and const?”
- “How does the temporal dead zone affect access to a `let` or `const` variable before its declaration?”
- “What is the temporal dead zone?”
What is the difference between debouncing and throttling?
Asked in 4 of 172 interviews · last asked Oct 8 · Concept · Junior
Show answer
Debouncing groups repeated calls into one, usually after calls stop for a set time. Throttling limits how often a function runs while calls keep coming. Debouncing helps when you want the final input; throttling helps when you need regular updates.
- A typical debounce resets its timer on every call.
- Use debounce for search input and throttle for scroll updates.
- Both can support running at the start or end of a waiting period, depending on the implementation.
What the interviewer checks: The interviewer wants to know whether you can choose the right way to control frequent events.
Other ways it was asked
- “What is the difference between debounce and throttle?”
How is this determined in regular functions, method calls, and arrow functions?
Asked in 3 of 172 interviews · last asked Aug 11 · Concept · Mid-level
Show answer
For a regular function, `this` depends on how it is called. A plain call gives `undefined` in strict mode, or `globalThis` in non-strict mode. In `obj.method()`, `this` is `obj`. An arrow function gets `this` from its surrounding scope; calling it as a method does not change it.
- Calling an extracted method as a plain function loses its original object as `this`.
- `call`, `apply`, and `bind` can set `this` for regular functions.
- Arrow functions have no own `this`; `call`, `apply`, and `bind` cannot change it.
JavaScript"use strict"; function readThis() { return this; } const obj = { readThis, makeArrow() { return () => this; } }; console.log(readThis()); // undefined console.log(obj.readThis() === obj); // true const arrow = obj.makeArrow(); console.log(arrow.call({}) === obj); // trueWhat the interviewer checks: The interviewer checks whether you distinguish call-based `this` in regular functions from scope-based `this` in arrow functions.
Other ways it was asked
- “What does `this` refer to in JavaScript?”
- “How is `this` determined in JavaScript for a regular function call, a method call, and an arrow function?”
- “In strict mode, what does `this` evaluate to inside a regular function call, and how does that differ from an arrow function?”
Is JavaScript single-threaded or multithreaded, and how does it handle asynchronous work?
Asked in 3 of 172 interviews · last asked Aug 25 · Concept · Mid-level
Show answer
JavaScript runs one piece of code at a time on each thread. Browsers and Node.js handle asynchronous operations, such as timers and network requests. The event loop lets queued callbacks run when the call stack is empty. Workers allow JavaScript to run on separate threads.
- Asynchronous work does not mean JavaScript callbacks run in parallel on the same thread.
- Promise callbacks run as microtasks, before the next task, such as a timer callback.
- Long synchronous code blocks that thread, delaying queued callbacks.
What the interviewer checks: The interviewer checks whether you can separate JavaScript execution from runtime-managed asynchronous work and explain the event loop.
Other ways it was asked
- “JavaScript is single-threaded, so how does it handle asynchronous tasks?”
- “Is JavaScript single-threaded or multithreaded?”
JavaScript basics interview questions
Start with questions about variables, types, equality, scope, hoisting, control flow, and basic error handling. 40 questions.
Are let and const hoisted, and what happens if you access them before their declarations?
Asked in 2 of 172 interviews · last asked Apr 27 · Concept · Mid-level
Other ways it was asked
- “Are variables declared with `let` hoisted in JavaScript, and how does that work?”
- “How does hoisting work with let and const in JavaScript?”
What is a JavaScript variable?
Asked in 2 of 172 interviews · last asked Sep 12 · Concept · Junior
Other ways it was asked
- “What is a variable in JavaScript?”
How can you print the value of a variable to the console in JavaScript?
Asked in 2 of 172 interviews · last asked Sep 17 · Tooling · Junior
Why is JavaScript mainly used on websites?
Asked in 2 of 172 interviews · last asked Sep 17 · Concept · Junior
What are the different data types in JavaScript?
Asked in 2 of 172 interviews · last asked Oct 8 · Concept · Junior
Other ways it was asked
- “What are non-primitive data types in JavaScript?”
- “What data types are available in JavaScript and TypeScript?”
What changed from ES5 to ES6?
Asked in 2 of 172 interviews · last asked Jun 18 · Concept · Junior
Other ways it was asked
- “What changes were introduced in ECMAScript 6?”
- “What is ES6+?”
How do null and undefined behave with == versus === comparisons?
Asked once · last asked Jun 7 · Concept · Mid-level
If a variable is declared outside a block and a same-named `let` variable is declared inside it, what happens, and what is printed inside and outside the block?
Asked once · last asked Jun 18 · Scenario · Junior
How does JavaScript execute code, and what happens behind the scenes?
Asked once · last asked Jun 24 · Concept · Mid-level
In a complex JavaScript application, when would you still choose var, if ever, and what safeguards would you use to avoid bugs caused by unexpected undefined values?
Asked once · last asked Jul 27 · Scenario · Senior
What is the nullish coalescing operator, and how is it safer than the logical OR operator when zero is a valid value?
Asked once · last asked Sep 15 · Concept · Junior
What is the JavaScript Symbol type, and what is it used for?
Asked once · last asked Apr 4 · Concept · Junior
Show 21 more
What does the following code snippet do: console.log(11 + 31)?
Asked once · last asked Apr 13 · Write code · Junior
Can you explain what JavaScript is and where it is used?
Asked once · last asked Apr 16 · Concept · Junior
What types of scope exist in JavaScript?
Asked once · last asked Apr 27 · Concept · Junior
What is the spread operator in JavaScript?
Asked once · last asked May 22 · Concept · Junior
What is `let`?
Asked once · last asked Jun 18 · Concept · Junior
What do you mean by the scope chain?
Asked once · last asked Jun 24 · Concept · Junior
What is a loop?
Asked once · last asked Jul 15 · Concept · Junior
What are conditionals?
Asked once · last asked Jul 15 · Concept · Junior
How do you use try-catch blocks to handle errors?
Asked once · last asked Aug 4 · Concept · Junior
What is the difference between block scope and function scope?
Asked once · last asked Aug 4 · Concept · Junior
In JavaScript, what do parseFloat() and parseInt() do, and how do they differ?
Asked once · last asked Aug 12 · Concept · Junior
Could you briefly explain what a variable actually represents or stores in JavaScript?
Asked once · last asked Sep 12 · Concept · Junior
How does == perform type coercion before comparing in JavaScript, how does === compare without type conversion, and what example illustrates the difference?
Asked once · last asked Sep 17 · Concept · Junior
What is type coercion?
Asked once · last asked Sep 29 · Concept · Junior
In JavaScript, what exactly is constant about a variable declared with const?
Asked once · last asked Oct 3 · Concept · Junior
Other ways it was asked
- “What exactly is constant about const?”
What are the main features and benefits of JavaScript?
Asked once · last asked Oct 4 · Concept · Junior
What is `try/catch` used for in JavaScript?
Asked once · last asked Oct 8 · Concept · Junior
What is the difference between a constant and a variable?
Asked once · last asked Oct 15 · Concept · Junior
Are both let and const block-scoped in JavaScript, or only one of them?
Asked once · last asked Dec 29 · Concept · Junior
What is the scope of a var declaration in JavaScript?
Asked once · last asked Dec 29 · Concept · Junior
What does it mean that a variable declared with let can be reassigned?
Asked once · last asked Jan 20 · Concept · Junior
JavaScript functions and objects interview questions
Explore closures, function forms, this, binding, prototypes, classes, and inheritance. 28 questions.
What do `call`, `apply`, and `bind` do in JavaScript?
Asked once · last asked Apr 27 · Concept · Mid-level
Other ways it was asked
- “What do `call`, `apply`, and `bind` have in common in JavaScript?”
- “What is the difference between `call`, `apply`, and `bind` in JavaScript?”
Can you give an example of a higher-order function, preferably one you use regularly?
Asked once · last asked Dec 29 · Concept · Mid-level
What is a JavaScript generator, and what is it used for?
Asked once · last asked Apr 4 · Concept · Mid-level
In ES6 classes, how do you implement private state and ensure this is preserved when passing a method as a callback without manually binding everywhere?
Asked once · last asked Jul 26 · Concept · Senior
What bug can occur when an arrow function is used as an object method in a React app, and how can you avoid it?
Asked once · last asked Jul 27 · Scenario · Mid-level
When prototypal inheritance is used, how does JavaScript resolve a property lookup across an object's prototype chain, and what happens if a property is shadowed?
Asked once · last asked Aug 11 · Concept · Mid-level
Can callback functions be used in synchronous operations, and how are they used?
Asked once · last asked Aug 20 · Concept · Junior
Which function form is hoisted: function declaration or function expression?
Asked once · last asked Aug 25 · Concept · Mid-level
Can you explain prototype pollution in JavaScript?
Asked once · last asked Sep 30 · Concept · Senior
How does the `new` operator work in JavaScript?
Asked once · last asked Oct 7 · Concept · Mid-level
What is lexical scoping in JavaScript, and how does it affect variable access?
Asked once · last asked Oct 9 · Concept · Mid-level
How does bind affect the this value of an arrow function compared with a regular function?
Asked once · last asked Dec 29 · Concept · Mid-level
Other ways it was asked
- “Which type of function can you use bind with: an arrow function or a regular function?”
Show 14 more
Explain closure.
Asked once · last asked Jul 16 · Concept · Junior
What is the difference between a function expression and a function declaration?
Asked once · last asked Oct 6 · Concept · Junior
Other ways it was asked
- “What is the difference between a function expression and a function declaration, and when would you use each?”
What is a class in JavaScript?
Asked once · last asked Jun 23 · Concept · Junior
What is the benefit of closures?
Asked once · last asked Jun 24 · Concept · Junior
How do prototypal inheritance and classes relate in JavaScript?
Asked once · last asked Jul 20 · Concept · Junior
What is a return value in a function?
Asked once · last asked Jul 22 · Concept · Junior
What’s the difference between normal functions and arrow functions for error handling?
Asked once · last asked Aug 25 · Concept · Mid-level
What is a function in JavaScript?
Asked once · last asked Sep 12 · Concept · Junior
What is inheritance in JavaScript?
Asked once · last asked Oct 5 · Concept · Junior
Can you explain `yield` and `.next()`?
Asked once · last asked Oct 7 · Concept · Mid-level
What does `extends` mean in TypeScript and JavaScript?
Asked once · last asked Oct 8 · Concept · Junior
What is the difference between an arrow function and a regular function in JavaScript?
Asked once · last asked Dec 29 · Concept · Junior
What kinds of objects are there in JavaScript?
Asked once · last asked Jan 20 · Concept · Junior
Does a function that returns another function qualify as a higher-order function?
Asked once · last asked Jan 20 · Concept · Junior
JavaScript arrays and coding interview questions
Coding questions cover arrays, strings, JSON, object copying, type checks, and time and space complexity. 20 questions.
How do JavaScript's map, filter, and forEach methods differ?
Asked in 2 of 172 interviews · last asked Jul 20 · Concept · Junior
Other ways it was asked
- “When would you use JavaScript's map, filter, and forEach methods?”
- “How do the map, filter, reduce, and forEach methods differ in JavaScript?”
How can you copy an object in JavaScript, and which approaches would you consider?
Asked in 2 of 172 interviews · last asked Sep 30 · Concept · Mid-level
Other ways it was asked
- “How can you clone an object in JavaScript, and what approaches would you consider?”
- “How would you create a copy of an object in JavaScript?”
What is JSON?
Asked in 2 of 172 interviews · last asked Aug 27 · Concept · Junior
Can you explain what `reduce` does?
Asked in 2 of 172 interviews · last asked Oct 7 · Concept · Junior
Other ways it was asked
- “Can you explain the reduce method?”
How do you reason about time and space complexity in JavaScript, and how does that influence your choice of data structures when writing code?
Asked once · last asked May 15 · Concept · Senior
What is the difference between a JavaScript Map and an object?
Asked once · last asked May 28 · Concept · Mid-level
Other ways it was asked
- “When would you use a JavaScript Map instead of an object, or vice versa, and what advantages does a Map offer?”
Can you write a binary search implementation in JavaScript?
Asked once · last asked Jun 24 · Write code · Junior
What does the `map()` method do in JavaScript, and when would you use it?
Asked once · last asked Jul 31 · Concept · Junior
Given an array of objects, how would you select the ones whose score is greater than 45 in JavaScript? Write the code.
Asked once · last asked Aug 4 · Write code · Junior
In a bracket-matching algorithm, what does `last` refer to, and what does `stack[stack.length - 1]` access?
Asked once · last asked Aug 31 · Concept · Junior
Write JavaScript code that returns the first repeating character in a string.
Asked once · last asked Sep 11 · Write code · Junior
How do JavaScript arrays differ from ordinary JavaScript objects?
Asked once · last asked Sep 12 · Concept · Junior
Show 8 more
How would you parse a string containing multiple JSON objects when JSON.parse expects a single valid JSON value?
Asked once · last asked Oct 1 · Scenario · Mid-level
Write a function to check for a palindrome in JavaScript.
Asked once · last asked Oct 5 · Write code · Junior
Why might calling map on data result in a “data.map is not a function” error?
Asked once · last asked Oct 14 · Concept · Junior
What condition would you write in plain JavaScript to check whether a value is an object?
Asked once · last asked Jan 20 · Write code · Junior
How would you check whether a JavaScript value is a plain object, ensuring that arrays and other non-plain-object values are excluded?
Asked once · last asked Jan 20 · Concept · Mid-level
Other ways it was asked
- “Does that condition cover all cases, including arrays, and what else would you check to confirm that a value is a plain object?”
If you have an array of items and want to add one more item, how would you do it in JavaScript or TypeScript?
Asked once · last asked Aug 25 · Write code · Junior
What is the difference between find and filter?
Asked once · last asked Sep 2 · Concept · Junior
What is an array in JavaScript?
Asked once · last asked Sep 12 · Concept · Junior
JavaScript async and event loop interview questions
Check your understanding of callbacks, promises, async/await, timers, task scheduling, cancellation, and race conditions. 42 questions.
What are asynchronous operations in Node.js?
Asked in 3 of 172 interviews · last asked Oct 19 · Concept · Junior
Other ways it was asked
- “Can you clarify what exactly makes an operation asynchronous in Node.js and how it differs from synchronous ones?”
- “How does JavaScript handle asynchronous operations?”
What is the difference between promises and async/await in JavaScript?
Asked in 3 of 172 interviews · last asked Jul 28 · Concept · Junior
Show answer
A promise represents an asynchronous result that may succeed or fail. Async/await is syntax for working with promises, so it makes asynchronous code read more like normal step-by-step code. Use async/await for clear sequences, and promise methods such as `.then()` when chaining fits better.
- An async function always returns a promise.
- Await pauses the current async function, not the JavaScript thread.
- Use try/catch around awaited operations, or .catch() on a promise chain, to handle errors.
- For independent tasks, start them together and await Promise.all() instead of awaiting each task in sequence.
JavaScriptfunction getDataWithPromises(url) { return fetch(url).then(response => response.json()); } async function getDataWithAwait(url) { const response = await fetch(url); return response.json(); }What the interviewer checks: The interviewer checks whether you understand that async/await uses promises, including how waiting and error handling work.
Other ways it was asked
- “What is the difference between promises and async/await?”
- “What is the difference between promises, callbacks, and async/await?”
- “When would you use promises instead of async/await?”
How does awaiting versus returning a promise affect whether try/catch catches its rejection?
Asked in 2 of 172 interviews · last asked Jul 23 · Concept · Mid-level
Other ways it was asked
- “In async/await, what is the difference between returning await somePromise and returning somePromise inside an async function?”
- “If you write try { return somePromise; } catch (e) { ... } inside an async function, will the catch block run if the promise rejects?”
- “What happens if you forget await on a promise inside try/catch?”
What executes first: synchronous logging, a resolved promise callback, or a zero-delay setTimeout callback, and why?
Asked in 2 of 172 interviews · last asked Oct 1 · Concept · Mid-level
Other ways it was asked
- “What is the JavaScript event loop, and what is the execution order of setTimeout, a promise, and console.log?”
- “In what order will console.log run when one log is inside setTimeout with a zero delay, one is inside Promise.resolve, and one is a plain log?”
How do you cancel a fetch request with AbortController and distinguish cancellation from other errors?
Asked in 2 of 172 interviews · last asked Jul 16 · Concept · Mid-level
Other ways it was asked
- “How would you implement request cancellation with fetch using AbortController, and what should you do in catch to avoid treating an abort like a real error?”
- “What is AbortController, and how can you use it to cancel an in-flight request?”
What is the difference between setTimeout and setInterval in JavaScript?
Asked in 2 of 172 interviews · last asked Apr 16 · Concept · Junior
Other ways it was asked
- “Can you differentiate between setTimeout and setInterval?”
How can Node.js handle thousands of concurrent requests if JavaScript is single-threaded?
Asked once · last asked Jul 23 · Concept · Mid-level
How can Promise.all with map be used to handle multiple asynchronous operations?
Asked once · last asked Mar 29 · Concept · Mid-level
What is callback hell, and how can it be avoided?
Asked once · last asked Apr 16 · Concept · Mid-level
How can you run a function after all five promises have completed without using `await`?
Asked once · last asked Apr 27 · Write code · Mid-level
What are some common pitfalls you watch for when dealing with promises, and how do you avoid subtle bugs like unhandled rejections or race conditions?
Asked once · last asked May 15 · Concept · Senior
If five promises are passed to Promise.all and the third one rejects, will the fourth and fifth promises still execute?
Asked once · last asked Jun 24 · Scenario · Mid-level
Show 24 more
In Node.js, what are the event loop phases, where are setTimeout, setImmediate, and process.nextTick scheduled, and when can setImmediate run before setTimeout with a delay of zero?
Asked once · last asked Jul 3 · Concept · Senior
In a REST API handler, what problems can heavy promise or microtask chains cause for latency and throughput, and how would you mitigate them without changing correctness?
Asked once · last asked Jul 3 · Scenario · Senior
If you await inside a for...of loop over async operations, how does that affect concurrency compared to using Promise.all, and when would you choose each?
Asked once · last asked Jul 16 · Concept · Mid-level
How do you handle errors in async code, and what's the difference between callbacks, async/await, and promises?
Asked once · last asked Jul 23 · Concept · Mid-level
What is the exact log order of this code, and why? console.log(a); setTimeout(() => console.log(b), 0); Promise.resolve().then(() => console.log(c)); console.log(f); async function d() { console.log(d); await 0; console.log(e); } d();
Asked once · last asked Jul 26 · Write code · Mid-level
How would you implement an async function that fetches data from multiple cards, renders them as each resolves, and still handles partial failures without blocking the rest?
Asked once · last asked Jul 26 · Write code · Senior
When would you choose Promise.allSettled over Promise.all with per-promise catch, and what are the tradeoffs for error visibility and cancellation or abort behavior?
Asked once · last asked Jul 26 · Concept · Senior
In a fetch wrapper using async/await, how would you implement request deduplication so concurrent calls to the same URL share one in-flight promise, and the cache is cleared after it settles?
Asked once · last asked Jul 26 · Write code · Senior
How would you prevent an older request from overwriting newer UI data when it resolves late, using modern JavaScript patterns?
Asked once · last asked Jul 26 · Scenario · Senior
What does setTimeout actually do?
Asked once · last asked Jul 31 · Concept · Junior
How does the JavaScript event loop handle a synchronous for loop that runs a million times?
Asked once · last asked Sep 23 · Concept · Mid-level
How would you implement `Promise.all`, and what edge cases would you account for?
Asked once · last asked Oct 7 · Write code · Senior
In a debounced search component, the first two API responses update the browser, but the third and fourth do not. What could cause this, and how would you troubleshoot it?
Asked once · last asked Oct 12 · Scenario · Senior
When integrating back-end APIs into your front-end projects, how do you typically manage asynchronous data fetching to ensure smooth user interactions?
Asked once · last asked Oct 16 · Scenario · Mid-level
What happens when a setInterval callback takes longer than its delay, and can callbacks overlap?
Asked once · last asked Dec 29 · Concept · Mid-level
Other ways it was asked
- “If a setInterval callback takes longer than the interval delay to complete, when does the next callback run?”
- “Can setInterval callbacks overlap, or can delays cause many callbacks to run at the same time?”
How can you use recursive setTimeout calls to achieve behavior similar to setInterval?
Asked once · last asked Dec 29 · Concept · Mid-level
What is the difference between synchronous and asynchronous JavaScript?
Asked once · last asked May 29 · Concept · Junior
How does error handling work with try/catch and promises in JavaScript?
Asked once · last asked Jul 20 · Concept · Mid-level
What are microtasks in JavaScript?
Asked once · last asked Aug 25 · Concept · Junior
How can you call a REST API from a front end?
Asked once · last asked Sep 30 · Concept · Junior
What does synchronous execution mean in JavaScript?
Asked once · last asked Oct 5 · Concept · Junior
What is the difference between callbacks and promises?
Asked once · last asked Oct 7 · Concept · Junior
What is asynchrony in JavaScript, and how does it work?
Asked once · last asked Oct 8 · Concept · Mid-level
Is JavaScript synchronous or asynchronous by default?
Asked once · last asked Oct 19 · Concept · Junior
JavaScript DOM and browser interview questions
Browser questions cover DOM changes, events, storage, security, forms, accessibility, Canvas, and jQuery. 33 questions.
How do localStorage and sessionStorage differ, and which would you use for a theme preference?
Asked in 3 of 172 interviews · last asked Oct 22 · Concept · Junior
Other ways it was asked
- “What is the difference between local storage and session storage in web browsers?”
- “What is the difference between cookies, local storage, and session storage in the browser?”
- “Should theme details be stored in localStorage or sessionStorage?”
How would you implement a button on a contact form that validates the entered address with the Google Maps API, displays whether it is valid, returns the result before the user saves, and prevents saving until validation succeeds?
Asked once · last asked Apr 4 · Scenario · Senior
What kind of code can an attacker cause a browser to execute through an XSS vulnerability?
Asked once · last asked Apr 9 · Concept · Mid-level
How do you select an element in the DOM using JavaScript? Which method or keyword would you use?
Asked once · last asked May 22 · Concept · Junior
Can you elaborate on how you would use the Canvas element in a real-world project, and what kinds of applications could benefit from it?
Asked once · last asked May 23 · Tooling · Junior
How would you use localStorage to persist a user's theme preference across pages?
Asked once · last asked Jun 5 · Scenario · Mid-level
Other ways it was asked
- “How would you persist a user's selected theme when they navigate to another page?”
- “What is localStorage, and when would you use it to persist a user's theme preference?”
How do you ensure keyboard accessibility for a custom dropdown component using HTML, CSS, and JS, including ARIA considerations?
Asked once · last asked Jul 26 · Scenario · Mid-level
In jQuery, what is the difference between .html(), .text(), and .val()?
Asked once · last asked Aug 12 · Concept · Junior
In jQuery, what is the difference between .on() and .click()?
Asked once · last asked Aug 12 · Concept · Mid-level
In jQuery, what is the difference between append() and before()?
Asked once · last asked Aug 12 · Concept · Junior
What are MutationObserver objects in JavaScript, and what do they do?
Asked once · last asked Aug 25 · Concept · Mid-level
What causes a click on a nested button to trigger a parent handler, and how can you prevent it?
Asked once · last asked Aug 25 · Scenario · Mid-level
Show 20 more
What happens if a JWT is stored only in memory and the page is refreshed?
Asked once · last asked Sep 3 · Scenario · Junior
How would you handle dynamic, reactive websites where content adapts in real time to user behavior?
Asked once · last asked Sep 29 · Scenario · Mid-level
Why might a cross-origin script fail to load or execute, and under what conditions can it be used?
Asked once · last asked Oct 1 · Concept · Mid-level
Other ways it was asked
- “Under what conditions can cross-origin scripts be used?”
How would you use JavaScript to find containers and child elements whose content extends beyond the container?
Asked once · last asked Oct 2 · Write code · Mid-level
Can you explain event delegation?
Asked once · last asked Oct 7 · Concept · Mid-level
How would you detect when a user has scrolled 85% of the page to trigger fetching the next page in an infinite scroll implementation?
Asked once · last asked Oct 8 · Scenario · Mid-level
How can you handle a dynamic scroll threshold as new pages increase the total scrollable length in an infinite scroll implementation?
Asked once · last asked Oct 8 · Scenario · Mid-level
What is the Intersection Observer API, and how is it implemented?
Asked once · last asked Oct 8 · Concept · Mid-level
How would you implement an infinite-scroll social media feed?
Asked once · last asked Oct 12 · Design · Senior
Other ways it was asked
- “If I build a Facebook-like infinite scroll feed, how would I implement it?”
How do you handle localization and globalization in the frontend?
Asked once · last asked Oct 19 · Concept · Mid-level
Can you create a restaurant website using HTML, CSS, and JavaScript?
Asked once · last asked Feb 2 · Write code · Junior
Why is jQuery used in frontend development?
Asked once · last asked Mar 24 · Tooling · Junior
If you have to scroll down a page, how can you do that using JavaScript? Can you write the syntax for it?
Asked once · last asked Apr 22 · Write code · Junior
What is jQuery?
Asked once · last asked Aug 12 · Concept · Junior
What does jQuery's .click() method do, and how do you use it?
Asked once · last asked Aug 12 · Tooling · Junior
How would you use keyboard key codes to restrict a text box to numeric input?
Asked once · last asked Aug 12 · Scenario · Junior
What is getElementById?
Asked once · last asked Aug 12 · Concept · Junior
What are JavaScript events?
Asked once · last asked Aug 13 · Concept · Junior
Please explain what a JavaScript API is.
Asked once · last asked Sep 4 · Concept · Junior
How do you track the current page in an infinite scroll implementation?
Asked once · last asked Oct 8 · Scenario · Mid-level
React, Redux and RxJS interview questions
Work through questions on React rendering, hooks, shared state, Redux, server-state management, observables, and signals. 39 questions.
How is an observable different from a promise?
Asked in 2 of 172 interviews · last asked Oct 15 · Concept · Junior
Other ways it was asked
- “What is the difference between a promise and an observable?”
How do you use AbortController with React effect cleanup to cancel outdated requests and requests on unmount?
Asked in 2 of 172 interviews · last asked Jul 26 · Scenario · Senior
Other ways it was asked
- “In React, where would you create and store the AbortController, and how would you ensure it aborts on unmount or when a new request starts?”
- “In React 18, if the user types into a search box and you fetch suggestions on each keystroke, how would you structure this with useEffect cleanup and AbortController to avoid both stale updates and wasted network?”
How do you prevent promise callbacks from updating React state after unmount or a newer request?
Asked in 2 of 172 interviews · last asked Jul 16 · Scenario · Mid-level
Other ways it was asked
- “How do you prevent setting state from a resolved promise after a component unmounts or after a newer request has already started?”
- “How would you prevent a React component from updating state after it has unmounted?”
What is the virtual DOM, and how is it used in frontend development?
Asked in 2 of 172 interviews · last asked May 26 · Concept · Junior
Other ways it was asked
- “What is the virtual DOM, and how does it work?”
What is the difference between React and plain JavaScript in terms of their core purposes and functionalities?
Asked in 2 of 172 interviews · last asked Sep 13 · Concept · Junior
Other ways it was asked
- “What is the difference between React and plain JavaScript?”
Do you know the differences between signals and RxJS?
Asked once · last asked Mar 24 · Concept · Mid-level
Other ways it was asked
- “When would you use signals, and when would you use RxJS?”
What design pattern does the RxJS library implement?
Asked once · last asked Mar 24 · Concept · Mid-level
What is a cold observable?
Asked once · last asked Mar 24 · Concept · Mid-level
What is a subscription in RxJS, and what is its purpose?
Asked once · last asked Mar 24 · Concept · Junior
Other ways it was asked
- “What is a subscription, and what is its purpose?”
What is hydration in web applications?
Asked once · last asked Mar 24 · Concept · Mid-level
Other ways it was asked
- “What is hydration?”
How do Angular Signals differ from Observables?
Asked once · last asked Mar 27 · Concept · Mid-level
Why was `bind` commonly used in older versions of React?
Asked once · last asked Apr 27 · Concept · Mid-level
Show 26 more
Can you build a simple counter component in React using JavaScript?
Asked once · last asked May 26 · Write code · Junior
How can a child component communicate with its parent?
Asked once · last asked Jun 18 · Concept · Junior
In React, how does JavaScript closure behavior affect useEffect or event handlers, and how do you avoid stale state or props?
Asked once · last asked Jul 3 · Concept · Senior
When a user clicks a Generate button in React, what happens, and how do you pass request parameters?
Asked once · last asked Jul 30 · Tooling · Mid-level
What is the virtual DOM in React? Also, explain the event loop in Node.js.
Asked once · last asked Aug 10 · Concept · Junior
When I click a button in a React component and expect a list of products from an API, what are the steps from click to the list showing on the screen?
Asked once · last asked Sep 2 · Scenario · Mid-level
In React, can you write code to fetch data from multiple APIs simultaneously and show it in the UI?
Asked once · last asked Sep 17 · Write code · Mid-level
How do you send a POST request to an API from a React frontend?
Asked once · last asked Sep 30 · Tooling · Junior
How do you model derived server state such as loading, error, data, pagination, and cache invalidation versus UI state, and where do you draw the boundary?
Asked once · last asked Oct 3 · Design · Senior
How would you implement optimistic updates for a mutation in Redux Toolkit, including rollback on failure while keeping derived selectors consistent?
Asked once · last asked Oct 3 · Scenario · Senior
How can one part of a user interface immediately update another, such as a cart count or account balance?
Asked once · last asked Oct 9 · Scenario · Mid-level
What are higher-order operators in RxJS, and when would you use them in an Angular application?
Asked once · last asked Oct 9 · Concept · Mid-level
How can I use the user details from the login response on later pages without another database call or API request?
Asked once · last asked Oct 10 · Scenario · Mid-level
In a React application with two pages, how would you implement a timer that pauses when the user navigates away and resumes from its previous value when they return?
Asked once · last asked Oct 12 · Scenario · Mid-level
Other ways it was asked
- “In React, I have two pages. A timer is increasing, and when the user navigates to another page, the timer should pause. When the user returns to the timer page, it should restart from where it previously stopped. How do you resolve it?”
How can Redux handle asynchronous operations, and what role does Redux Saga play?
Asked once · last asked Oct 15 · Concept · Mid-level
How would you implement image uploads, pagination, and Excel import/export in a React application?
Asked once · last asked Oct 23 · Scenario · Mid-level
What limitations does the Fetch API have, and what problems does React Query help solve?
Asked once · last asked Dec 29 · Concept · Mid-level
Does Redux manage page state or application state?
Asked once · last asked Oct 10 · Concept · Junior
What is an RxJS observable, and how would you explain it?
Asked once · last asked Mar 24 · Concept · Junior
How do you handle errors in Observables?
Asked once · last asked Apr 16 · Concept · Mid-level
What are the core JavaScript concepts used in React?
Asked once · last asked Jun 4 · Concept · Mid-level
How do actions and reducers work in Redux?
Asked once · last asked Jun 19 · Concept · Junior
What are TypeScript and RxJS, and can you explain components, modules, promises, and switchMap?
Asked once · last asked Aug 10 · Concept · Junior
What is the difference between pipe and filter?
Asked once · last asked Sep 2 · Concept · Junior
What is a closure in React?
Asked once · last asked Oct 6 · Concept · Mid-level
What is RxJS?
Asked once · last asked Oct 15 · Concept · Junior
Node.js, TypeScript and JavaScript tooling interview questions
These questions cover Node.js, TypeScript, modules, packages, bundlers, React Native, and integrations with ServiceNow and Dynamics 365. 20 questions.
How do you configure or extend Vite for a frontend project?
Asked once · last asked Mar 24 · Tooling · Mid-level
How is Node.js different from JavaScript in the browser?
Asked once · last asked Mar 26 · Concept · Junior
In Dynamics 365 JavaScript, how would you use a selected country lookup's GUID to retrieve the country record's ISO short name and populate it on the account?
Asked once · last asked Apr 4 · Tooling · Mid-level
Can impersonation be implemented in JavaScript in Dynamics 365?
Asked once · last asked Apr 6 · Concept · Mid-level
Write a JavaScript function for a Dynamics 365 contact form that makes one field read-only based on the value of another field.
Asked once · last asked Apr 6 · Write code · Mid-level
Can you invoke Microsoft Dynamics 365 actions from JavaScript?
Asked once · last asked Apr 16 · Concept · Mid-level
Can you give a quick example of what TypeScript catches that plain JavaScript wouldn’t?
Asked once · last asked Jul 20 · Concept · Junior
Should dependency lock files be committed, and how do they help ensure reproducible installs?
Asked once · last asked Sep 7 · Concept · Mid-level
Other ways it was asked
- “If you install several dependencies and the project generates lock JSON files, would you commit those files to the repository?”
- “How can you ensure reproducible, predictable installs across environments, and should dependency lock files be committed?”
In ES modules, how do import bindings behave compared to const? Can an imported value be reassigned, and why?
Asked once · last asked Oct 3 · Concept · Mid-level
Can you explain the four core pillars of webpack: entry, output, loaders, and plugins?
Asked once · last asked Oct 7 · Concept · Mid-level
In React Native development, what is Hermes, why might an app use it, and what is the purpose of the node_modules folder and why can it be large?
Asked once · last asked Oct 7 · Concept · Mid-level
Other ways it was asked
- “What is Hermes, and why might a React Native app use it? What is the node_modules folder, and why can it be large?”
What is Ajax, and how is it used in ServiceNow?
Asked once · last asked Oct 9 · Concept · Mid-level
Show 6 more
What is the latest JavaScript version available on ServiceNow?
Asked once · last asked Oct 9 · Concept · Mid-level
Other ways it was asked
- “What version of JavaScript was ServiceNow on for the longest time before upgrading?”
How would you pass a variable value from the server side to the client side in a ServiceNow widget?
Asked once · last asked Oct 9 · Tooling · Mid-level
Other ways it was asked
- “If I needed to move a variable value from server side to the client side inside of a widget, how would I do that?”
In Node.js, how do you prevent a single unhandled promise or thrown error from crashing a production service while still failing requests correctly?
Asked once · last asked Oct 24 · Scenario · Senior
What are the two TypeScript types that are not represented in JavaScript?
Asked once · last asked Aug 25 · Concept · Mid-level
How do you assign a module imported with `require` to a variable in JavaScript?
Asked once · last asked Sep 11 · Concept · Junior
How does `var` work in TypeScript?
Asked once · last asked Oct 7 · Concept · Junior
JavaScript performance and memory interview questions
Performance and memory questions explore loading, debouncing, throttling, profiling, workers, garbage collection, and memory leaks. 20 questions.
What is debouncing, and when would you use it?
Asked in 3 of 172 interviews · last asked Oct 19 · Concept · Junior
Other ways it was asked
- “Can you explain the concept of debouncing?”
- “What is debouncing?”
How do async and defer affect script loading, execution order, and parser blocking?
Asked in 2 of 172 interviews · last asked Aug 25 · Concept · Junior
Other ways it was asked
- “What is the difference between async and defer?”
- “When would you use async, and when would you use defer?”
- “What is the difference between async and defer on script tags?”
How do you decide whether to transpile modern JavaScript features or ship polyfills for cross-browser support?
Asked once · last asked Jul 16 · Concept · Mid-level
How would you load modern and legacy bundles using module/nomodule while handling older browser quirks?
Asked once · last asked Jul 16 · Scenario · Senior
Other ways it was asked
- “If you ship differential bundles, modern plus legacy, what’s your approach to loading the right one across browsers without breaking older Safari or IE?”
- “What specific cross-browser edge case have you had to handle with the module/no-module approach, for example older Safari quirks, and how did you mitigate it?”
If you find the LCP text is delayed because the main thread is busy, how do you pinpoint what’s blocking it in DevTools?
Asked once · last asked Jul 16 · Scenario · Senior
When would you use async rather than defer for a script?
Asked once · last asked Aug 25 · Scenario · Mid-level
What problems can arise when a JavaScript function runs for one second, and how can you address them?
Asked once · last asked Oct 2 · Scenario · Mid-level
How can you move JavaScript computation to a separate thread so it does not block the UI thread?
Asked once · last asked Oct 2 · Concept · Mid-level
How do you debug and fix a memory leak in a long-running single-page application caused by event listeners or timers, and what steps and tooling do you use?
Asked once · last asked Oct 3 · Scenario · Senior
How would you use WeakMap or WeakSet to prevent memory leaks when associating metadata with DOM nodes or object keys?
Asked once · last asked Oct 3 · Concept · Senior
How does multithreading or parallel processing work in JavaScript or Python?
Asked once · last asked Oct 7 · Concept · Mid-level
How does a JavaScript engine optimize code at runtime, and what are hidden classes, inline caching, and deoptimization?
Asked once · last asked Oct 7 · Concept · Senior
Show 7 more
How does garbage collection work in V8, including generational, minor, and major collection, and what constitutes a memory leak in JavaScript?
Asked once · last asked Oct 7 · Concept · Senior
Other ways it was asked
- “How does garbage collection work in V8, and what are generational, minor, and major garbage collection and a JavaScript memory leak?”
For product search input, would you use debouncing or throttling, and why?
Asked once · last asked Oct 8 · Scenario · Mid-level
If resources are imported into a product listing page component and included in the bundle, how would you defer loading them?
Asked once · last asked Oct 8 · Scenario · Senior
How would you implement lazy loading in a web application?
Asked once · last asked Oct 8 · Concept · Mid-level
Other ways it was asked
- “How would you implement lazy loading on the server side?”
What does the JavaScript garbage collector do?
Asked once · last asked Apr 4 · Concept · Junior
What is debounce?
Asked once · last asked Aug 10 · Concept · Junior
Can you briefly explain how polyfills work?
Asked once · last asked Oct 22 · Concept · Junior
JavaScript testing and code design interview questions
Test your knowledge of testing tools, debugging tests, edge cases, refactoring, regression prevention, and reusable application design. 14 questions.
How would you structure a JavaScript Playwright automation framework?
Asked once · last asked Sep 11 · Tooling · Mid-level
Other ways it was asked
- “How is your JavaScript Playwright automation framework structured?”
- “How is your JavaScript Playwright automation framework structured, and what techniques do you use?”
How do you evaluate whether JavaScript code is structured so that new features can be added without introducing regressions?
Asked once · last asked May 15 · Scenario · Senior
Can you provide a detailed example of when you refactored existing JavaScript code to improve its structure, reduce duplication, or clarify logic?
Asked once · last asked May 15 · Behavioral · Senior
How do you verify that a JavaScript refactor has not introduced bugs or regressions?
Asked once · last asked May 15 · Scenario · Senior
How do you assess the correctness and edge-case coverage of a non-trivial JavaScript function that manipulates arrays or objects?
Asked once · last asked May 15 · Scenario · Senior
In a Playwright test, what happens if you omit `await` from an asynchronous action? Will the test still run or produce an error?
Asked once · last asked Jun 22 · Concept · Junior
Why can mixing Cypress commands such as cy.get() with a native JavaScript Promise cause problems?
Asked once · last asked Sep 1 · Concept · Mid-level
How would you write a JavaScript Playwright test for a login flow?
Asked once · last asked Sep 11 · Write code · Mid-level
Why are Playwright test functions asynchronous, and what does `async` mean in a test?
Asked once · last asked Sep 11 · Concept · Mid-level
How would you organize a vanilla JavaScript payment flow with forms, OTP services, and confirmation so it can be reused across screens and handle errors?
Asked once · last asked Oct 20 · Design · Mid-level
Why might you use JavaScript within Python-based Selenium or Playwright tests?
Asked once · last asked Oct 22 · Tooling · Mid-level
What input conditions should cause a JavaScript function to produce an error?
Asked once · last asked Mar 20 · Scenario · Junior
Show 2 more
How do you identify and fix errors in a JavaScript test file?
Asked once · last asked Sep 11 · Scenario · Mid-level
What is the difference between imperative and declarative programming?
Asked once · last asked Dec 18 · Concept · Junior
Live coding round next? Coding mode in the MeetAssist desktop app solves the problem on your screen, with your phone as the remote.
Related interview questions
- Software Engineer interview questions
- QA Engineer interview questions
- Cybersecurity interview questions
- Python interview questions
- Java interview questions
- TypeScript interview questions
- C# and .NET interview questions
- C++ interview questions
- PHP and Laravel interview questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every JavaScript interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
172 interviews, 132 candidates, Nov 2025 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension