3145+ Technical Interview Questions & Answers | Prep Buddy
3145 Questions · 18 Tech Stacks

🎯 Tech Interview Prep & Mastery Studio

Master 3145+ high-frequency interview questions across 18 technologies with instant progress tracking, detailed explanations, and flashcard practice mode.

🎨 Visualizer Studio
0
Questions Mastered
3145
Total Question Deck
0%
Overall Mastery
18
Tech Topics
JavaScript
0/200
Tricky JS
0/164
React
0/200
Next.js
0/200
Angular
0/200
Node.js
0/200
Python
0/200
AI / ML
0/233
LLM
0/75
RAG
0/58
CSS
0/200
HTML
0/200
DSA
0/200
MongoDB
0/200
MySQL
0/200
Redis
0/81
Docker
0/200
OOP
0/134
⌘K

JavaScript Interview Questions & Answers200 Questions

0 of 200 Mastered · (0% Completion)

0%
Category Score
01

What is the difference between var, let, and const?

Easy
02

Explain hoisting in JavaScript.

Medium
03

What are closures and how do they work?

Hard
04

What is the event loop in JavaScript?

Hard
05

Explain the concept of prototypal inheritance.

Hard
06

What is the difference between == and ===

Easy
07

What are Promises and how do they work?

Medium
08

Explain async/await and how it relates to Promises.

Medium
09

What is the difference between null and undefined?

Easy
10

What is a higher-order function? Give examples.

Medium
11

Explain the difference between call, apply, and bind.

Hard
12

What is the 'this' keyword and how does it behave?

Hard
13

What is event delegation and why is it useful?

Medium
14

What are arrow functions and how are they different from regular functions?

Medium
15

Explain the concept of scope (global, function, block).

Medium
16

What is the Temporal Dead Zone (TDZ)?

Hard
17

What are generators and iterators?

Hard
18

What is a WeakMap and WeakSet? When would you use them?

Hard
19

What is memoization? Implement a simple memoize function.

Hard
20

What are Symbol types used for?

Hard
21

Explain debouncing and throttling with examples.

Hard
22

What is the difference between deep copy and shallow copy?

Medium
23

How does JavaScript handle asynchronous operations?

Medium
24

What is the difference between setTimeout and setInterval?

Easy
25

Explain how the prototype chain works.

Hard
26

What is currying in JavaScript?

Hard
27

What are pure functions and side effects?

Medium
28

Explain destructuring assignment in ES6.

Medium
29

What are template literals and tagged templates?

Medium
30

What is the spread and rest operator?

Medium
31

What is optional chaining (?.) and nullish coalescing (??)

Medium
32

Explain Map vs Object in JavaScript.

Medium
33

What is Set and how is it different from Array?

Easy
34

What is the Proxy object in JavaScript?

Hard
35

How does JavaScript's garbage collection work?

Hard
36

What is an IIFE and when would you use it?

Medium
37

What is the difference between synchronous and asynchronous code?

Easy
38

Explain the concept of coercion in JavaScript.

Medium
39

What is the module system in JavaScript (CommonJS vs ES Modules)?

Medium
40

What is tree shaking?

Medium
41

Explain the difference between Array.map, Array.filter, and Array.reduce.

Medium
42

What is Array.flat() and Array.flatMap()?

Medium
43

How does Object.freeze() differ from const?

Medium
44

What is the difference between Object.keys, Object.values, Object.entries?

Easy
45

What is a Proxy and Reflect in JavaScript?

Hard
46

What is function composition?

Hard
47

What is the event bubbling and capturing?

Medium
48

What is stopPropagation vs preventDefault?

Medium
49

What are Web Workers?

Hard
50

What is Service Worker and how does it differ from Web Worker?

Hard
51

What is IndexedDB?

Medium
52

Explain localStorage vs sessionStorage vs cookies.

Medium
53

What is CORS and how do you handle it?

Medium
54

Explain XSS and CSRF attacks and prevention.

Hard
55

What is JSON.stringify and JSON.parse? Gotchas?

Medium
56

What is the difference between for...in and for...of?

Medium
57

What are Symbol.iterator and custom iterables?

Hard
58

What is Promise.all vs Promise.race vs Promise.allSettled vs Promise.any?

Hard
59

What is microtask queue vs macrotask queue?

Hard
60

Explain the concept of function overloading in JS.

Medium
61

What are getters and setters in JavaScript?

Medium
62

What is the difference between class and function-based constructors?

Medium
63

What are static methods in a class?

Medium
64

What is the instanceof operator?

