<< back Javascript interview question from Happy Rawat
JavaScript Interview Masterclass Top 200 Questions & Answer
- 1. Basics
- 1. Introduction - Basics
- 2. Q1. What is JavaScript What is the role of JavaScript engine
- 3. Q2. What are client side and server side
- 4. Q3. What are variables What is the difference between var, let, and const
- 5. Q4. What are some important string operations in JS
- 6. Q5. What is DOM What is the difference between HTML and DOM
- 7. Q6. What are selectors in JS
- 8. Q7. Difference getElementById, getElementsByClassName and get elementsByTagName
- 9. Q8. What are data types in JS
- 10. Q9. What are operators What are the types of operators in JS
- 11. Q10. What are the types of conditions statements in JS
- 12. Q11. What is a loop What are the types of loops in JS
- 13. Q12. What are Functions in JS What are the types of function
- 14. Q13. What are Arrow Functions in JS What is it use
- 15. Q14. What are Arrays in JS How to get, add & remove elements from arrays
- 16. Q15. What are Objects in JS
- 17. Q16. What is Scope in JavaScript
- 18. Q17. What is Hoisting in JavaScript
- 19. Q18. What is Error Handling in JS
- 20. Q19. What is JSON
- 21. Q20. What is asynchronous programming in JS What is its use
- 2. Variables & Datatypes
- 1. Variables & Datatypes - Introduction
- 2. Q21. What are variables What is the difference between var, let, and const
- 3. Q22. What are data types in JS
- 4. Q23. What is the difference between primitive and non-primitive data types
- 5. Q24. What is the difference between null and undefined in JS
- 6. Q25. What is the use of typeof operator
- 7. Q26. What is type coercion in JS
- 3. Operators & Conditions
- 1. Operators & Conditions - Introduction
- 2. Q27. What are operators What are the types of operators in JS
- 3. Q28. What is the difference between unary, binary, and ternary operators
- 4. Q29. What is short-circuit evaluation in JS
- 5. Q30. What is operator precedence
- 6. Q31. What are the types of conditions statements in JS
- 7. Q32. When to use which type of conditions statements in real applications
- 8. Q33. What is the difference between == and ===
- 9. Q34. What is the difference between Spread and Rest operator in JS
- 4. Arrays
- 1. Arrays - Introduction
- 2. Q35. What are Arrays in JS How to get, add & remove elements from arrays
- 3. Q36. What is the indexOf() method of an Array
- 4. Q37. What is the difference between find() and filter() methods of an Array
- 5. Q38. What is the slice() method of an Array
- 6. Q39. What is the difference between push() and concat () methods of an Array
- 7. Q40. What is the difference between pop() and shift() methods of an Array
- 8. Q41. What is the splice() method of an Array
- 9. Q42. Difference between the slice() and splice() methods of an Array
- 10. Q43. What is the difference map() and for Each() array methods of an Array
- 11. Q44. How to sort and reverse an array
- 12. Q45. What is Array Destructuring in JS
- 13. Q46. What are array-like objects In JS
- 14. Q47. How to convert an array-like object into an array
- 5. Loops
- 1. Loops - Introduction
- 2. Q48. What is a loop What are the types of loops in JS
- 3. Q49. What is the difference between while and for loops
- 4. Q50. What is the difference between while and do-while loops
- 5. Q51. What is the difference between break and continue statement
- 6. Q52. What is the difference between for and for…of loop in JS
- 7. Q53. What is the difference between for…of and for…in loop
- 8. Q54. What is forEach method Compare it with for…of and for…in loop
- 9. Q55. When to use for…of loop and when to use forEach method in applications
- 6. Functions
- 1. Functions - Introduction
- 2. Q56. What are Functions in JS What are the types of function
- 3. Q57. Difference between named and anonymous functions
- 4. Q58. What is function expression in JS
- 5. Q59. What are Arrow Functions in JS What is it use
- 6. Q60. What are Callback Functions What is it use
- 7. Q61. What is Higher-order function In JS
- 8. Q62. What is the difference between arguments and parameters
- 9. Q63. In how many ways can you pass arguments to a function
- 10. Q64. How do you use default parameters in a function
- 11. Q65. What is the use of event handling in JS
- 12. Q66. What are First-Class functions in JS
- 13. Q67. What are Pure and Impure functions in JS
- 14. Q68. What is Function Currying in JS
- 15. Q69. What are call, apply and bind methods in JS
- 7. Strings
- 1. Strings - Introduction
- 2. Q70. What is a String
- 3. Q71. What are template literals and string interpolation in strings
- 4. Q72. Difference between single quotes (''), double quotes () & backticks('')
- 5. Q73. What are some important string operations in JS
- 6. Q74. What is string immutability
- 7. Q75. In how many ways you can concatenate strings
- 8. DOM
- 1. DOM - Introduction
- 2. Q76. What is DOM What is the difference between HTML and DOM
- 3. Q77. How do you select, modify, create and remove DOM elements
- 4. Q78. What are selectors in JS
- 5. Q79. Difference between getElementById,getElementsByClassName& getElementsByTag
- 6. Q80. What is the difference between querySelector() and querySelectorAll()
- 7. Q81. What are the methods to modify elements properties and attributes
- 8. Q82. What is the difference between innerHTML and textContent
- 9. Q83. How to add and remove properties of HTML elements in the DOM using JS
- 10. Q84. How to add and remove style from HTML elements in DOM using JS
- 11. Q85. Create new elements in DOM using JS
- 12. Q86. What is the difference between createElement() and createTextNode()
- 9. Error Handling
- 1. Error Handling- Introduction
- 2. Q87. What is Error Handling in JS
- 3. Q88. What is the role of finally block in JS
- 4. Q89. What is the purpose of the throw statement in JS
- 5. Q90. What is Error propagation in JS
- 6. Q91. What are the best practices for error handling
- 7. Q92. What are the different types of errors In JS
- 10. Objects
- 1. Objects - Introduction
- 2. Q93. What are Objects in JS
- 3. Q94. In how many ways we can create an object
- 4. Q95. What is the difference between an array and an object
- 5. Q96. How do you add or modify or delete properties of an object
- 6. Q97. Explain the difference between dot notation and bracket notation
- 7. Q98. What are some common methods to iterate over the properties of an object
- 8. Q99. How do you check if a property exists in an object
- 9. Q100. How do you clone or copy an object
- 10. Q101. What is the difference between deep copy and shallow copy in JS
- 11. Q102. What is Set Object in JS
- 12. Q103. What is Map Object in JS
- 13. Q104. What is the difference between Map and Object in JS
- 11. Events
- 1. Events - Introduction
- 2. Q105. What are Events How are events triggered
- 3. Q106. What are the types of events in JS
- 4. Q107. What is Event Object in JS
- 5. Q108. What is Event Delegation in JS
- 6. Q109. What is Event Bubbling In JS
- 7. Q110. How can you stop event propagation or event bubbling in JS
- 8. Q111. What is Event Capturing in JS
- 9. Q112. What is the purpose of the event.preventDefault() method in JS
- 10. Q113. What is the use of this keyword in the context of event handling in JS
- 11. Q114. How to remove an event handler from an element in JS
- 12. Closures
- 1. Closures - Introduction
- 2. Q115. Explain the concept of Lexical Scoping
- 3. Q116. What is Closure
- 4. Q117. What are the benefits of Closures
- 5. Q118. What is the concept of Encapsulation in the context of closures
- 6. Q119. What are the disadvantage or limitations of Closures
- 7. Q120. How can you release the variable references or closures from memory
- 8. Q121. What is the difference between a Regular Function and a Closure
- 13. Asynchronous programming – Basics
- 1. Asynchronous programming – Basics - Introduction
- 2. Q122. What is asynchronous programming in JS What is its use
- 3. Q123. What is the difference between synchronous and asynchronous programming
- 4. Q124. What are the techniques for achieving asynchronous operations in JS
- 5. Q125. What is setTimeout() How is it used to handle asynchronous operations
- 6. Q126. What is setInterval() How is it used to handle asynchronous operations
- 7. Q127. What is the role of callbacks in fetching API data asynchronously
- 8. Q128. What is callback hell How can it be avoided
- 14. Asynchronous Programming - Promises
- 1. Asynchronous Programming - Promises - Introduction
- 2. Q129. What are Promises in JavaScript
- 3. Q130. How to implement Promises in JavaScript
- 4. Q131. When to use Promises in real applications
- 5. Q132. What is the use of Promise.all() method
- 6. Q133. What is the use of Promise.race() method
- 7. Q134. What is the difference between Promise.all() and Promise.race()
- 15. Asynchronous Programming – Async Await
- 1. Asynchronous Programming – Async Await - Introduction
- 2. Q135. What is the purpose of async await Compare it with Promises
- 3. Q136. Explain the use of async and await keywords in JS
- 4. Q137. Can we use async keyword without await keyword and vice versa
- 5. Q138. How do you handle errors in async await functions
- 16. Browser APIs & Web Storage
- 1. Browser APIs & Web Storage - Introduction
- 2. Q139. What is a window object
- 3. Q140. What are Browser APIs in JS
- 4. Q141. What is Web Storage, and its use How many types of web storage are there
- 5. Q142. What is Local Storage How to store, retrieve and remove data from it
- 6. Q143. What is Session Storage How to store, retrieve and remove data from it
- 7. Q144. What is the difference between LocalStorage and SessionStorage
- 8. Q145. How much data can be stored in localStorage and sessionStorage
- 9. Q146. What are cookies How do you create and read cookies
- 10. Q147. What is the difference between cookies and web storage
- 11. Q148. When to use cookies and when to use web storage
- 17. Classes, Constructors, this & Inheritance
- 1. Classes, Constructors, this & Inheritance - Introduction
- 2. Q149. What are Classes in JS
- 3. Q150. What is a constructor
- 4. Q151. What are constructor functions
- 5. Q152. What is the use of this keyword
- 6. Q153. Explain the concept of prototypal inheritance
- 18. ECMAScript & Modules
- 1. ECMAScript & Modules - Introduction
- 2. Q154. What is ES6 What are some new features introduced by it
- 3. Q155. What are Modules in JS
- 4. Q156. What is the role of export keyword
- 5. Q157. What are the advantages of modules
- 6. Q158. What is the difference between named exports and default exports
- 7. Q159. What is the difference between static and dynamic imports
- 8. Q160. What are module bundlers
- 19. Security & Performance
- 1. Security & Performance - Introduction
- 2. Q161. What is eval() function in JS
- 3. Q162. What is XSS (Cross-Site Scripting) attack
- 4. Q163. What is SQL Injection attack
- 5. Q164. What are some best practices for security in JS
- 6. Q165. What are the best practices for improving performance in JS
- 20. Scenario based – Tricky Short Questions
- 1. Scenario based – Tricky Short Questions - Introduction
- 2. Q166- Q185
- 21. Scenario based – Feature Development Questions
- 1. Scenario based – Feature Development Questions - Introduction
- 2. Q186. How to validate user input as they type in a form
- 3. Q187. How to implement pagination for displaying large sets of data
- 4. Q188. How to implement drag-and-drop functionality for elements on a web page
- 5. Q189. Feature that allows users to search for specific items in a large dataset
- 6. Q190. Feature that allows users to perform live search suggestions as they type
- 7. Q191. How to implement a real-time chat application using JS
- 8. Q192. Create an infinite scrolling using JS when a user reaches the webpage
- 9. Q193. Implement toggle switch to change the theme(lightdark mode) of a website
- 10. Q194. How to use JS to dynamically update date in real time on webpage
- 11. Q195. Prevent a form from being submitted without required fields being filled
- 22. Coding
- 1. Coding - Introduction
- 2. Q196. Write a function that returns the reverse of a string
- 3. Q197. Write a function that returns the longest word in the sentence
- 4. Q198. Function that checks whether a given string is a palindrome or not
- 5. Q199. Write a function to remove duplicate elements from an array
- 6. Q200. Write a function that checks whether two strings are anagrams or not
- 7. Q201. Write a function that returns the number of vowels in a string.
- 8. Q202. Write a function to find the largest number in an array.
- 9. Q203. Write a function to check if a given number is prime or not
- 10. Q204. Write a function to calculate the factorial of a number
- 11. Q205. Write a program to remove all whitespace characters from a string.
- 12. Q206. Write a function to find the sum of all elements in an array
- 13. Q207. Write a function to find the average of an array of numbers
- 14. Q208. Write a function to sort an array of numbers in ascending order
- 15. Q209. Write a function to check if an array is sorted in ascending order or not
- 16. Q210. Write a function to merge two arrays into a single sorted array
- 17. Q211. Write a function to remove a specific element from an array
- 18. Q212. Write a function to find the second largest element in an array
- 19. Q213. Write a function to reverse the order of words in a given sentence
- 20. Q214. Function to find the longest common prefix among an array of strings
- 21. Q215. Write a function to find the intersection of two arrays
- 22. Q216. Write a function to calculate the Fibonacci sequence up to a given number
Related pages
Comments (
)
Link to this page:
http://www.vb-net.com/JavascriptInterview/Index.htm
|