JavaScript Interview Questions – Complete Guide
This PDF contains beginner to advanced JavaScript interview questions, useful for freshers and experienced
developers.
1. JavaScript Basics
• What is JavaScript?
• Difference between JavaScript and Java
• What are data types in JavaScript?
• Difference between var, let, and const
• What is hoisting?
• What is strict mode?
• What are operators in JavaScript?
• Difference between == and ===
• What is NaN?
• What is type coercion?
2. Functions & Scope
• What is a function?
• Function declaration vs function expression
• What is an arrow function?
• What is callback function?
• What is higher-order function?
• What is scope?
• Difference between global, local, and block scope
• What are closures?
• Explain lexical scope
3. Objects & Arrays
• What is an object?
• Different ways to create objects
• What is this keyword?
• What is prototype?
• What is prototypal inheritance?
• Array methods: map, filter, reduce
• Difference between slice and splice
• Shallow copy vs deep copy
• What is destructuring?
4. OOPS in JavaScript
• Explain OOPS concepts
• What is encapsulation?
• What is inheritance?
• What is polymorphism?
• What is abstraction?
• How OOPS is implemented in JavaScript?
• Class vs function constructor
5. Asynchronous JavaScript
• What is asynchronous programming?
• What is setTimeout and setInterval?
• What is callback hell?
• What are promises?
• Promise states
• What is async/await?
• Difference between promise and async/await
• What is event loop?
• Microtask vs macrotask queue
6. DOM & Events
• What is DOM?
• How to select elements in DOM?
• Difference between innerHTML and innerText
• What are events?
• Event bubbling and capturing
• Event delegation
• Prevent default behavior
• What is addEventListener?
7. Browser & Web APIs
• What is localStorage and sessionStorage?
• Difference between cookies and storage
• What is fetch API?
• What is CORS?
• What is debounce and throttle?
• What is window object?
• What is navigator object?
8. ES6+ Features
• What is ES6?
• Template literals
• Spread and rest operators
• Default parameters
• Modules in JavaScript
• Optional chaining
• Nullish coalescing operator
9. Performance & Security
• How to optimize JavaScript performance?
• What is memory leak?
• What is XSS?
• How to prevent XSS?
• What is CSRF?
10. Coding & Logical Questions
• Reverse a string
• Check palindrome
• Find max/min in array
• Remove duplicates from array
• Fibonacci series
• Factorial of a number
• Find second largest number
• Flatten an array
• Debounce implementation