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.
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.
var is function-scoped and hoisted as undefined. let and const are block-scoped and not accessible before declaration (TDZ). const additionally prevents reassignment.
The event loop processes tasks from the call stack and queues. Synchronous code runs first, then microtasks (Promise.then, queueMicrotask), then macrotasks (setTimeout, setInterval).
== performs type coercion before comparison. === compares both value and type without coercion. null == undefined is true but null === undefined is false.
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.
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.
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.
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.
Focus on why JavaScript behaves the way it does — coercion rules, event loop mechanics, closure semantics. Interviewers can tell the difference.
Use output quiz questions to train your mental model. If you can predict what code logs, you truly understand the concept.
Practice with buggy code that produces wrong output silently — not syntax errors. Real interview bugs are always logical, not typos.
Closures, this binding, event loop, prototypes, async/await, type coercion, hoisting, and ES6+ features cover 90% of JavaScript interviews.
Razorpay loves event loop. Flipkart tests closures heavily. Google digs into prototypes and generators. Know which concepts each company emphasizes.
Use the Sprint feature — 10 questions in 15 minutes. Interview pressure is real and you can train for it.
Interactive questions with instant feedback. Predict outputs, find bugs, and master JavaScript.