JavaScript Interview Questions
Interview questions covering javascript fundamentals.
JavaScript call, apply, bind methods
Learn call apply bind in JavaScript with clear examples, mental models, and common interview questions about the this keyword, context, and bind polyfills.
What is the Closure in JavaScript?
What is a closure in JavaScript? Learn how functions remember their lexical scope, see practical examples, and review common interview questions about closures.
Difference between cookie, sessionStorage, and localStorage
Compare cookies, sessionStorage and localStorage: lifetime, size limits, server access and security, and learn which browser storage to use for each case.
What are the data types in JavaScript?
What are the data types in JavaScript? Review primitives and objects, typeof quirks, type coercion, and the differences interviewers commonly ask about.
JavaScript Event Loop
Understand the JavaScript event loop: how the call stack, task queue and microtask queue work together to run asynchronous code, with clear examples.
Events: bubbling, capturing, propagation, delegation
Learn JavaScript events: bubbling, capturing, propagation and event delegation. See how events travel through the DOM and how to handle them efficiently.
Generators and Iterators in JavaScript
Learn generators and iterators in JavaScript: the iterator protocol, yield and function*, lazy sequences and practical use cases, with examples and pitfalls.
Higher Order Functions
What are higher order functions in JavaScript? Learn how functions that take or return other functions work, with map, filter, reduce and custom examples.
Hoisting in JavaScript
Learn how hoisting works in JavaScript for var, let, const, functions and classes, what the temporal dead zone is, and the questions often asked in interviews.
How does a browser render a webpage?
How does a browser render a webpage? Walk through parsing HTML and CSS, the DOM and CSSOM, layout, paint and compositing, and what triggers reflow and repaint.
Javascript Modules: AMD, CommonJS, ES6 Modules
Compare JavaScript module systems: AMD, CommonJS and ES modules. Learn their syntax, how loading differs, and which one to use in browsers and in Node.js.
Memory Management and Garbage Collection in Javascript
Learn JavaScript memory management and garbage collection: how memory is allocated, how mark-and-sweep works, and the common causes of memory leaks.
Pass by value and reference
Is JavaScript pass by value or pass by reference? Learn how primitives and objects are passed to functions, with examples and common interview pitfalls.
Understanding Promise in JavaScript
Understand JavaScript promises: states, promise chaining, error handling, and the differences between Promise.all, allSettled, race and any, with examples.
Prototypes
Learn JavaScript prototypes and the prototype chain: how inheritance works, __proto__ versus prototype, Object.create and classes, with interview examples.
Pure and Impure functions
What are pure and impure functions in JavaScript? Learn what side effects are, why pure functions are easier to test, and how to refactor impure code.
Scope, Lexical Environment, Execution Context
Learn JavaScript scope, lexical environment and execution context: how variables are resolved, how the scope chain works, and how closures relate to them.
Difference between script, script-async, script-defer
Learn the difference between script, async and defer in HTML: how each affects HTML parsing and script execution order, and which to use for page speed.
this keyword in javascript
How does the this keyword work in JavaScript? Learn the binding rules for default, implicit, explicit and arrow functions, with examples and interview pitfalls.
What happens when you type URL in browser
What happens when you type a URL in the browser? Follow the steps from DNS lookup and TCP and TLS to the HTTP request, server response and page rendering.
var, let, and const
Learn the differences between var, let and const in JavaScript: scope, hoisting, the temporal dead zone and reassignment, plus which one to use and why.