Easy
65

What is typeof and what are its quirks?

Medium
66

How does Array.sort work internally?

Hard
67

What is the difference between slice and splice?

Easy
68

What are truthy and falsy values in JavaScript?

Easy
69

What is short-circuit evaluation?

Easy
70

What is tail call optimization?

Hard
71

Explain Object.assign vs spread operator for objects.

Medium
72

What is chaining in JavaScript?

Medium
73

What is lazy evaluation?

Hard
74

What are design patterns? Name 3 common ones in JS.

Hard
75

What is the Observer pattern?

Hard
76

What is the Singleton pattern?

Medium
77

What is the Module pattern?

Medium
78

How do you handle errors in async/await?

Medium
79

What is try/catch/finally?

Easy
80

What are custom errors in JavaScript?

Medium
81

What is the difference between throw and reject?

Medium
82

What is function memoization and implement it.

Hard
83

What is the difference between composition and inheritance?

Hard
84

What is Array.from() used for?

Medium
85

Explain the concept of lazy loading.

Medium
86

What are bitwise operators in JavaScript?

Hard
87

What is NaN and how to check for it?

Medium
88

What is Infinity in JavaScript?

Easy
89

What are property descriptors in JavaScript?

Hard
90

What is Object.create()?

Hard
91

What is the difference between arguments object and rest params?

Medium
92

What are tagged template literals?

Hard
93

What is the globalThis object?

Medium
94

What is the AbortController API?

Hard
95

What is the Intersection Observer API?

Medium
96

What is ResizeObserver?

Medium
97

How do you implement a polyfill?

Hard
98

What is the difference between declaration and expression functions?

Medium
99

What is an async generator?

Hard
100

What is BigInt in JavaScript?

Medium
101

What is the difference between Object.seal() and Object.freeze()?

Hard
102

How would you optimize the loading performance of a large JavaScript bundle?

Hard
103

What are the Core Web Vitals (LCP, INP, CLS) and how do you improve them?

Hard
104

What is hydration in modern frameworks and what is the hydration mismatch problem?

Hard
105

Explain server-side rendering (SSR) vs static site generation (SSG) vs client-side rendering.

Hard
106

What are React Server Components and how do they change data fetching?

Hard
107

How do you prevent prototype pollution attacks in JavaScript?

Hard
108

What is Content Security Policy (CSP) and how does it mitigate XSS?

Hard
109

How would you implement rate limiting on the client side for API calls?

Medium
110

What is the difference between HTTP polling, long polling, SSE, and WebSockets?

Hard
111

How do you handle authentication tokens securely (where to store JWT)?

Hard
112

What is the difference between cookies with HttpOnly, Secure, and SameSite attributes?

Medium
113

How does the JavaScript engine optimize code (JIT, hidden classes, inline caching)?

Hard
114

What are top-level await and dynamic import() and when are they useful?

Medium
115

What is the difference between structuredClone() and JSON deep copy?

Medium
116

What are the new Array methods like at(), findLast(), and toSorted()?

Medium
117

What is the Temporal API and what problems does it solve over Date?

Hard
118

How would you debug a memory leak in a long-running single-page application?

Hard
119

What is the difference between throttling network and CPU in performance profiling?

Medium
120

How do you implement optimistic UI updates with rollback on failure?

Hard
121

What strategies do you use for client-side caching of API responses?

Medium
122

What is code splitting and how do you implement route-based splitting?

Medium
123

How does HTTP/2 multiplexing change front-end bundling strategies?

Hard
124

What is the difference between defer and async attributes on script tags?

Medium
125

How would you architect a feature flag system on the front end?

Medium
126

How do you measure and reduce time-to-interactive in a web app?

Hard
127

What are the security implications of using eval() and the Function constructor?

Medium
128

How would you implement retry with exponential backoff for failed requests?

Medium
129

What is the difference between idempotent and non-idempotent API operations?

Medium
130

How do you handle race conditions when multiple async requests update the same state?

Hard
131

What is the PRPL pattern in web performance?

Hard
132

How does the browser's preload, prefetch, and preconnect resource hints work?

Medium
133

What is the difference between a monorepo and polyrepo for JS projects?

Medium
134

How would you design a plugin architecture in a JavaScript application?

Hard
135

What is the difference between ESBuild, SWC, Webpack, and Vite as build tools?

Medium
136

Implement a debounce function with leading and trailing options.

Hard
137

Implement a throttle function from scratch.

Hard
138

Write a function that deep clones an object without using structuredClone.

Hard
139

