56 |
57 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/js_interview_questions.md:
--------------------------------------------------------------------------------
1 |
2 | # 🔥 100 Most Frequently Asked JavaScript Interview Questions
3 |
4 | A carefully curated list of 100 essential JavaScript interview questions for L1 & L2 frontend rounds. Ideal for those preparing for roles in JavaScript, React, Angular, Vue, or Node.js.
5 |
6 | ---
7 |
8 | ## 🧠 Core JavaScript Concepts
9 |
10 | 1. What is the difference between `==` and `===`?
11 | 2. What is a closure in JavaScript?
12 | 3. What is hoisting in JavaScript?
13 | 4. Difference between `let`, `var`, and `const`?
14 | 5. What is the Temporal Dead Zone?
15 | 6. Is JavaScript dynamically or statically typed?
16 | 7. What is the difference between `null` and `undefined`?
17 | 8. What is the type of `NaN`?
18 | 9. What is the event loop in JavaScript?
19 | 10. What is the call stack?
20 | 11. What is a lexical scope?
21 | 12. Explain pass by value vs pass by reference.
22 | 13. What is an Immediately Invoked Function Expression (IIFE)?
23 | 14. What are JavaScript data types?
24 | 15. Explain the `typeof` operator.
25 |
26 | ## ⚙️ Functions & Execution
27 |
28 | 16. Difference between `call()`, `apply()`, and `bind()`?
29 | 17. What is `this` keyword and how does it work?
30 | 18. Arrow functions vs regular functions?
31 | 19. What are pure functions?
32 | 20. What is a higher-order function?
33 | 21. What are callbacks?
34 | 22. What are first-class functions?
35 | 23. What is a function expression vs function declaration?
36 | 24. What are default parameters?
37 | 25. What is function currying?
38 |
39 | ## 📦 Objects, Arrays & Destructuring
40 |
41 | 26. What is object destructuring?
42 | 27. What is array destructuring?
43 | 28. What are the differences between `Object.keys()`, `Object.values()`, and `Object.entries()`?
44 | 29. How to clone an object in JavaScript?
45 | 30. What is the difference between shallow copy and deep copy?
46 | 31. What is `Object.freeze()` vs `Object.seal()`?
47 | 32. How to check if an object is empty?
48 | 33. How to merge two objects?
49 | 34. What is optional chaining (`?.`) in JavaScript?
50 | 35. What is the spread operator and how is it used?
51 |
52 | ## ⏳ Asynchronous JavaScript
53 |
54 | 36. What is a Promise?
55 | 37. What is async/await?
56 | 38. What is the difference between synchronous and asynchronous code?
57 | 39. What is the output of `async function`?
58 | 40. What is the difference between microtasks and macrotasks?
59 | 41. What is Promise.all, Promise.race, Promise.any, and Promise.allSettled?
60 | 42. What is callback hell?
61 | 43. How to handle errors in Promises?
62 | 44. What is the use of `finally` in Promises?
63 | 45. What is event delegation?
64 |
65 | ## 🔄 Arrays & Iteration
66 |
67 | 46. Difference between `map()`, `filter()`, `reduce()`, and `forEach()`?
68 | 47. Difference between `for...in` and `for...of`?
69 | 48. How does `find()` differ from `filter()`?
70 | 49. What does `reduce()` do?
71 | 50. What is the difference between `some()` and `every()`?
72 | 51. What are array-like objects?
73 | 52. How to convert NodeList to an array?
74 | 53. What is array destructuring?
75 | 54. How to flatten a nested array?
76 | 55. What is `.flatMap()`?
77 |
78 | ## 🌐 Browser APIs & Storage
79 |
80 | 56. What is CORS?
81 | 57. Difference between localStorage, sessionStorage, and cookies?
82 | 58. What is IndexedDB?
83 | 59. What is the Fetch API?
84 | 60. How to handle JSON in JavaScript?
85 | 61. What is event bubbling and capturing?
86 | 62. What is the difference between `addEventListener` and `onclick`?
87 | 63. What are custom events?
88 | 64. How to stop event propagation?
89 | 65. What is the History API?
90 |
91 | ## 📜 ES6+ Features
92 |
93 | 66. What are template literals?
94 | 67. What are arrow functions?
95 | 68. What are rest parameters?
96 | 69. What is object property shorthand?
97 | 70. What are modules in JavaScript?
98 | 71. What is the difference between `import` and `require()`?
99 | 72. What are generators?
100 | 73. What is a symbol in JavaScript?
101 | 74. What is `Set` and `Map`?
102 | 75. What is the difference between `forEach` and `map`?
103 |
104 | ## 🚀 Performance & Optimization
105 |
106 | 76. What is debouncing?
107 | 77. What is throttling?
108 | 78. How to optimize JavaScript performance?
109 | 79. What is lazy loading?
110 | 80. What is code splitting?
111 | 81. What is tree shaking?
112 | 82. How to minimize memory leaks?
113 | 83. What is reflow and repaint?
114 | 84. What is event loop blocking?
115 | 85. What is a memory leak in JavaScript?
116 |
117 | ## 🔐 Security & Patterns
118 |
119 | 86. What is XSS?
120 | 87. What is CSRF?
121 | 88. How to prevent common JavaScript security issues?
122 | 89. What are design patterns in JavaScript?
123 | 90. What is the Module pattern?
124 | 91. What is the Singleton pattern?
125 | 92. What is a polyfill?
126 | 93. What is transpilation?
127 | 94. What is Babel?
128 | 95. What is Webpack?
129 |
130 | ## 🧪 Miscellaneous
131 |
132 | 96. What is the difference between `==` and `===`?
133 | 97. What is `eval()` and why is it discouraged?
134 | 98. What is the output of: `3 + 2 + "7"`?
135 | 99. What are service workers?
136 | 100. What’s the difference between authentication and authorization?
137 |
--------------------------------------------------------------------------------