JS
JS Interview
Interview
JavaScript
Interview
Playground
⌘K
Home
JS Concepts
DSA Patterns
Interview Prep
Playground
JavaScript Interview Prep
100 questions across fundamentals, functions, async patterns, and modern JS
All
Easy
Medium
Hard
All Topics
Core Fundamentals
Functions & Objects
Async JavaScript
Modern JS & Patterns
Showing
100
of 100 questions
01
What is JavaScript and how does it differ from Java?
easy
Core Fundamentals
basics
02
What are the primitive data types in JavaScript?
easy
Core Fundamentals
types
03
What is the difference between `var`, `let`, and `const`?
easy
Core Fundamentals
variables
04
What is hoisting in JavaScript?
easy
Core Fundamentals
hoisting
05
What is the difference between `==` and `===`?
easy
Core Fundamentals
equality
06
What is the `typeof` operator and what does it return?
easy
Core Fundamentals
types
07
What is the difference between `null` and `undefined`?
easy
Core Fundamentals
types
08
What are template literals and how do they differ from regular strings?
easy
Core Fundamentals
variables
09
Explain how JavaScript type coercion works with examples.
medium
Core Fundamentals
coercion
10
What is the scope chain and how does variable lookup work?
medium
Core Fundamentals
scope
11
What is the Temporal Dead Zone (TDZ)?
medium
Core Fundamentals
hoisting
12
How do truthy and falsy values work in JavaScript?
medium
Core Fundamentals
coercion
13
What is the difference between `for...in` and `for...of`?
medium
Core Fundamentals
operators
14
How does short-circuit evaluation work with `&&` and `||`?
medium
Core Fundamentals
operators
15
What are the nullish coalescing (`??`) and optional chaining (`?.`) operators?
medium
Core Fundamentals
operators
16
What is destructuring assignment and how does it work?
medium
Core Fundamentals
destructuring
17
What is the spread operator and how does it differ from the rest parameter?
medium
Core Fundamentals
destructuring
18
How does JavaScript handle floating-point arithmetic and what are its pitfalls?
hard
Core Fundamentals
types
19
Explain pass-by-value vs pass-by-reference in JavaScript.
hard
Core Fundamentals
types
20
How does garbage collection work in JavaScript (mark-and-sweep)?
hard
Core Fundamentals
variables
21
What are Symbols and what are their use cases?
hard
Core Fundamentals
types
22
What is the difference between `Object.freeze()`, `Object.seal()`, and `Object.preventExtensions()`?
hard
Core Fundamentals
variables
23
How does `Object.is()` differ from `===` and `==`?
hard
Core Fundamentals
equality
24
What are tagged template literals and how do they work?
hard
Core Fundamentals
variables
25
What are WeakRef and FinalizationRegistry?
hard
Core Fundamentals
variables
26
What is the difference between function declarations and function expressions?
easy
Functions & Objects
functions
27
What are arrow functions and how do they differ from regular functions?
easy
Functions & Objects
functions
28
What is an IIFE (Immediately Invoked Function Expression)?
easy
Functions & Objects
functions
29
What is a closure in JavaScript?
easy
Functions & Objects
closures
30
What does the `this` keyword refer to in JavaScript?
easy
Functions & Objects
this-keyword
31
What are default parameters in function definitions?
easy
Functions & Objects
functions
32
What is the difference between `call()`, `apply()`, and `bind()`?
easy
Functions & Objects
this-keyword
33
What are JavaScript classes and how do they relate to prototypes?
easy
Functions & Objects
classes
34
How do closures enable data privacy in JavaScript?
medium
Functions & Objects
closures
35
Explain the prototype chain and how property lookup works.
medium
Functions & Objects
prototypes
36
What are higher-order functions? Give examples.
medium
Functions & Objects
higher-order
37
What is function currying and how is it implemented?
medium
Functions & Objects
currying
38
How does `this` behave differently in arrow functions vs regular functions?
medium
Functions & Objects
this-keyword
39
What is the `new` keyword and what happens when you use it?
medium
Functions & Objects
prototypes
40
Explain the difference between `__proto__` and `prototype`.
medium
Functions & Objects
prototypes
41
What are getters and setters in JavaScript?
medium
Functions & Objects
classes
42
What is composition vs inheritance and when should you use each?
medium
Functions & Objects
composition
43
Explain all four `this` binding rules and their precedence.
hard
Functions & Objects
this-keyword
44
Implement a memoization function that caches results.
hard
Functions & Objects
closures
45
What is the module pattern and how does it use closures?
hard
Functions & Objects
closures
46
What are Proxy and Reflect and how do they enable metaprogramming?
hard
Functions & Objects
prototypes
47
Explain the different prototypal inheritance patterns in JavaScript.
hard
Functions & Objects
prototypes
48
What are generator functions and how do they maintain state?
hard
Functions & Objects
functions
49
How do private class fields (`#field`) work and how do they differ from closures?
hard
Functions & Objects
classes
50
What is tail call optimization and does JavaScript support it?
hard
Functions & Objects
functions
51
What is the difference between synchronous and asynchronous code?
easy
Async JavaScript
event-loop
52
What is a callback function?
easy
Async JavaScript
callbacks
53
What are Promises and what states can they be in?
easy
Async JavaScript
promises
54
What is the `async`/`await` syntax?
easy
Async JavaScript
async-await
55
What is `setTimeout` and how does it work?
easy
Async JavaScript
timers
56
What is the Event Loop in JavaScript?
easy
Async JavaScript
event-loop
57
What is the difference between `setTimeout` and `setInterval`?
easy
Async JavaScript
timers
58
How do you handle errors in Promise chains?
easy
Async JavaScript
error-handling
59
Explain the microtask queue vs the macrotask queue.
medium
Async JavaScript
microtasks
60
What is `Promise.all()` and how does it differ from `Promise.allSettled()`?
medium
Async JavaScript
promises
61
What are `Promise.race()` and `Promise.any()`?
medium
Async JavaScript
promises
62
How do you handle errors with `async`/`await`?
medium
Async JavaScript
error-handling
63
What is callback hell and how do Promises solve it?
medium
Async JavaScript
callbacks
64
How does `queueMicrotask()` work?
medium
Async JavaScript
microtasks
65
What are `AbortController` and `AbortSignal` used for?
medium
Async JavaScript
concurrency
66
How do Web Workers enable true parallelism?
medium
Async JavaScript
concurrency
67
What is the difference between parallel and concurrent execution in JavaScript?
medium
Async JavaScript
concurrency
68
Explain the complete event loop execution order with microtasks, macrotasks, and rendering.
hard
Async JavaScript
event-loop
69
How would you implement a basic Promise from scratch?
hard
Async JavaScript
promises
70
What is the Structured Clone Algorithm and how does it differ from JSON serialization?
hard
Async JavaScript
concurrency
71
How do async iterators and `for await...of` work?
hard
Async JavaScript
async-await
72
What are race conditions in JavaScript and how do you prevent them?
hard
Async JavaScript
concurrency
73
How does `requestAnimationFrame` differ from `setTimeout` for animations?
hard
Async JavaScript
event-loop
74
What is top-level `await` and what are its implications?
hard
Async JavaScript
async-await
75
Implement throttle and debounce functions.
hard
Async JavaScript
timers
76
What are ES6 modules and how do `import`/`export` work?
easy
Modern JS & Patterns
modules
77
What is the `Map` data structure and how does it differ from plain objects?
easy
Modern JS & Patterns
map-set
78
What is the `Set` data structure?
easy
Modern JS & Patterns
map-set
79
What are `Array.from()` and `Array.of()`?
easy
Modern JS & Patterns
patterns
80
What are computed property names in object literals?
easy
Modern JS & Patterns
patterns
81
What is the `for...of` loop and what is the iterable protocol?
easy
Modern JS & Patterns
iterators
82
What is object shorthand property and method syntax?
easy
Modern JS & Patterns
patterns
83
What are the different error types in JavaScript?
easy
Modern JS & Patterns
error-handling
84
What are `WeakMap` and `WeakSet` and why are they useful?
medium
Modern JS & Patterns
collections
85
What are iterators and the iterator protocol?
medium
Modern JS & Patterns
iterators
86
What are dynamic imports and when would you use them?
medium
Modern JS & Patterns
modules
87
What is the difference between deep copy and shallow copy?
medium
Modern JS & Patterns
patterns
88
What is the `structuredClone()` function?
medium
Modern JS & Patterns
patterns
89
How do ES modules differ from CommonJS modules?
medium
Modern JS & Patterns
modules
90
What is the Observer pattern and how is it used in JavaScript?
medium
Modern JS & Patterns
patterns
91
How does tree shaking work with ES modules?
medium
Modern JS & Patterns
modules
92
What are the different ways to handle errors in JavaScript?
medium
Modern JS & Patterns
error-handling
93
What is the Proxy trap pattern and how do you use it for validation?
hard
Modern JS & Patterns
proxy
94
How do generators and iterators work together for lazy evaluation?
hard
Modern JS & Patterns
generators
95
What is the Event Emitter pattern and how would you implement it?
hard
Modern JS & Patterns
patterns
96
What are memory leaks in JavaScript and how do you detect them?
hard
Modern JS & Patterns
patterns
97
How does the `Intl` API work for internationalization?
hard
Modern JS & Patterns
intl
98
What are decorators in JavaScript and what problem do they solve?
hard
Modern JS & Patterns
patterns
99
How do `import.meta` and import assertions work?
hard
Modern JS & Patterns
modules
100
What are the latest ECMAScript features (ES2024/ES2025)?
hard
Modern JS & Patterns
patterns