Okay, buckle up! You've asked for the most extensive, all-encompassing list of JavaScript topics and subtopics for a Frontend SDE interview, aiming for maximum length and completeness. This isn't just about syntax; it covers core concepts, the runtime environment (especially the browser), modern features, performance, tooling, and even related architectural patterns.
Here is that list, broken down into major categories and detailed subtopics:
The Absolutely Exhaustive JavaScript Interview Topic List for Frontend SDEs
This list is designed to cover virtually any JavaScript-related question you might encounter in a Frontend Software Development Engineer interview, ranging from foundational knowledge to advanced concepts, browser interactions, performance, and tooling.
I. Core Language Fundamentals & Syntax
-
JavaScript Introduction & History
- What is JavaScript?
- Relation to ECMAScript.
- Brief history (ES1 to latest versions).
- JavaScript engines (V8, SpiderMonkey, etc.) and their role.
- Interpreted vs. Compiled (JIT compilation).
-
Variables and Scoping
- Declaring variables:
var, let, const.
- Key differences between
var, let, and const.
- Hoisting: Understanding variable and function hoisting behavior.
- Hoisting with
var.
- Hoisting with
let and const (Temporal Dead Zone - TDZ).
- Scope:
- Global scope.
- Function scope (
var).
- Block scope (
let, const).
- Lexical scope.
- Scope Chain: How scopes are nested and resolved.
-
Data Types
- Primitive Types:
string: Creation, immutability, common methods (slice, substring, indexOf, replace, trim, toLowerCase, toUpperCase, template literals).
number: Integer and floating-point, Infinity, NaN, isFinite, isNaN, parsing (parseInt, parseFloat), Number methods.
boolean: true, false, truthy and falsy values.
null: Represents intentional absence of any object value.
undefined: Represents an uninitialized or missing value. Differences between null and undefined.
symbol (ES6): Creating unique identifiers, Symbol.for, Symbol.iterator.
bigint (ES11): Handling arbitrary precision integers, differences from number.
- Object Type:
- General Objects (
{}): Property access (., []), adding/deleting properties.
- Arrays (
[]): Creation, indexing, sparse arrays, common array methods (see II.6).
- Functions: First-class citizens (see II.1).
- Built-in Objects:
Date, RegExp, Map, Set, WeakMap, WeakSet (see II.7).
-
Type Coercion
- Automatic type conversion: Implicit coercion rules (e.g.,
==, arithmetic operations).
- Explicit type conversion: Using functions like
String(), Number(), Boolean().
- Loose equality (
==) vs. Strict equality (===): Detailed differences and pitfalls of ==.
- The
typeof operator.
- The
instanceof operator.
-
Operators
- Arithmetic operators (
+, -, *, /, %, **).
- Assignment operators (
=, +=, -=, etc.).
- Comparison operators (
==, !=, ===, !==, >, <, >=, <=).
- Logical operators (
&&, ||, !).
- Short-circuiting behavior of
&& and ||.
- Bitwise operators (
&, |, ^, ~, <<, >>, >>>).
- Unary operators (
+, -, ++, --, typeof, delete, void).
- Ternary (conditional) operator (
? :).
- Spread syntax (
...) for arrays and objects.
- Rest parameters (
...) for functions.
- Destructuring assignment (Array and Object).
- Comma operator (
,).
- Operator precedence and associativity.
-
Control Flow
if, else if, else statements.
switch statement.
for loop.
while loop.
do...while loop.
for...in loop (iterating over object properties, including inherited).
for...of loop (iterating over iterable objects like arrays, strings, maps, sets). Differences between for...in and for...of.
break and continue statements.
- Labeled statements.
-
Strict Mode ('use strict')
- What it does and why use it.
- Key restrictions and changes in behavior (e.g., disallowing global variables without
var, changing this binding).
II. Functions and Asynchronous JavaScript
-
Functions (First-Class Citizens)
- Function Declarations vs. Function Expressions vs. Arrow Functions.
- Differences in hoisting,
this binding, arguments object, constructability.
- Parameters and Arguments.
- Default parameters (ES6).
- Rest parameters (ES6).
- The
arguments object (and its limitations).
- Return values.
- Immediate Invoked Function Expressions (IIFEs): Purpose and syntax.
- Higher-Order Functions (HOFs): Functions that take functions as arguments or return functions. Examples (
map, filter, reduce).
- Pure Functions: Definition and benefits (testability, predictability).
- Recursion: Understanding recursive function calls and base cases.
-
this Binding
- Understanding the
this keyword in JavaScript.
- Different
this binding rules:
- Default binding (global/undefined in strict mode).
- Implicit binding (method calls).
- Explicit binding (
call, apply, bind). Differences between call/apply and bind.
new binding (constructor calls).
- Lexical binding (
this in arrow functions).
- Handling
this in event handlers and asynchronous code.
-
Closures
- Definition: What is a closure? How is it formed?
- How closures work (remembering the outer environment).
- Common use cases:
- Creating private variables/methods.
- Factory functions.
- Event handlers.
- Memoization.
- Implementing modules (Module Pattern).
- Potential pitfalls: Memory leaks with closures (e.g., circular references, detached DOM nodes).
-
Asynchronous JavaScript: Concepts & Techniques
- Understanding Synchronous vs. Asynchronous code execution.
- The JavaScript Event Loop:
- Call Stack.
- Web APIs (Timers, DOM events, HTTP requests).
- Callback Queue (Task Queue / Macro Queue).
III. Objects, Prototypes, and Classes
-
Objects
- Object literal notation (
{}).
- Constructor functions (
function Person() { this.name = ... }).
Object.create(): Creating objects with a specific prototype.
- Accessing/Modifying properties (
., []).
- Property Attributes/Descriptors:
value, writable, enumerable, configurable.
Object.defineProperty(), Object.defineProperties().
Object.getOwnPropertyDescriptor(), Object.getOwnPropertyNames(), Object.getOwnPropertySymbols().
- Enumerating properties:
for...in, Object.keys(), Object.values(), Object.entries(). Differences and use cases.
- Getters and Setters (
get, set keywords).
- Property shorthand (ES6).
- Computed property names (ES6).
- Immutability techniques:
Object.freeze(), Object.seal(), Object.preventExtensions(). Differences.
-
Prototypes and Prototypal Inheritance
- Every object has a prototype (
__proto__).
- The
prototype property of constructor functions.
- The Prototype Chain: How property lookups work.
- How inheritance is implemented in JavaScript via the prototype chain.
Object.getPrototypeOf().
isPrototypeOf().
hasOwnProperty().
- Understanding the relationship between
__proto__ and prototype.
- The
instanceof operator.
-
Classes (ES6)
class keyword: Constructor, methods, static methods.
- Class inheritance:
extends and super().
- Private class fields (
#field) (ES13).
- Static fields (ES12).
- Understanding that classes are syntactic sugar over prototypes.
-
Built-in Object Types and Data Structures
IV. Modules
-
Understanding Module Systems
- Why modules are needed (organization, dependency management, avoiding global scope pollution).
- Evolution of module systems:
- IIFEs (simulating private scope).
- CommonJS (synchronous loading, used in Node.js:
require, module.exports, exports).
- AMD (asynchronous module definition, used in RequireJS).
- UMD (Universal Module Definition, compatible with multiple systems).
-
ES Modules (import / export) (ES6)
export statements: Named exports, default export.
import statements: Named imports, default import, namespace import (import * as ...), importing for side effects.
- Differences between ES Modules and CommonJS (
import/export are static vs. dynamic, this binding).
- Dynamic Imports (
import()) (ES11): Loading modules conditionally or on demand.
- Tree Shaking: How bundlers use ES Module structure to eliminate dead code.
V. Error Handling
try...catch...finally Statements
- Handling synchronous errors.
- The
Error object (name, message, stack).
throw Statement
- Creating and throwing custom errors.
- Types of Built-in Errors
ReferenceError, TypeError, SyntaxError, RangeError, URIError, EvalError.
- Handling Asynchronous Errors
- Error handling with Callbacks (passing error as first argument).
- Error handling with Promises (
catch()).
- Error handling with
async/await (try...catch).
- Global Error Handling
window.onerror event.
unhandledrejection event (for unhandled Promise rejections).
VI. Modern JavaScript Features (Beyond ES6 - ES7+)
Array.prototype.includes (ES7).
- Exponentiation operator
** (ES7).
- Async/Await (ES8).
Object.entries, Object.values, Object.getOwnPropertyDescriptors (ES8).
- String padding (
padStart, padEnd) (ES8).
- Trailing commas in function parameters (ES8).
- Shared Memory and Atomics (ES8 - more advanced, less common in typical FE interviews unless specialized).
- Rest/Spread Properties for Objects (ES9).
Promise.prototype.finally (ES9).
- Asynchronous Iterators and Generators (ES9).
for await...of (ES9).
- Regular Expression updates (ES9): s flag, lookbehind assertions, named capture groups.
Array.prototype.flat, Array.prototype.flatMap (ES10).
Object.fromEntries (ES10).
String.prototype.trimStart, trimEnd (ES10).
Symbol.prototype.description (ES10).
- Optional Catch Binding (ES10).
BigInt (ES11).
- Dynamic
import() (ES11).
Promise.allSettled (ES11).
- Optional Chaining (
?.) (ES11).
- Nullish Coalescing (
??) (ES11).
String.prototype.replaceAll (ES12).
Promise.any (ES12).
AggregateError (ES12).
- Logical Assignment Operators (
&&=, ||=, ??=) (ES12).
- Numeric Separators (
1_000_000) (ES12).
- Class fields (
#field, static field) (ES13).
- Top-level
await (ES13).
Array.prototype.at (ES13).
Object.hasOwn (ES13).
Error.cause (ES13).
Array.prototype.findLast, findLastIndex (ES14).
- Hashbang Grammar (ES14 - primarily for CLI scripts).
Symbol.isRegistered, Symbol.keyFor (ES14 - clarification).
ArrayBuffer.prototype.detached (ES15).
Promise.withResolvers (ES15).
VII. Browser Environment & APIs (Critical for Frontend)
-
The Document Object Model (DOM)
- What is the DOM? How it represents HTML/XML.
- DOM Tree: Nodes, Elements, Text Nodes, Attributes.
- Accessing DOM Elements:
getElementById, getElementsByClassName, getElementsByTagName.
querySelector, querySelectorAll (CSS selectors).
closest(), matches().
- Traversing the DOM:
parentNode, children, firstChild, lastChild, nextElementSibling, previousElementSibling, firstElementChild, lastElementChild, etc.
- Modifying the DOM:
- Creating elements:
createElement, createTextNode.
- Adding elements:
appendChild, insertBefore.
- Removing elements:
removeChild, remove().
- Replacing elements:
replaceChild.
- Setting/Getting content:
textContent, innerHTML, outerHTML. Differences and security implications (innerHTML).
- Managing Attributes:
getAttribute, setAttribute, removeAttribute, hasAttribute.
- Managing Classes:
classList (add, remove, toggle, contains).
- Managing Styles:
style property (inline styles), getComputedStyle().
- Using
DocumentFragment for efficient updates.
- DOM manipulation performance considerations.
-
Events
- Event Handling Mechanisms: Inline (
onclick), DOM Level 0 (element.onclick), DOM Level 2 (addEventListener/removeEventListener). Advantages of addEventListener.
- Event Object:
target, currentTarget, type, preventDefault(), stopPropagation(), stopImmediatePropagation().
- Event Flow: Bubbling and Capturing phases.
VIII. Networking
- HTTP Requests
- Understanding HTTP methods (GET, POST, PUT, DELETE, PATCH).
- HTTP Headers (Request and Response):
Content-Type, Authorization, Cache-Control, Origin, etc.
- Status Codes (200, 201, 400, 401, 403, 404, 500, etc.).
XMLHttpRequest (XHR)
- Basic usage patterns (readyState, status).
- Handling responses.
Fetch API (Modern Standard)
- Returns Promises.
fetch(url, options).
Request and Response objects.
- Handling JSON responses (
response.json()).
- Handling network errors vs. HTTP errors.
- Setting headers, request body.
AbortController: Cancelling fetch requests.
- CORS (Cross-Origin Resource Sharing): Basic understanding, preflight requests, common headers (
Origin, Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers). How the browser enforces it.
- WebSockets
- Basics of persistent, full-duplex communication.
- Connecting, sending/receiving messages, closing.
IX. Performance and Optimization
- Runtime Performance
- Minimizing DOM manipulations (batch updates,
DocumentFragment).
- Efficient Event Handling: Event Delegation.
- Avoiding forced synchronous layouts (layout thrashing).
- Debouncing and Throttling: Use cases (input handling, scroll events, window resizing) and implementation strategies.
- Optimizing loops and recursive functions.
- Efficient data structure usage (Maps/Sets vs. Objects/Arrays).
- Understanding and avoiding common memory leaks (detached DOM nodes, excessive closures, uncleared timers/event listeners).
- Using Web Workers for CPU-intensive tasks.
- Virtualizing lists/grids for large datasets.
- Loading Performance
- Lazy Loading: Images (
loading="lazy"), components, code splitting (bundler configurations).
- Code Splitting: Breaking code into smaller chunks for faster initial load.
- Optimizing static assets (compression, caching).
- Async and Defer attributes for
<script> tags.
- Understanding browser caching mechanisms.
- HTTP/2 benefits (multiplexing).
- Monitoring and Tooling
- Browser Developer Tools:
- Performance tab (profiling runtime, identifying bottlenecks).
- Memory tab (heap snapshots, finding memory leaks).
- Network tab (request timing, size, headers).
- Lighthouse/PageSpeed Insights (Web Vitals, best practices).
- Web Vitals (LCP, FID, CLS): Basic understanding and how JS can impact them.
X. Testing
- Testing Principles
- Importance of testing.
- Types of tests: Unit Tests, Integration Tests, End-to-End Tests (brief overview).
- Test Driven Development (TDD) / Behavior Driven Development (BDD) (concepts).
- Testing Frameworks (Awareness)
- Jest, Mocha, Jasmine, Vitest.
- Assertion Libraries
- Testing JavaScript Code
- Writing unit tests for pure functions.
- Mocking and Spying: Mocking dependencies (functions, modules, APIs), using spies to check if functions were called.
- Testing Asynchronous Code (using
done callbacks, returning Promises, async/await with testing frameworks).
- Testing DOM Interactions (e.g., using
@testing-library/dom or simulating events).
- Test Coverage.
XI. Build Tools and Tooling
- Transpilers (
Babel)
- Why needed (writing modern JS, targeting older browsers).
- How it works (parsing, transforming, generating).
- Presets and Plugins.
- Bundlers (
Webpack, Rollup, Parcel, Vite)
- Why needed (managing modules, optimizing assets, development features).
- Core concepts: Entry points, output, loaders, plugins, module resolution, code splitting.
- Comparing different bundlers (key features, speed, configuration).
- Linters (
ESLint)
- Why needed (code quality, consistency, finding errors).
- Configuration (
.eslintrc).
- Integrating with build process and editors.
- Formatters (
Prettier)
- Why needed (code style consistency).
- Integration.
- Package Managers (
npm, yarn, pnpm)
package.json: dependencies, devDependencies, scripts.
- Installing, updating, uninstalling packages.
- Lock files (
package-lock.json, yarn.lock, pnpm-lock.yaml).
- Running scripts.
npm ci vs npm install.
- Semantic Versioning (SemVer).
XII. Design Patterns & Programming Paradigms
- Programming Paradigms in JS:
- Imperative vs. Declarative programming.
- Procedural programming.
- Object-Oriented Programming (OOP): Encapsulation, Inheritance (prototypal), Polymorphism (duct typing).
- Functional Programming (FP): Pure functions, immutability, HOFs, composition.
- Common Design Patterns (JavaScript/Frontend Context)
- Module Pattern / Revealing Module Pattern.
- Factory Pattern.
- Singleton Pattern.
- Observer Pattern / Publish-Subscribe Pattern (especially relevant for state management, event systems).
- Decorator Pattern.
- Adapter Pattern.
- Proxy Pattern.
- Mixin Pattern.
- Constructor Pattern.
- Prototype Pattern.
- Command Pattern.
- Mediator Pattern.
- State Pattern.
- Strategy Pattern.
- Component Pattern (fundamental in modern frameworks).
- Higher-Order Components (HOCs) (React specific, but concept is HOF).
- Render Props (React specific pattern).
- Container/Presentational Components Pattern (React specific pattern).
XIII. Algorithms and Data Structures (JavaScript Specific)
- Basic Data Structures Implementation (in JS):
- Stacks (using arrays).
- Queues (using arrays, or linked list for efficiency).
- Linked Lists (Singly, Doubly).
- Trees (Binary Trees, BST - basic concepts).
- Graphs (basic representation - Adjacency List/Matrix).
- Hash Maps (using JS Objects or
Map).
- Heaps (priority queues - concepts).
- Common Algorithms (Implementation and Analysis in JS):
- Searching: Linear Search, Binary Search (requires sorted data).
- Sorting: Bubble Sort, Selection Sort, Insertion Sort (basic understanding, complexity), Merge Sort, Quick Sort (understanding recursive approach, complexity). JS built-in
sort() method and its caveats.
- Recursion and Iteration: Converting between recursive and iterative solutions.
- Basic Graph Traversal (BFS, DFS - concepts).
- Dynamic Programming (basic concepts).
- String manipulation algorithms.
- Array manipulation algorithms.
- Complexity Analysis (Big O Notation)
- Understanding Time Complexity (O(1), O(log n), O(n), O(n log n), O(n²), O(2^n), O(n!)).
- Understanding Space Complexity.
- Analyzing the complexity of common JS operations and algorithms.
XIV. JavaScript Engine & Runtime Concepts
- JavaScript Engine Architecture
- Parser, AST (Abstract Syntax Tree).
- Interpreter, Compiler (JIT).
- Optimization techniques (e.g., Inline Caching, Hidden Classes in V8).
- Garbage Collection:
- Mark-and-sweep algorithm (simplified).
- Generational hypothesis (new vs. old objects).
- Identifying and preventing memory leaks.
- The Global Object (
window in browsers, global in Node)
- Properties and methods of the global object.
this and Execution Contexts
- Global Execution Context.
- Function Execution Contexts.
- Lexical Environment and Variable Environment within contexts.
- The Event Loop (Deep Dive)
- Revisiting the call stack, heap, queues.
- Detailed processing order of macrotasks and microtasks.
- Browser rendering pipeline (repaint, reflow/layout) and its relation to the event loop.
XV. Security in Frontend JavaScript
- Cross-Site Scripting (XSS)
- Types (Stored, Reflected, DOM-based).
- How attackers exploit it.
- Prevention strategies: Sanitizing user input, using safe APIs (
textContent), Content Security Policy (CSP).
- Cross-Site Request Forgery (CSRF)
- How attackers exploit it.
- Prevention strategies (CSRF tokens, SameSite cookies, origin checks).
- Importance of HTTPS.
- Securely handling sensitive data (avoiding storing credentials in
localStorage).
- CORS misconfigurations as potential vulnerabilities.
- Client-side vs. Server-side validation.
XVI. Miscellaneous & Advanced Topics
- Copying Data:
- Shallow Copy vs. Deep Copy.
- Techniques for shallow copy (
... spread, Object.assign).
- Techniques for deep copy (
JSON.parse(JSON.stringify()) limitations, structuredClone API, recursive functions, utility libraries like Lodash's cloneDeep).
- Tagged Template Literals: Use cases (DSL, styling libraries).
- Proxies and Reflect API (ES6): Intercepting operations on objects, use cases (logging, profiling, validation, data binding).
Intl Object (Internationalization API): Formatting dates, numbers, currencies, collations.
- WebAssembly (Wasm): Basic understanding of what it is and how JS interacts with it.
- Regular Expressions (Advanced): Lookarounds, backreferences, groups, character classes, flags (g, i, m, u, y, s).
- Concurrency utilities:
queueMicrotask, requestIdleCallback.
- Iterators and Generators (ES6):
- The Iterator protocol (
[Symbol.iterator](), next() method, done, value).
- Generators (
function*, yield). Use cases (async flows, infinite sequences).
This list is intentionally exhaustive. No single interview will cover all of these topics in depth. The specific areas emphasized will depend on the company, the team's focus, and the seniority of the role. However, a strong Frontend SDE should have a solid grasp of most topics in sections I-IX, a good understanding of X-XII, and at least awareness of XIII-XVI.
Be prepared not just to define these terms, but to explain why they matter, how they work under the hood, write code examples, debug related issues, and discuss trade-offs and best practices. Good luck!