JavaScript Interview Questions
Basic JavaScript Interview Questions
- What is JavaScript?
- What are the data types in JavaScript?
- What is the difference between var, let, and const?
- What are JavaScript primitive types?
- What is the difference between == and ===?
- What is a closure in JavaScript?
- What are truthy and falsy values?
- What is hoisting in JavaScript?
- What is a function in JavaScript?
- What is the difference between function declaration and function expression?
Intermediate JavaScript Interview Questions
- What is the scope in JavaScript?
- What is the difference between null and undefined?
- What is event delegation in JavaScript?
- What is a callback function?
- What is the difference between synchronous and asynchronous code?
- Explain setTimeout() and setInterval() with examples.
- What is the event loop in JavaScript?
- What is the difference between call, apply, and bind?
- What is the purpose of the this keyword?
- What is a promise?
Advanced JavaScript Interview Questions
- What are async/await in JavaScript?
- What is the difference between deep copy and shallow copy?
- What are arrow functions and how are they different from normal functions?
- What are higher-order functions?
- What are template literals?
- Explain destructuring in JavaScript.
- What is the spread operator and rest operator?
- What is prototypal inheritance?
- What is the difference between map(), filter(), and reduce()?
- What are JavaScript modules (ES6 imports/exports)?
DOM and BOM Questions
- What is the DOM in JavaScript?
- How do you select elements using JavaScript?
- What is the difference between innerHTML and textContent?
- How to handle events in JavaScript (e.g., onclick, addEventListener)?
- What is event bubbling and capturing?
ES6+ JavaScript Interview Questions
- What is ES6?
- What are default parameters in JavaScript?
- What are generators in JavaScript?
- What is destructuring assignment?
- What is the difference between for...of and for...in?
Miscellaneous JavaScript Interview Questions
- What is the difference between frontend and backend JavaScript?
- What is memory leak in JavaScript?
- What is debounce and throttle in JavaScript?
- What is JSON and how to parse and stringify JSON data?
- What is the difference between localStorage, sessionStorage, and cookies?
Code-based JavaScript Interview Questions
- Write a function to reverse a string.
- Find the largest number in an array.
- Check if a string is a palindrome.
- Flatten a nested array.
- Implement a simple debounce function.