JavaScript

0%
Coding
Theory
Quiz

    Variables Scope & Hoisting

    • What is the difference between var, let, and const?

      Junior
    • Explain the difference between Global Scope, Function Scope, and Block Scope.

      Junior
    • What is variable shadowing?

      Junior
    • What is the Temporal Dead Zone (TDZ), and why can't let and const variables be accessed before their declaration even though they are hoisted?

      Mid
    • How does the JavaScript engine handle nested scopes when looking up a variable?

      Mid
    • Why can you access a variable defined with var before its declaration, but not one defined with let?

      Mid
    • What are the tradeoffs of using global scope, and how do ES Modules help mitigate these issues?

      Mid
    • What is the difference between Lexical Scope and Dynamic Scope?

      Senior
    • Why does hoisting happen in JavaScript? Explain how the engine handles function declarations vs. variable declarations during the creation phase.

      Senior

    Data Types & Values

    • What is the difference between null and undefined? When would you intentionally use one over the other?

      Junior
    • How does the typeof operator behave with null and arrays, and why is typeof null returning 'object' a historical bug?

      Junior
    • What are the primitive data types in JavaScript?

      Junior
    • Why does 0.1 + 0.2 not equal 0.3 in JavaScript?

      Junior
    • What are 'truthy' and 'falsy' values? Why is [] == false true, but [] itself is truthy?

      Mid
    • What is NaN, and why is typeof NaN a 'number'?

      Mid
    • What is a Symbol in JavaScript, and what are some practical use cases for it?

      Mid

    Type Coercion & Equality

    • What is type coercion, and why is === generally preferred over ==? Are there cases where == is actually useful?

      Junior
    • Explain implicit type coercion in JavaScript.

      Mid
    • What is the difference between Object.is() and the strict equality operator (===)?

      Mid
    • Why does [] + [] result in an empty string?

      Senior

    Functions & This Binding

    • What is a higher-order function? Provide examples from the built-in Array.prototype.

      Junior
    • What is the difference between an arrow function and a regular function regarding this?

      Junior
    • What is the difference between a function declaration and a function expression?

      Junior
    • What is the difference between map, forEach, filter, and reduce?

      Junior
    • How is the value of this determined in different contexts (e.g., arrow functions, regular functions, methods, and the new keyword)?

      Mid
    • Explain 'Function Currying' and why you might use it.

      Mid
    • What is the difference between .call(), .apply(), and .bind()? When would you use one over the others?

      Mid
    • What is an IIFE (Immediately Invoked Function Expression), and why was it commonly used?

      Mid

    Objects Prototypes & Inheritance

    • What is the difference between __proto__ and prototype?

      Mid
    • What is prototypal inheritance, and how does it differ from classical inheritance found in languages like Java or C++?

      Mid
    • Explain the prototype chain. What happens when you try to access a property that doesn't exist on an object?

      Mid
    • What happens under the hood when you call a function with the new keyword?

      Mid
    • Why are ES6 classes called syntactic sugar?

      Mid
    • How does the instanceof operator work, and how does it relate to the prototype chain?

      Mid
    • When would you use Object.create(null) instead of a standard object literal?

      Senior

    Asynchronous Javascript

    • What are the three states of a Promise?

      Junior
    • Why would you use async/await over raw Promises? Are there any performance trade-offs?

      Mid
    • What is the difference between Promise.all, Promise.allSettled, Promise.any, and Promise.race, and when would you choose one over the others?

      Mid
    • How does the fetch API handle HTTP error status codes like 404 or 500?

      Mid
    • When would you use Promise.allSettled instead of Promise.all?

      Mid
    • What are the different states of a Promise, and can a Promise be 'cancelled' in native JavaScript?

      Mid
    • Why does await block the execution of a function but not the entire main thread?

      Mid
    • How does error handling work with try/catch/finally, and how do you create custom error types?

      Mid
    • Why does a Promise resolve before a setTimeout(0)?

      Senior
    • What happens if a Promise is never resolved or rejected, and how does the engine handle this hanging state?

      Senior

    Dom & Events

    • What does preventDefault() do, and how does it differ from stopPropagation()?

      Junior
    • What is 'Event Delegation' and why is it considered a performance optimization?

      Mid
    • Explain Event Bubbling and Event Capturing. How do you stop an event from propagating?

      Mid
    • What is the difference between stopPropagation() and stopImmediatePropagation()?

      Mid
    • What is the difference between an attribute and a property in the DOM?

      Mid
    • What is requestAnimationFrame, and how does it differ from setTimeout for animations?

      Mid
    • What is the difference between the DOM, the Virtual DOM, and the Shadow DOM?

      Senior

    Closures & Functional Programming

    • How can you use closures to create private variables?

      Junior
    • Explain the difference between passing by value and passing by reference in JavaScript.

      Junior
    • Explain closures and provide a real-world example of when you would use one.

      Mid
    • What is a 'Pure Function' and why are they preferred in many modern architectures?

      Mid
    • What is 'Memoization' and how does it relate to closures?

      Mid
    • What does Object.freeze() do, and how can you achieve immutability in JavaScript?

      Mid
    • How does JSON.stringify handle things like functions, undefined, and circular references, and what do the replacer and toJSON do?

      Mid
    • What is structuredClone and when would you use it over JSON.parse(JSON.stringify())?

      Senior

    Operators & Syntax

    • What is the Nullish Coalescing operator (??) and how does it differ from the Logical OR operator?

      Junior
    • What is 'Optional Chaining' (?.) and where does it short-circuit?

      Junior
    • What is the difference between the spread operator and rest parameters, and how are they used?

      Junior
    • What is destructuring assignment, and how does it work for objects and arrays?

      Junior
    • What is the difference between for...in and for...of loops?

      Junior

    Language Features & Techniques

    • Explain the difference between shallow copy and deep copy, and when is structuredClone() preferred over JSON.parse(JSON.stringify())?

      Mid
    • What is the difference between Map/Set and WeakMap/WeakSet, and why would you use a weak version for memory management?

      Mid
    • What are the trade-offs of using a Map versus a plain Object for storing key-value pairs?

      Mid
    • What are the trade-offs between Throttling and Debouncing? When would you use one over the other for a search input vs. a window resize event?

      Mid
    • Explain the concept of 'Tree Shaking' and how static import/export statements enable it.

      Mid
    • What are Generator functions, and how do they differ from standard functions in terms of execution control?

      Mid
    • What is 'Strict Mode' (use strict) and what specific errors does it prevent?

      Mid
    • What are private class fields (using the # prefix), and how do they differ from the convention of using underscores?

      Mid
    • What is Object.groupBy(), and how does it differ conceptually from using reduce for grouping?

      Mid
    • Explain the difference between ES Modules (import/export) and CommonJS (require/module.exports). Why did the industry move toward ESM?

      Senior
    • Explain the difference between Short Polling, Long Polling, and WebSockets. When is each appropriate?

      Senior
    • What is the iterable and iterator protocol in JavaScript?

      Senior

    Browser Rendering & Storage

    • Compare localStorage, sessionStorage, and Cookies. What are the security and storage-limit trade-offs of each?

      Mid
    • Explain the role of an AbortController and how it is used to cancel a fetch request or remove multiple event listeners.

      Mid
    • What is the difference between a Web Worker and a Service Worker, and when would you use one over the other?

      Mid
    • Explain the Critical Rendering Path. How does JavaScript execution affect the parsing of HTML and CSS?

      Senior
    • How does the Event Loop decide when to perform a UI re-render in the browser?

      Senior
    • What is the difference between a reflow and a repaint? Which one is more expensive, and how can you minimize them?

      Senior

    Event Loop & Concurrency

    • Explain the JavaScript event loop and the relationship between the call stack, Web APIs, the callback queue, and the microtask queue.

      Mid
    • Why does setTimeout with 0 milliseconds not necessarily execute in 0 milliseconds?

      Mid
    • How does the JavaScript event loop handle a single thread while performing non-blocking I/O?

      Mid
    • Explain the difference between microtasks and macrotasks. Which has priority, and why does it matter for UI responsiveness?

      Senior
    • What happens to the Call Stack when an await keyword is encountered in an async function?

      Senior
    • What happens if a microtask recursively schedules another microtask, and what is starvation?

      Senior

    Engine Internals & Memory

    • Explain the new Set methods in ES2025 (union, intersection, difference) and when you'd use them.

      Mid
    • What is a 'Memory Leak' in JavaScript, and how can a closure or an event listener cause one?

      Senior
    • How does JavaScript's garbage collection (mark-and-sweep) work?

      Senior
    • What are deoptimizations in a JS engine, and what kind of code patterns usually trigger them?

      Senior
    • What is a JavaScript Proxy, and what are some practical use cases for it (e.g., validation, logging)?

      Senior
    • What are the new features in ES2025/ES2026 that you find most impactful?

      Senior
    • What is Just-In-Time (JIT) compilation in engines like V8?

      Senior