11 JS Interview Questions That Stump Indian Freshers
11 JavaScript interview questions that trip up Indian freshers most often, with clear answers for closures, event loop, this keyword, promises, and DOM manipulation.

11 JS Interview Questions That Stump Indian Freshers
JavaScript developer roles are booming in India — Naukri lists over 64,000 fresher JS jobs — but most freshers walk into technical rounds unprepared for the concepts Indian recruiters actually test. After sitting in on dozens of campus placement technical rounds, I've seen the same 11 questions knock out candidates repeatedly. Here's what they are, why they trip people up, and how to answer each one cleanly.
1. What is a closure?
A closure is a function that remembers variables from its outer scope even after the outer function has returned. Recruiters test this because it underpins data privacy and callbacks in real applications. Example: function counter() { let count = 0; return () => ++count; } — the inner function keeps accessing count after counter() finishes. If you can explain this with a practical use case like event handlers or memoization, you're ahead of 80% of freshers.
2. What's the difference between var, let, and const?
var is function-scoped and hoisted with a default value of undefined. let and const are block-scoped and hoisted but stay in a temporal dead zone until declared. const prevents reassignment but doesn't freeze objects — a common follow-up. Indian tech companies like those hiring JS freshers on Glassdoor ask this in nearly every first round because it reveals whether you understand scope, not just syntax.
3. What is hoisting?
Hoisting moves variable and function declarations to the top of their scope before code execution. Function declarations are fully hoisted — you can call them before they appear in code. var variables are hoisted but initialized as undefined, which causes the classic "undefined before assignment" bug. let and const are hoisted but throw a ReferenceError if accessed before declaration (temporal dead zone).
4. Explain the event loop
JavaScript is single-threaded but handles async operations through the event loop. The call stack runs synchronous code. Web APIs handle timers, DOM events, and fetch in the background. Callbacks queue up in the task queue (or microtask queue for Promises). The event loop constantly checks: if the call stack is empty, it pushes the next callback from the queue. This is why setTimeout(fn, 0) doesn't run immediately — it waits for the stack to clear.
5. What's the difference between == and ===?
== compares values with type coercion — 0 == false returns true. === compares both value and type strictly — 0 === false returns false. Always use === in production code. This seems trivial, but recruiters use it to check if you understand type coercion edge cases like "" == 0 (true) vs "" === 0 (false).
6. How do arrow functions differ from regular functions?
Arrow functions don't have their own this binding — they inherit this from the enclosing scope. They also can't be used as constructors and don't have an arguments object. This matters in React class components and callback-heavy code where this binding used to require .bind(this). If you've built any mock interview practice projects with React, you've likely hit this already.
7. What is a Promise and how does async/await work?
A Promise represents a value that may not be available yet — it has three states: pending, fulfilled, rejected. async/await is syntactic sugar over Promises that lets you write asynchronous code that reads like synchronous code. await pauses the function until the Promise resolves. Wrap await in try/catch for error handling. Recruiters often ask you to convert a .then() chain to async/await on a whiteboard.
8. Explain the 'this' keyword
this refers to the object that's executing the current function. In a regular function call, this is the global object (window in browsers, global in Node.js). In a method call, this is the object before the dot. Arrow functions inherit this from their lexical scope. call, apply, and bind let you set this explicitly. This is the single most asked JS concept in Indian technical interviews.
9. What's the difference between null and undefined?
undefined means a variable is declared but not assigned a value. null is an intentional assignment representing "no value." typeof undefined is "undefined", but typeof null is "object" — a known JavaScript bug. Use null when you deliberately want to indicate emptiness; undefined is JavaScript's default for missing values.
10. What is prototypal inheritance?
Every JavaScript object has a prototype (accessed via __proto__ or Object.getPrototypeOf()). When you access a property, JS looks on the object first, then walks up the prototype chain until it finds the property or reaches null. This is different from class-based inheritance in Java — JS uses objects inheriting from objects. ES6 class syntax is syntactic sugar over this prototype system.
11. What is the DOM and how do you manipulate it?
The DOM (Document Object Model) is the tree-like representation of an HTML page. You manipulate it with methods like document.getElementById(), querySelector(), addEventListener(), and createElement(). Recruiters often give a small task: "Add a button that toggles a paragraph's visibility." If you can do this without looking up syntax, you're interview-ready for frontend rounds.
Salary Reality for JS Freshers in India
JavaScript fresher salaries in India range from ₹3.5–6 LPA for service companies (TCS, Infosys, Wipro) to ₹8–15 LPA for product startups and unicorns like Razorpay, Zerodha, and Swiggy. The gap is mostly about how well you handle exactly these 11 concepts in a live coding round.
Your JS Interview Prep Checklist
- Write each concept's explanation in your own words — don't memorize definitions
- Code out examples for closures, promises, and the event loop in a playground
- Practice 2-3 DOM manipulation tasks without referring to documentation
- Do a mock technical interview to rehearse explaining concepts out loud
- Keep your resume updated with JS projects that demonstrate these concepts
These 11 questions cover roughly 70% of what Indian recruiters test in JS technical rounds. Understand them deeply, practice explaining them in simple English, and you'll walk into your next interview with confidence rather than panic.
Ready to put this into practice?
Practice mock interviews, build your resume, and get expert feedback — all on PrepFox.
More from PrepFox Blog
How to Crack Aptitude Interview Questions in Placements
How to crack aptitude interview questions in Indian placements: quant, reasoning and verbal sections, an 8-week plan, and test-day strategy.
9 Questions to Ask the Interviewer That Impress HR
Interview questions to ask the interviewer: 9 smart questions that impress Indian HR, what each one signals, and what never to ask in round one.
How to Answer Civil Interview Questions as a Fresher
How to answer civil interview questions as a fresher in India: slump test, foundations, cement tests and salary data for site engineer offers.
