JavaScript Interview Prep

200+ JavaScript Interview Questions

Comprehensive JavaScript interview prep covering closures, event loop, promises, async/await, prototypes, this keyword, type coercion and more. Questions asked at Razorpay, Flipkart, Google, Atlassian, Swiggy, CRED and other top tech companies.

🚀 Practice Now — It's Free💻 Output Quiz🐛 Debug Lab
Loading questions…

Core JavaScript Topics

Closures & ScopeEvent Loop & AsyncExecution ContextPrototypes & InheritanceType CoercionHoisting & TDZBrowse All Topics →

Frequently Asked Interview Questions

What is a closure in JavaScript?

A closure is a function that retains access to its outer scope even after the outer function has returned. It captures the variable binding, not the value at definition time.

What is the difference between var, let, and const?

var is function-scoped and hoisted as undefined. let and const are block-scoped and not accessible before declaration (TDZ). const additionally prevents reassignment.

What is the event loop in JavaScript?

The event loop processes tasks from the call stack and queues. Synchronous code runs first, then microtasks (Promise.then, queueMicrotask), then macrotasks (setTimeout, setInterval).

What is the difference between == and === in JavaScript?

== performs type coercion before comparison. === compares both value and type without coercion. null == undefined is true but null === undefined is false.

How does prototypal inheritance work in JavaScript?

Objects inherit properties from their prototype chain. When accessing a property, JavaScript walks up the chain until it finds the property or reaches null. Object.create() sets the prototype directly.

What is async/await in JavaScript?

async/await is syntactic sugar over Promises. An async function always returns a Promise. await pauses execution inside the async function until the Promise settles, then resumes as a microtask.

What is the difference between null and undefined?

undefined means a variable has been declared but not assigned. null is an explicit assignment meaning "no value". typeof null returns "object" — a historic JavaScript bug.

How does hoisting work in JavaScript?

var declarations are moved to the top of their function scope at compile time, initialized as undefined. Function declarations are fully hoisted. let and const are hoisted but stay in the TDZ until the declaration is reached.

How to Prepare for JavaScript Interviews

🧠

Understand, don't memorize

Focus on why JavaScript behaves the way it does — coercion rules, event loop mechanics, closure semantics. Interviewers can tell the difference.

💻

Predict output before running

Use output quiz questions to train your mental model. If you can predict what code logs, you truly understand the concept.

🐛

Debug real bugs

Practice with buggy code that produces wrong output silently — not syntax errors. Real interview bugs are always logical, not typos.

📐

Master the big 8 concepts

Closures, this binding, event loop, prototypes, async/await, type coercion, hoisting, and ES6+ features cover 90% of JavaScript interviews.

🏢

Company patterns vary

Razorpay loves event loop. Flipkart tests closures heavily. Google digs into prototypes and generators. Know which concepts each company emphasizes.

⏱️

Practice under time pressure

Use the Sprint feature — 10 questions in 15 minutes. Interview pressure is real and you can train for it.

Related Resources

Ready to practice?

Interactive questions with instant feedback. Predict outputs, find bugs, and master JavaScript.

Start Practicing Free →⚡ Daily Sprint