Skip to content
Preptima

Frontend Engineering interview questions and answers

Browser-platform depth, framework reasoning, and the frontend-specific design round that full-stack candidates are least prepared for.

39 published across 9 topics.

JavaScript Core

4 questions

Closures, the event loop, prototypes, coercion, and the async semantics in every frontend screen.

mediumConceptScenario

A save button calls an API, the request fails, the error appears in the console - and the UI still shows 'Saved'. Walk me through what is actually happening in that promise chain.

A catch handler that returns normally converts a rejected promise into a fulfilled one, so every then after it runs as though nothing failed. Combined with fetch, which only rejects on network errors and resolves happily on a 500, the chain reports success twice over. Fix by re-throwing from catch, checking response.ok, and modelling UI state as a machine.

4 minentry, mid, senior
mediumCodingConcept

Here is a script mixing setTimeout, a promise chain and an await. Tell me the order the logs come out in, and why.

The engine finishes the current task, then drains the whole microtask queue before taking another task, so every promise callback and await resumption runs before a zero-delay timeout, in the order each was queued. Use this event loop answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects microtasks to the point an interviewer is testing.

4 minmid, senior
mediumConceptCoding

What is a closure, and how does one end up leaking memory?

A closure is a function plus the scope it was created in, held by reference rather than copied. It leaks when something long-lived keeps the function alive, because everything the captured scope can reach stays reachable with it.

4 minentry, mid, senior
All 4 in JavaScript Core

TypeScript

3 questions

Structural typing, generics, narrowing, utility types, and typing component contracts.

hardConcept

Where does TypeScript stop protecting you, and what do you do at those points?

TypeScript stops protecting you at runtime boundaries such as JSON, HTTP requests, local storage and third-party packages. Validate untrusted input at the boundary, then let static types carry the trusted shape inside the app. It also connects type soundness to the point an interviewer is testing.

4 minmid, senior, staff
All 3 in TypeScript

React

5 questions

Reconciliation, hook rules and dependency correctness, server components, and state management.

hardScenarioDesign

How do you implement local-first collaborative editing without the unbounded memory growth inherent to CRDTs crashing the client?

Assess the candidate's expertise in distributed systems within the browser, focusing on Conflict-free Replicated Data Types, memory optimisation, and peer-to-peer state synchronisation. Use this frontend answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects architecture to the point an interviewer is testing.

2 minsenior, staff
easyConcept

Why does my useEffect run twice on mount?

React useEffect runs twice on mount in development when Strict Mode deliberately runs one extra setup-cleanup-setup cycle. It does not happen in production builds, and the fix is to write the cleanup the effect was missing rather than to guard the effect or remove Strict Mode.

5 minentry, mid
All 5 in React

Angular & Vue

2 questions

Change detection, reactivity models, DI and modules, and framework-specific lifecycle questions.

The critical rendering path, reflow and repaint, event delegation, and storage and cookie mechanics.

All 4 in Browser & Rendering

Web Performance

5 questions

Core Web Vitals, bundle splitting, image strategy, and measuring rather than guessing.

hardScenarioConceptDesign

INP went from 150ms to 400ms the week a marketing tag was added. Marketing says the script is async and cannot be the cause. How do you prove it either way and fix it?

Async controls when a script downloads, not what it does to the main thread once it executes, so an async tag can still block interaction handling. Prove it with field data attributed to the interaction: INP breaks into input delay, processing and presentation, and each points elsewhere. Then move the work off the critical path.

4 minmid, senior, staff
hardConceptScenario

Field data says your page has an INP of 400 ms. How do you find the cause and fix it?

Split the interaction into input delay, processing time and presentation delay, then attribute a real interaction from the field rather than guessing. Most of the budget is usually spent before your handler runs or after it returns, so yielding and cutting rendering cost beats optimising the handler.

4 minmid, senior, staff
All 5 in Web Performance

CSS & Layout

4 questions

The cascade and specificity, flexbox and grid, stacking contexts, and responsive strategy.

mediumConcept

How do you decide between flexbox and grid, and why does z-index so often not do what you expect?

Flexbox distributes items along one axis and lets content decide the sizes; grid defines tracks up front and places items into them, aligning in both axes. z-index looks broken because it only orders siblings inside one stacking context, and ordinary properties like transform and opacity create new ones. It also connects css grid to the point an interviewer is testing.

5 minentry, mid, senior
mediumConcept

A fixed header starts scrolling away with the page after someone adds an animation to a wrapper div. What happened, and how would you track it down?

A transform, filter, perspective or containment on an ancestor makes that ancestor the containing block for fixed-position descendants, so the header is now positioned and clipped relative to the wrapper instead of the viewport. Use this CSS answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects positioning to the point an interviewer is testing.

4 minmid, senior
All 4 in CSS & Layout

Accessibility

5 questions

Semantics, keyboard interaction, ARIA use and misuse, and WCAG criteria raised in review.

hardScenarioConceptCoding

A modal passed design and QA review, but keyboard users report they can tab out of it into the page behind, and once they do they cannot get back or close it. Diagnose it and tell me what a correct dialog does.

The dialog was built as a styled div, so nothing marks the rest of the page inert. Focus was never moved in, never constrained, never restored on close, and Escape was never wired. A correct dialog moves focus in, keeps it in, restores it, marks background inert and is labelled - which native dialog with showModal gives you almost for free.

4 minmid, senior, staff
mediumConceptCodingScenario

This form marks invalid fields with red text and a red border. What has to change?

Accessible form errors need visible text, programmatic association with the field using aria-describedby, aria-invalid for state and deliberate focus handling after submit. Use this accessibility answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects FORMS to the point an interviewer is testing.

4 minentry, mid, senior
All 5 in Accessibility

Component architecture, data-fetching and caching layers, and designing autocomplete or a feed client-side.

hardDesignCase Study

Design the frontend for a data-heavy operational dashboard with live updates.

Stream a server-rendered shell, virtualise the dense views and draw high-density charts to canvas, keep server cache separate from UI and URL state, coalesce socket messages into one commit per frame, give every widget its own empty, error and stale states, and enforce a byte budget per pull request.

7 minsenior, staff, lead
hardScenarioDesign

How do you design the dependency graph, handle shared resources, and optimise build times when breaking down a massive iOS monolithic application into a modular architecture using Tuist?

Assess the candidate's ability to migrate a large-scale iOS application to a modular architecture using Tuist, managing dependency graphs, enforcing architectural boundaries, and optimising build times. Use this MOBILE answer to show the decision, trade-off, and evidence rather than a memorised definition.

3 minsenior, staff
hardScenarioDesign

How do you leverage WorkManager to guarantee execution, handle conflict resolution, and optimise battery usage in an offline-first Android application requiring bidirectional synchronisation?

Evaluate the candidate's understanding of offline-first principles, background processing using Android's WorkManager, conflict resolution strategies, and battery optimization techniques. Use this MOBILE answer to show the decision, trade-off, and evidence rather than a memorised definition.

3 minsenior, staff
hardScenarioDesign

How do you resolve severe performance bottlenecks in a complex React Native application caused by heavy bridge traffic, and how do you evaluate a migration to the JavaScript Interface (JSI)?

Assess the candidate's understanding of the React Native architecture, bridge performance limitations, profiling techniques, and modern solutions like JSI and the New Architecture. Use this MOBILE answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects cross platform to the point an interviewer is testing.

3 minsenior, staff
All 7 in Frontend System Design