Implement a curry function that supports partial application.

Hard
140

Write a function to flatten a deeply nested array without using Array.flat.

Medium
141

Implement Promise.all from scratch.

Hard
142

Implement Promise.race from scratch.

Hard
143

Implement a custom memoize function with a configurable cache key.

Hard
144

Write a function that retries a promise N times before rejecting.

Hard
145

Implement an event emitter (on, off, emit) class.

Medium
146

Write a function to deep compare two objects for equality.

Hard
147

Implement a function that limits concurrency of async tasks (promise pool).

Hard
148

Write a polyfill for Array.prototype.map.

Medium
149

Write a polyfill for Function.prototype.bind.

Hard
150

Implement a function to chunk an array into groups of size n.

Easy
151

Write a function that groups an array of objects by a given key.

Medium
152

Implement a simple LRU cache.

Hard
153

Write a function to convert a callback-based API into a promise-based one.

Medium
154

Implement a function that pipes multiple functions left to right (pipe).

Medium
155

Implement compose (right to left function composition).

Medium
156

Write a function to remove duplicates from an array of objects by a property.

Medium
157

Implement a recursive function to compute the nth Fibonacci with memoization.

Medium
158

Write a function to deeply freeze an object.

Medium
159

Implement a function that parses a query string into an object.

Medium
160

Write a function that serializes an object into a query string.

Medium
161

Implement a simple Pub/Sub system.

Medium
162

Write a function to detect if a string is a valid palindrome ignoring punctuation.

Easy
163

Implement a function to find the intersection of two arrays.

Easy
164

Write a custom implementation of JSON.stringify for simple objects.

Hard
165

Implement a function that runs async tasks in series and collects results.

Medium
166

Write a function that throttles using requestAnimationFrame.

Hard
167

Implement a function to convert a flat array with parentId into a tree.

Hard
168

Write a function that capitalizes the first letter of each word.

Easy
169

Implement a once function that ensures a function runs only one time.

Medium
170

Write a function that schedules a task to run after the current call stack clears.

Medium
171

What is the output of: console.log(typeof null + " " + typeof undefined)?

Medium
172

What is the output of: console.log(0.1 + 0.2 === 0.3)?

Easy
173

What is the output of: console.log([] + [])?

Medium
174

What is the output of: console.log([] + {})?

Medium
175

What is the output of: console.log(1 < 2 < 3); console.log(3 > 2 > 1)?

Hard
176

What is the output of: console.log([1,2,3] + [4,5,6])?

Medium
177

What is the output of: console.log(typeof NaN)?

Easy
178

What is the output of: console.log(0.1 + 0.2)?

Medium
179

What is the output of: var a = 1; function f(){ console.log(a); var a = 2; } f()?

Hard
180

What is the output of: for(var i=0;i<3;i++){ setTimeout(()=>console.log(i),0); }?

Hard
181

What is the output of: for(let i=0;i<3;i++){ setTimeout(()=>console.log(i),0); }?

Hard
182

What is the output of: console.log(1 + "2" + 3)?

Easy
183

What is the output of: console.log("5" - 2 + "1")?

Medium
184

What is the output of: console.log([1,2,3].map(parseInt))?

Hard
185

What is the output of: console.log(!!"false" == !!"true")?

Medium
186

What is the output of: const o = {}; console.log(o.toString())?

Medium
187

What is the output of: console.log(null == undefined, null === undefined)?

Medium
188

What is the output of: console.log(NaN === NaN)?

Easy
189

What is the output of: async function f(){ return 1; } console.log(f())?

Medium
190

What is the output of: console.log("a","b"); console.log(Promise.resolve(1))?

Medium
191

What is the output order of: console.log(1); setTimeout(()=>console.log(2)); Promise.resolve().then(()=>console.log(3)); console.log(4)?

Hard
192

What is the output of: const obj = { a: 1, b: this.a }; console.log(obj.b)?

Hard
193

What is the output of: function f(){ return; { ok: true } } console.log(f())?

Hard
194

What is the output of: console.log(0 == "")?

Medium
195

What is the output of: console.log([] == ![])?

Hard
196

What is the output of: let x = (1,2,3); console.log(x)?

Medium
197

What is the output of: console.log(typeof typeof 1)?

Medium
198

What is the output of: console.log((function(){ return typeof arguments; })())?

Medium
199

What is the output of: const a = [1,2,3]; a.length = 0; console.log(a[0])?

Easy
200

What is the output of: console.log(parseInt("0x10"), parseInt("10", 2))?

Hard