JavaScript Interview Questions for Experienced Developers

The harder JavaScript questions asked of developers with a few years of experience: runtime internals, polyfills, performance and debugging. Each has a short answer and links to a full lesson with traces.

  1. 01 · JavaScript Fundamentals for Frontend Interviews · Hard

    Memory Management & Garbage Collection

    JavaScript manages memory through an automated lifecycle of allocation, usage, and garbage collection based on object reachability from root references.

    Full answer, traps and step-by-step trace
  2. 02 · The Event Loop, Microtasks, and Asynchronous Concurrency · Hard

    Event Loop & Microtasks

    The JavaScript Event Loop is a runtime concurrency mechanism that coordinates single-threaded code execution across the Call Stack, Microtask Queue, and Task Queue.

    Full answer, traps and step-by-step trace
  3. 03 · The Event Loop, Microtasks, and Asynchronous Concurrency · Hard

    Promise Concurrency Pool

    A Promise Concurrency Pool restricts active in-flight promises to a maximum concurrency limit K, using an internal active task set and Promise.race to drain slots as tasks finish while preserving original input order.

    Full answer, traps and step-by-step trace
  4. 04 · The Event Loop, Microtasks, and Asynchronous Concurrency · Hard

    Async Iterators & Streaming Backpressure

    Async iterators implement Symbol.asyncIterator returning promises for { value, done }, consumed via for await...of. They provide pull-based streaming with automatic backpressure and deterministic finally block cleanup on early loop termination.

    Full answer, traps and step-by-step trace
  5. 05 · Tricky JavaScript Output Prediction & Code Reasoning · Hard

    this Context Traps

    The "this" binding is determined strictly at the call-site: chaining multiple .bind() calls never overrides the original bound context, bound functions ignore .call() and .apply(), and arrow functions lack an own "this", capturing it lexically from their…

    Full answer, traps and step-by-step trace
  6. 06 · Tricky JavaScript Output Prediction & Code Reasoning · Hard

    Async Execution Ordering

    In JavaScript async ordering, synchronous code and Promise executors run immediately on the call stack.

    Full answer, traps and step-by-step trace
  7. 07 · Tricky JavaScript Output Prediction & Code Reasoning · Hard

    Coercion & Mutation Traps

    Object keys on plain JavaScript objects coerce to strings via String(key), causing distinct object references to collide under "[object Object]".

    Full answer, traps and step-by-step trace
  8. 08 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Memoize and Cache Layer

    Memoization is an optimization technique that caches pure function outputs based on input arguments using closure scope. Custom key resolvers handle complex or order-independent parameters, while bounded LRU caches prevent memory leaks.

    Full answer, traps and step-by-step trace
  9. 09 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Event Emitter and Observer

    EventEmitter implements the Publish-Subscribe pattern with synchronous callback execution. Snapshotting listeners with slice() prevents index-skipping bugs during dispatch, and proper unsubscribe methods prevent memory leaks in event-driven architectures.

    Full answer, traps and step-by-step trace
  10. 10 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Deep Clone with Circular References

    A deep clone recursively duplicates every nested object and array to guarantee complete memory isolation.

    Full answer, traps and step-by-step trace
  11. 11 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Promise Polyfill (Promises/A+ Spec)

    A Promise polyfill is a state machine transitioning from PENDING to FULFILLED or REJECTED. It implements asynchronous execution via queueMicrotask and returns a new Promise from .then to enable chaining according to the Promises/A+ specification.

    Full answer, traps and step-by-step trace
  12. 12 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Custom bind, call and apply

    Custom call and apply polyfills attach the function to a temporary Symbol property on the target object context to invoke it with implicit binding.

    Full answer, traps and step-by-step trace
  13. 13 · JavaScript Utility Implementations and Standard Polyfills · Hard

    Retry with Exponential Backoff & Jitter

    Exponential backoff doubles the delay between successive retry attempts to alleviate backend congestion. Combining backoff with randomized jitter desynchronizes simultaneous client retries, preventing the thundering herd problem during service outages.

    Full answer, traps and step-by-step trace
  14. 14 · Browser APIs, DOM Performance, and Client-Side Security · Hard

    Fetch API & AbortController

    The Fetch API provides a modern Promise-based interface for network requests that rejects only on network failures, requiring manual inspection of response.ok for HTTP 4xx/5xx status codes.

    Full answer, traps and step-by-step trace
  15. 15 · Browser APIs, DOM Performance, and Client-Side Security · Hard

    CORS & Security Boundaries

    Cross-Origin Resource Sharing (CORS) is a browser security mechanism that restricts web applications from requesting resources from a different origin.

    Full answer, traps and step-by-step trace
  16. 16 · Browser APIs, DOM Performance, and Client-Side Security · Hard

    IntersectionObserver & List Virtualization

    List virtualization renders only items within the visible viewport plus an overscan buffer, positioning rendered elements with CSS translateY to achieve 60fps scrolling across 100,000+ items.

    Full answer, traps and step-by-step trace
  17. 17 · Browser APIs, DOM Performance, and Client-Side Security · Hard

    Web Workers & Transferable Objects

    Web Workers offload heavy CPU tasks from the main thread into separate background threads with isolated memory.

    Full answer, traps and step-by-step trace
  18. 18 · Modern JavaScript: ES Modules, Iterators, and Weak Collections · Hard

    Symbols & Metaprogramming

    Symbols are unique primitive values used as collision-proof object property keys that are omitted from Object.keys() and JSON.stringify().

    Full answer, traps and step-by-step trace
  19. 19 · Modern JavaScript: ES Modules, Iterators, and Weak Collections · Hard

    Proxy and Reflect Metaprogramming

    JavaScript Proxy wraps a target object to intercept internal operations (traps like get, set, deleteProperty), while the Reflect API provides default forwarding methods that preserve receiver context and return clean booleans, enabling reactive state…

    Full answer, traps and step-by-step trace
  20. 20 · Debugging, Memory Leak Analysis, and Code Quality · Hard

    Memory Leaks & V8 GC

    Memory leaks occur when unused objects remain reachable from GC Roots (global window, active call stack, retained closures, or detached DOM trees).

    Full answer, traps and step-by-step trace
  21. 21 · Debugging, Memory Leak Analysis, and Code Quality · Hard

    Unit Testing & Mocking Asynchronous Code

    Unit testing asynchronous JavaScript requires fake timers to advance virtual clock time synchronously without real delays, and deterministic mocks to verify callback execution counts and parameter assertions.

    Full answer, traps and step-by-step trace
  22. 22 · Connecting JavaScript Runtime Mechanics to React Internals · Hard

    Closures & Stale State in React

    In React, each component render has its own closed-over state constants.

    Full answer, traps and step-by-step trace

Applying for the role too? Frontend developer resume examples