Skip to content

kumaratul60/javascript-interview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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


🔧 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

Browser Engines

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

Server Runtime

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

🧩 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

🚀 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

📦 Core Topics to Master

1. Language Deep Dive

  • 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

2. Execution Model

  • Call Stack & Heap
  • Event Loop & Task Queues
  • Microtasks vs Macrotasks

3. Asynchronous JavaScript

  • Callbacks & Promises
  • Promise.all, Promise.race, Promise.any
  • Promises: chaining, error handling
  • async/await: syntax, error flow, parallel execution

4. Memory & Performance

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

5. 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

6. 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()

7 . Scopes & Closures Practice

  • 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)

8. Browser APIs

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

9. 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

10. 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

11. 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

🧪 JS Quiz Practice & Resources

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

🔗 Links


💬 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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published