Interview questions hub
Frontend Interview Questions for Quick Prep
Interview-questions hub for fast frontend interview prep: start with the most crucial JavaScript coding and concept prompts, then branch into full technology hubs for broader coverage.
Start here
Start interview prep in 30 seconds
Start with one crucial question first, then move into study plans and deeper prep routes once momentum is established.
Current essentials
- Coding
- 12
- Concepts
- 12
- Must know
- 24
Prep plan at a glance
Use this page as a planning surface for interview prep, not just a random question feed.
- Start with curated JavaScript essentials to warm up interview execution speed.
- Mix coding implementation drills with concept explanation checks in one short loop.
- Expand to framework hubs, guides, and tracks once your baseline is stable.
More routes and deep-dive links
Primary prep routes
Explore public study plans
Explore technology interview-question hubs
Most crucial JavaScript coding interview questions
- Remove Duplicates
Critical for coding rounds and edge-case discussion.
Implement uniqueArray(arr) that removes duplicates while preserving order. Use a Set for O(n) time and clarify how to treat objects by reference, NaN, and mixed types so behavior is explicit and predictable. Concepts: a…
Open challenge → - Shallow Clone (Object or Array)
Critical for coding rounds and edge-case discussion.
Create a shallow copy of an array or object. Copy top-level properties but keep nested references intact, and document that limitation clearly. This clarifies the difference between shallow and deep cloning and helps av…
Open challenge → - Sleep / Delay Promise
Critical for coding rounds and edge-case discussion.
Implement sleep(ms) that returns a Promise resolving after ms milliseconds. Use it to pause async flows like retries, exponential backoff, UI delays, or test helpers without blocking the event loop or freezing the UI th…
Open challenge → - Sort Numbers with Array.prototype.sort
Critical for coding rounds and edge-case discussion.
Implement a function `sortNumbers(arr, ascending = true)` that returns a **new array** of numbers sorted numerically in ascending or descending order. The original array must not be mutated, and you should use `Array.pr…
Open challenge → - Update Array at Index (Immutable)
Critical for coding rounds and edge-case discussion.
Return a new array with one index updated, leaving the original array untouched. This is the core immutable update pattern used in reducers, React state updates, and UI list editing, and it prevents accidental mutation.
Open challenge → - Create a Deferred Promise (For Async Tests)
Critical for coding rounds and edge-case discussion.
Implement createDeferred() to build a controllable Promise: { promise, resolve, reject }. This is a common testing tool to make async flows deterministic (you decide exactly when something resolves/rejects).
Open challenge → - Create a Spy Function (Test Double)
Critical for coding rounds and edge-case discussion.
Implement createSpy(impl?) to produce a callable spy that records every call (args + this) and optionally delegates to an implementation. Spies are a core unit-testing tool to verify behavior at boundaries (network, sto…
Open challenge → - Custom setTimeout/clearTimeout Timer Manager
Critical for coding rounds and edge-case discussion.
Build a timer registry with mySetTimeout, myClearTimeout, and myClearAllTimeouts. Return your own numeric ids, store native handles, and clean up on fire. Complexity: O(1) set/clear, O(k) for clearAll.
Open challenge → - Data Helper 1: Get Value by Path
Critical for coding rounds and edge-case discussion.
Implement `getByPath(obj, path, fallback?)` that safely reads a nested value from an object. This is extremely common in frontend screens (reading deep API responses, feature flags, form state) and shows up often in int…
Open challenge → - Data Helper 2: Set Value by Path
Critical for coding rounds and edge-case discussion.
Implement setByPath(obj, path, value) that returns a new object/array tree with the value written at the nested path. Normalize dot or segment paths, create missing containers based on numeric segments, and never mutate…
Open challenge → - Debounce Function
Critical for coding rounds and edge-case discussion.
Implement debounce(fn, wait) that delays execution until the user stops triggering events. Clear the previous timer on each call, preserve this/args, and make the timing predictable for search/resize use cases.
Open challenge → - Delegated Event Handler (E)
Critical for coding rounds and edge-case discussion.
Implement `delegate(root, eventType, selector, handler)` for **event delegation**. Requirements: 1) Attach **one** event listener to `root`. 2) When an event fires, if `event.target` (or one of its ancestors up to `root…
Open challenge →
Most crucial JavaScript concept questions for interviews
- What are callbacks in JavaScript?
Frequently tested in explanation-heavy rounds.
Callbacks are the original control-flow hook in JavaScript. The production issues are inversion of control, callback hell, and debugging legacy async code that cannot cancel or compose cleanly.
Open question → - Arrow functions vs regular functions in JavaScript
Frequently tested in explanation-heavy rounds.
Arrow and regular functions look similar but behave differently for this binding, constructors, arguments, and method design. Strong answers explain lexical vs dynamic this, prototype/new behavior, and when each style i…
Open question → - Async Race Conditions and Stale UI Updates
Frequently tested in explanation-heavy rounds.
Debug the production bug where async requests resolve out of order and overwrite newer UI state. The fix is cancellation, request identity, or takeLatest-style guards that stop stale results from winning.
Open question → - DOM XSS Prevention in JavaScript: Dangerous Sinks, Safe APIs, and CSP
Frequently tested in explanation-heavy rounds.
Security-focused frontend interview guide to DOM XSS: attacker-controlled sources, dangerous DOM sinks, safe rendering patterns, URL/protocol validation, and defense in depth with CSP and Trusted Types.
Open question → - Explain 'hoisting' in JavaScript
Frequently tested in explanation-heavy rounds.
Hoisting is JavaScript declaration processing before execution. The practical debug value is mapping symptoms: `undefined` reads, early callable function declarations, and ReferenceError or TypeError when the wrong cons…
Open question → - Explain Closures in JavaScript
Frequently tested in explanation-heavy rounds.
Closures keep outer variables alive after the outer function returns. That powers private state, but the production pitfalls are loop-capture bugs, stale async state, and memory retention when callbacks keep old data al…
Open question → - Explain Event Delegation in JavaScript
Frequently tested in explanation-heavy rounds.
Event delegation uses one ancestor listener instead of many child listeners. The production value is handling dynamic DOM, nested targets, stopPropagation surprises, and list performance without attaching handlers every…
Open question → - Explain Hoisting and the Temporal Dead Zone (TDZ)
Frequently tested in explanation-heavy rounds.
Hoisting and TDZ explain why `let` and `const` are registered before execution yet still throw before initialization. The common debug signal is `ReferenceError: Cannot access X before initialization`.
Open question → - Explain the `this` keyword in JavaScript
Frequently tested in explanation-heavy rounds.
The value of `this` depends on call site, strict mode, and arrow functions. The real debug problem is detached methods, callback context loss, and object methods that stop pointing at the receiver you expected.
Open question → - Explain the difference in hoisting between `var`, `let`, and `const`
Frequently tested in explanation-heavy rounds.
var, let, and const are all hoisted, but they differ in initialization and access-before-declaration behavior. var initializes to undefined; let/const stay in TDZ until declaration executes.
Open question → - How do you optimize a web page’s response or load time?
Frequently tested in explanation-heavy rounds.
This question checks if you can reason about performance across the network, render pipeline, assets, and runtime. Interviewers expect concrete tactics like caching, compression, code splitting, and image optimization.
Open question → - How does Promise resolve callback hell in JavaScript?
Frequently tested in explanation-heavy rounds.
Callback hell happens when async callbacks are deeply nested and error handling is duplicated. Promises flatten async control flow, centralize failures with catch, and make sequencing and parallel execution easier to re…
Open question →
Complete the prep loop
After these Frontend Interview Questions for Quick Prep drills, continue with frontend interview questions hub, then frontend interview preparation guides and frontend interview study plans to keep your weekly plan structured.