Skip to content

kumaratul60/javascript-interview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

246 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Ultimate JavaScript Interview Playbook

Made with JavaScript

JS Illustration

๐Ÿง  What is JavaScript?

JavaScript is a highโ€‘level, interpreted (JITโ€‘compiled), dynamically & weekly typed, multiโ€‘paradigm, prototypeโ€‘based, singleโ€‘threaded, eventโ€‘driven language for building web, mobile, and serverโ€‘side applications.

It supports objectโ€‘oriented, functional, and imperative styles, and runs:

  • In browsers via engines like V8, SpiderMonkey, JavaScriptCore
  • On servers via Node.js (V8)

๐Ÿ“š Table of Contents


๐ŸŽฏ Beginner Level

๐Ÿ”ง Core Characteristics

  • Dynamically Typed: Variables are not bound to a specific type.
  • Weekly Typed: Type coercion is allowed between incompatible types.
  • Prototype-based Inheritance: Objects can inherit directly from other objects.
  • Single-threaded with Event Loop: Uses call stack, callback queue/task queue/macrotask queue, and microtask queue to manage concurrency.
  • Lexical Scoping & Closures: Functions have access to the scope in which they were defined.
  • Garbage Collected: Automatic memory management.
  • JIT Compiled: Modern JS engines (V8, SpiderMonkey) optimize execution using Just-in-Time compilation.

๐ŸŒ Execution Environment

  • V8 (Chrome, Edge)
  • SpiderMonkey (Firefox)
  • JavaScriptCore (Safari)

Server Runtime

  • Node.js (V8)
  • APIs: modules, streams, clusters, process, filesystem

๐Ÿ“ฆ Data Types & Coercion

  • Primitive vs Reference types
  • Primitive types: Number, String, Boolean, null, undefined, Symbol, BigInt
  • Non-primitive: Object, Array, Function
  • == vs ===, truthy/falsy
  • Type conversions & typeof, instanceof, Object.prototype.toString.call()

๐Ÿ” Scopes & Closures

  • Execution context: global, function, eval
  • Scope chain and lexical scope
  • Function scope vs block scope
  • Closures: memory, use cases, leaks
  • IIFE (Immediately Invoked Function Expression)
  • Variables: var / let / const
  • Hoisting & Temporal Dead Zone (TDZ)
  • Scopes & Lexical Environment
  • this, eval(), with statement
  • Primitive vs Reference types
  • Shallow vs Deep copy
  • Strict mode
  • The this, window keyword
  • Closures, IIFE
  • call, bind, apply

โšก Intermediate Level

๐Ÿ”„ Asynchronous JavaScript

  • Callbacks & Promises
  • Promise.all, Promise.race, Promise.any
  • Promises: chaining, error handling
  • async/await: syntax, error flow, parallel execution
  • Call Stack & Heap
  • Event Loop & Task Queues
  • Microtasks vs Macrotasks

๐Ÿ—๏ธ Object System

  • Object creation: literals, constructors, Object.create
  • Prototypes vs ES6 Classes
  • Prototypes and prototype chaining
  • __proto__ vs prototype
  • ES6 Classes vs constructor functions
  • Inheritance patterns: classical vs prototypal

๐ŸŒ Browser APIs

  • DOM traversal & manipulation
  • Events: bubbling, capturing,
  • addEventListener vs inline handlers
  • LocalStorage, SessionStorage, cookies
  • Fetch API, XMLHttpRequest
  • Web APIs: Geolocation, Notifications, History API

๐Ÿ–ฅ๏ธ Node.js Concepts

  • Modules: CommonJS vs ES Modules
  • Global objects: process, __dirname, __filename
  • EventEmitter
  • EventEmitter, Streams, Buffers
  • OS, Process, Cluster, File System
  • File system, Path module
  • Async patterns in Node.js

๐Ÿš€ Advanced Level

๐Ÿงฉ Advanced Internals

Concept Details
Call Stack Function execution contexts (LIFO)
Heap Dynamic memory allocation
Event Loop Manages callbacks, timers, Promises
Micro vs Macro Tasks Promise callbacks vs setTimeout/I/O
Execution Context Creation (scope, hoisting, this) + execution
Hoisting Declarations moved to top of scope
Closures Inner functions retain access to outer scope
this Determined by callโ€‘site & strict/nonโ€‘strict mode
Scope Chain Lexical scope lookup
Memory Leaks Unreleased closures, event listeners, DOM references
Shadowing & TDZ Block scope with let/const before initialization

๐Ÿ“ˆ Memory & Performance

  • Garbage Collection (Markโ€‘andโ€‘Sweep)
  • Memory leaks: closures, DOM references, timers, Detecting & avoiding memory leaks
  • Performance profiling (DevTools)

๐Ÿ› ๏ธ Advanced Patterns & Techniques

  • Currying, Partial Application
  • Debounce & Throttle
  • Function Composition
  • Memoization
  • Module pattern, Revealing Module, Singleton patterns
  • Factory vs Constructor pattern
  • Pub/Sub and Observer pattern

๐Ÿงช Testing, Debugging & Tooling

  • Chrome DevTools: breakpoints, performance monitor
  • debugger keyword
  • Unit testing with Jest, Mocha
  • Static analysis: ESLint, Prettier
  • Bundlers: Webpack, Vite, Parcel
  • Transpilers: Babel

๐ŸŒŸ ES6 โ†’ ES2025 Highlights

  • Blockโ€‘scoped let, const
  • Arrow functions & lexical this
  • Template literals & tagged templates
  • Destructuring & spread/rest operators
  • Modules (import / export)
  • Promises, async/await, topโ€‘level await
  • Classes (syntactic over prototypes)
  • Optional chaining (?.), nullish coalescing (??)
  • BigInt, globalThis, WeakRef, Promise.allSettled, etc.

๐ŸŒ Where JavaScript Is Used

Domain Examples
Frontend React, Vue, Angular
Backend Node.js, Express, Nest.js
Mobile React Native, NativeScript
Desktop Electron, Tauri
Automation Puppeteer, Playwright, Deno
AI & ML TensorFlow.js, ONNX.js
Edge Compute Cloudflare Workers, Vercel Edge Functions

๐Ÿงช JS Quiz Practice & Resources

Practice these key concepts to solidify your understanding:

  • Global, Block, Function Scope
  • Lexical Scope, Shadowing, TDZ
  • Module vs Script scope

๐Ÿ”— Beginner Resources

๐Ÿ”— Intermediate Resources

๐Ÿ”— Advanced Resources

Design Patterns

๐Ÿ”— React & Framework Resources


๐Ÿ’ฌ Discussion & Issues

Have questions, or want to dive deeper? Use the Issues tab to:

๐Ÿ“Œ Suggest new topics or resources

๐Ÿ› Report errors

๐Ÿ’ก Propose improvements

We encourage open discussionโ€”everyoneโ€™s contribution makes this kit better!

๐Ÿ™Œ Contribution & License

Want to help others ace their JavaScript interviews? Contributions in the form of questions, explanations, or improvements are welcome!

Feel free to contribute questions, answers, explanations or improvements via pull requests.

Licensed under MIT ยฉ Atul Kumar Awasthi.

About

A comprehensive JavaScript interview guide covering fundamentals, design patterns, and number concepts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก