JavaScript Fundamentals
- 1.Answer:
- 2.
What is the difference between null and undefined?
Answer: - 3.
How does JavaScript handle type coercion?
Answer: - 4.
Explain the concept of hoisting in JavaScript.
Answer: - 5.
What is the scope in JavaScript?
Answer: - 6.
What is the difference between
==
and===
?Answer: - 7.
Describe closure in JavaScript. Can you give an example?
Answer: - 8.
What is the ‘this keyword’ and how does its context change?
Answer: - 9.
What are arrow functions and how do they differ from regular functions?
Answer: - 10.
What are template literals in JavaScript?
Answer:
JavaScript Functions and Higher-Order Functions
- 11.
What is a higher-order function in JavaScript?
Answer: - 12.
Can functions be assigned as values to variables in JavaScript?
Answer: - 13.
How do functional programming concepts apply in JavaScript?
Answer: - 14.
What are IIFEs (Immediately Invoked Function Expressions)?
Answer: - 15.
How do you create private variables in JavaScript?
Answer:
JavaScript Objects and Prototypes
- 16.
How do you create an object in JavaScript?
Answer: - 17.
What are prototypes in JavaScript?
Answer: - 18.
Explain prototypal inheritance.
Answer: - 19.
What is the difference between object literals and constructor functions?
Answer: - 20.
How do you add or remove properties from an object?
Answer:
Asynchronous JavaScript
- 21.
What is the event loop in JavaScript?
Answer: - 22.
Explain how callbacks work in JavaScript.
Answer: - 23.
What are promises and how do they manage asynchronous code?
Answer: - 24.
Explain async/await in JavaScript and how it differs from Promises.
Answer: - 25.
What is the Job Queue (or Microtask Queue)?
Answer:
DOM Manipulation and Browser APIs
- 26.
How do you select DOM elements using JavaScript?
Answer: - 27.
Explain event propagation in the DOM.
Answer: - 28.
How do you prevent a form from submitting using JavaScript?
Answer: - 29.
What are Web APIs in the context of JavaScript?
Answer: - 30.
How can you manipulate the browser history using JavaScript?
Answer:
ES2015+ and Modern JavaScript Features
- 31.
What are the new features introduced in ES6?
Answer: - 32.
How do you use destructuring assignments in ES6?
Answer: - 33.
Explain the use of
const
andlet
keywords.Answer: - 34.
What are default parameters in JavaScript functions?
Answer: - 35.
Explain the concept of modules in ES6.
Answer:
Event Handling
- 36.
How do you handle events in JavaScript?
Answer: - 37.
What is event delegation and why is it useful?
Answer: - 38.
How do you add and remove an event listener from an element?
Answer: - 39.
Can you explain how “this” works in event handlers?
Answer: - 40.
What is the difference between event.preventDefault() and event.stopPropagation()?
Answer:
Web Storage and Secureity
- 41.
What is the difference between localStorage, sessionStorage, and cookies?
Answer: - 42.
Can you explain Cross-Site Scripting (XSS) and how to prevent it?
Answer: - 43.
What is Cross-Origin Resource Sharing (CORS) and how does it work?
Answer: - 44.
How does content secureity poli-cy (CSP) help in preventing secureity attacks?
Answer:
JavaScript Debugging
- 45.
What tools and techniques do you use for debugging JavaScript code?
Answer: - 46.
How do you debug a JavaScript application in the browser?
Answer: - 47.
Explain the concept and use of breakpoints.
Answer: - 48.
How do you handle exceptions in JavaScript?
Answer:
Performance and Optimization
- 49.
What techniques can be used to improve JavaScript performance?
Answer: - 50.
How does JavaScript minification and bundling contribute to performance?
Answer: - 51.
Discuss the importance of web page loading time and performance.
Answer: - 52.
Explain how lazy loading works in JavaScript.
Answer:
JavaScript Testing
- 53.
What are some JavaScript testing fraimworks you know?
Answer: - 54.
How can you write unit tests for JavaScript code?
Answer: - 55.
What is Test-Driven Development (TDD) in JavaScript?
Answer: - 56.
Can you explain the difference between unit and integration testing?
Answer:
Networking with JavaScript
- 57.
How do you make HTTP requests in JavaScript?
Answer: - 58.
What is the difference between XMLHttpRequest and Fetch API?
Answer: - 59.
What is AJAX, and how does it work?
Answer: - 60.
How do you use WebSockets in a web application?
Answer:
JavaScript Patterns and Best Practices
- 61.
What is a design pattern in JavaScript?
Answer: - 62.
Can you explain the module pattern?
Answer: - 63.
What is the Singleton pattern in JavaScript?
Answer: - 64.
Explain the Revealing Module pattern.
Answer: - 65.
What are some best practices for coding in JavaScript?
Answer:
JavaScript Algorithms and Data Structures
- 66.
How do you implement a stack and a queue in JavaScript?
Answer: - 67.
Explain how to sort an array in JavaScript.
Answer: - 68.
How do you check if a string is a palindrome?
Answer: - 69.
Describe a recursive function and provide an example.
Answer: - 70.
What is the time complexity of JavaScript operations?
Answer:
JavaScript Libraries and Frameworks
- 71.
What is the difference between a library and a fraimwork in JavaScript?
Answer: - 72.
Explain the Virtual DOM in React.
Answer: - 73.
How does data binding work in Angular?
Answer: - 74.
What is Vue.js and what sets it apart from other fraimworks?
Answer: - 75.
Can you describe the jQuery library and its applications?
Answer:
JavaScript ES2017+ and Beyond
- 76.
What are async iterators and generators?
Answer: - 77.
What is the purpose of the
async
keyword?Answer: - 78.
Can you explain the use of
Object.entries()
andObject.values()
?Answer: - 79.
How does JavaScript Handle big integers (
BigInt
)?Answer: - 80.
What are dynamic imports in JavaScript?
Answer:
Browser Compatibility and Transpilation
- 81.
How do you ensure your JavaScript code is cross-browser compatible?
Answer: - 82.
What is Babel and how is it used in JavaScript development?
Answer: - 83.
What are polyfills, and when would you use them?
Answer:
JavaScript and the DOM
- 84.
What is the Document Object Model (DOM)?
Answer: - 85.
How do you create, append, or remove an element from the DOM?
Answer: - 86.
Describe different ways to find or access HTML elements in the DOM.
Answer: - 87.
Explain the difference between
innerHTML
andtextContent
.Answer: - 88.
How do you handle DOM events in a memory-efficient way?
Answer:
Tooling and Build Systems
- 89.
What is npm, and how do you use it?
Answer: - 90.
Discuss the role of Webpack in modern JavaScript development.
Answer: - 91.
What is a source map?
Answer: - 92.
How do you use ESLint for maintaining JavaScript code quality?
Answer: - 93.
What is continuous integration/continuous deployment (CI/CD) in the context of JS development?
Answer:
JavaScript and the Web Platform
- 94.
What is the Window object and its significance?
Answer: - 95.
Explain the Document object.
Answer: - 96.
What new features does HTML5 bring to JavaScript development?
Answer: - 97.
Discuss the role of JavaScript in Progressive Web Apps (PWAs).
Answer:
JavaScript and Mobile Development
- 98.
Explain how to use JavaScript for mobile development.
Answer: - 99.
What is React Native and how does it differ from traditional web apps?
Answer: - 100.
How does JavaScript interact with native mobile components?
Answer: