Javascript Interview Questions

Browse through all 45 Javascript interview questions and challenges below.

Type:
Sort:
Difficulty:

Understand the differences in scope, this binding, and syntax between arrow and traditional functions.

beginnerfundamentalsjavascriptarrow functionsthis

Learn how callback functions work and why they are essential for asynchronous programming in JavaScript.

beginnerfundamentalsjavascriptcallbacksasynchronous

Explore different ways to clone objects and arrays without mutating the original data.

beginnerfundamentalsjavascriptcloneobjects

Understand the primitive and non-primitive data types in JavaScript and how they differ.

beginnerfundamentalsjavascriptdata typesbasics

Learn why strict equality (===) avoids unexpected type coercion in JavaScript.

beginnerfundamentalsjavascriptequalitytype coercion

Learn how JavaScript moves variable and function declarations to the top of their scope.

beginnerfundamentalsjavascripthoistingscope

Learn how variable declarations differ in scope and behavior in modern JavaScript.

beginnerfundamentalsjavascriptscopevariables

Understand how spread and rest operators simplify working with arrays, objects, and functions.

beginnerfundamentalsjavascriptspreadrest

Master ES6 template literals for cleaner string concatenation and embedded expressions.

beginnerfundamentalsjavascripttemplate literalses6

Learn which values evaluate to true or false in JavaScript conditionals.

beginnerfundamentalsjavascripttruthyfalsy

Learn to build a robust retry mechanism for failed API calls, handling transient network errors gracefully.

intermediateasync and-promisesjavascriptpromisesretry

Understand how JavaScript handles tasks, microtasks, and macrotasks and how to predict async execution order.

intermediateasync and-promisesjavascriptevent looppromises

Avoid inconsistent state in JavaScript apps by managing promise resolution order in concurrent async operations.

intermediateasync and-promisesjavascriptasyncrace condition

Use event delegation to reduce listeners, support dynamic elements, and improve performance with advanced patterns.

intermediatebrowser and-domjavascriptevent delegationdom

Build a lightweight lazy-loading system that defers image downloads until images approach the viewport.

intermediatebrowser and-domjavascriptlazy-loadingimages

Learn how to create a custom debounce function that supports leading-edge, trailing-edge, or both firing modes.

intermediateperformance optimizationjavascriptdebounceperformance

Build a high-performance resize handler using timestamp-based throttle and requestAnimationFrame to avoid layout thrashing.

intermediateperformance optimizationjavascriptthrottleresize

Learn how async/await simplifies asynchronous JavaScript code built on top of Promises.

intermediateintermediate conceptsjavascriptasync/awaitpromises

Learn how call, apply, and bind control the "this" context and pass arguments to functions dynamically.

intermediateintermediate conceptsjavascriptthisfunctions

Understand closures in JavaScript — how inner functions remember variables from their parent scope.

intermediateintermediate conceptsjavascriptclosuresscope