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)
- JavaScript Interview Preparation Kit
- 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.
- V8 (Chrome, Edge)
- SpiderMonkey (Firefox)
- JavaScriptCore (Safari)
- Node.js (V8)
- APIs: modules, streams, clusters, process, filesystem
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 |
- 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.
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 |
- 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
- Call Stack & Heap
- Event Loop & Task Queues
- Microtasks vs Macrotasks
- Callbacks & Promises
Promise.all
,Promise.race
,Promise.any
- Promises: chaining, error handling
async/await
: syntax, error flow, parallel execution
- Garbage Collection (Mark‑and‑Sweep)
- Memory leaks: closures, DOM references, timers, Detecting & avoiding memory leaks
- Performance profiling (DevTools)
- Object creation: literals, constructors,
Object.create
- Prototypes vs ES6 Classes
- Prototypes and prototype chaining
__proto__
vsprototype
- ES6 Classes vs constructor functions
- Inheritance patterns: classical vs prototypal
- 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()
- 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)
- DOM traversal & manipulation
- Events: bubbling, capturing,
addEventListener
vs inline handlers- LocalStorage, SessionStorage, cookies
- Fetch API, XMLHttpRequest
- Web APIs: Geolocation, Notifications, History API
- 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
- Currying, Partial Application
- Debounce & Throttle
- Function Composition
- Memoization
- Module pattern, Revealing Module, Singleton patterns
- Factory vs Constructor pattern
- Pub/Sub and Observer pattern
- Chrome DevTools: breakpoints, performance monitor
debugger
keyword- Unit testing with Jest, Mocha
- Static analysis: ESLint, Prettier
- Bundlers: Webpack, Vite, Parcel
- Transpilers: Babel
- Global, Block, Function Scope
- Lexical Scope, Shadowing, TDZ
- Module vs Script scope
- JavaScript Scope Tutorial
- Understanding JavaScript Scoping
- JavaScript Challenge #11
- JavaScript Challenge #13
- JavaScript Challenge #14
- JavaScript Challenge #15
- JavaScript Challenge #17
- JavaScript Interview Questions
- CodeChef JavaScript Skill Test
- TypeOfNaN JavaScript Quiz
- JavaScript is Weird
- Advanced JavaScript Quiz
- JavaScript Questions by Lydia Hallie
- JavaScript Date Master
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!
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.