Interview Question Index
Test yourself on a part in twenty minutes, and find out which chapters you actually have to reread.
In this index: how to use it · every question in the book · grouped by part and chapter · each chapter linked
Every question below is taken from the Interview Questions block that closes a chapter. There are 647 of them across 150 chapters. The answers are not repeated here — they are in the chapter, which is what the link on each heading is for.
How to Use It
Answer out loud, then check. Those are the two halves, and skipping the first one is what makes a reader feel ready and then stall in the room.
- Answer it aloud, in under ninety seconds. The gap between what you recognise and what you can say is the whole thing the loop measures, and reading silently hides it.
- Mark it fluent, shaky, or blank. Three buckets is enough. A finer scale is procrastination.
- Open the chapter only for the shaky and the blank. Rereading what you already know is the most comfortable way to waste a week.
- Come back to the same part three days later. Recall decays fastest in the first seventy-two hours, so the second pass is where the revision actually happens.
A part you can answer at eighty per cent aloud is a part you can stop revising. One that scores below half is a part to read properly, not to skim again.
⚠️ These are not the questions you will be asked. They are the questions the book answers, which is a different set. Memorising the list would be the wrong use of it. Each one is a prompt to reconstruct an explanation, and the interview version will arrive with different words around it.
Part I — Foundations
53 questions across 15 chapters.
- Data Types, Variables and Built-ins
- Why does changing a property through one variable affect another variable?
const arr = [1, 2]; arr.push(3);— why is that legal?- What is the difference between
mapandforEach? - How would you remove duplicates from an array of objects by
id? - When is
reducethe wrong choice?
- Scope and Closures
- Explain the scope chain.
- What is the temporal dead zone, and why is it useful?
- Why does a
varloop withsetTimeoutprint the final value three times? - How do closures cause memory leaks?
- When would you use a
#privateclass field instead of a closure?
- The
thisKeywordconst fn = obj.method; fn();— what isthis, and why?- What is the difference between
call,applyandbind? - When would you choose
bindover a class-field arrow for an event handler?
- Prototypes and Inheritance
- What is the difference between
prototypeand__proto__? - Are ES2015 classes real classes?
- When would you prefer
Object.createto aclass?
- What is the difference between
- Promises, Async/Await and Errors
- What is the difference between
Promise.allandPromise.allSettled? - When would you return an error instead of throwing one?
- Why is
catch (e) { console.error(e); }usually a bug? - When would you deliberately await in a loop rather than use
Promise.all?
- What is the difference between
- The Event Loop
- What does this log —
setTimeout(() => log('A'), 0)thenPromise.resolve().then(() => log('B'))? - How can a page freeze even though nothing is synchronously blocking?
- When would you reach for a Web Worker instead of chunking work with
setTimeout?
- What does this log —
- TypeScript Basic Types, Literals and Enums
- What is the difference between
anyandunknown? - TypeScript compiled with no errors. What can still go wrong at runtime?
- Should you use
enumin new TypeScript? - When would you keep enums in a codebase that has them?
- What is the difference between
- Interfaces and Type Aliases
- When would you use
interfaceovertype? - What is a discriminated union and why prefer it to optional fields?
- Why did TypeScript not catch this extra property?
- When would you use
- TypeScript Generics
- How do you constrain a generic, and why would you need to?
- When is a generic the wrong tool?
- What does
function getProperty<T, K extends keyof T>(obj: T, key: K): T[K]buy over(obj: object, key: string): unknown?
- TypeScript Type Guards
- What is a type predicate, and what is its main risk?
- How does exhaustiveness checking work?
- Why does narrowing not survive into a callback?
- TypeScript Advanced and Utility Types
- What is the difference between
PickandOmit, beyond direction? - What does
inferdo? - What is distribution in conditional types, and when does it bite?
- When would you not use
Partialfor an update type?
- What is the difference between
- TypeScript at Scale
- How would you get a 200,000-line codebase onto
strict? - What does
satisfiesdo that a type annotation does not? - When have types become too expensive?
- How would you get a 200,000-line codebase onto
- OOP and Composition over Inheritance
- What is the difference between
privateand#in a TypeScript class? - "Favour composition over inheritance" — why?
- Show me a case where inheritance is the right call.
- TypeScript is structurally typed. What does that change?
- What is the difference between
- SOLID Principles
- Explain SRP with a real example.
- Give a Liskov violation you've actually seen.
- When would you deliberately ignore SOLID?
- Design Patterns in TypeScript
- This
switchon payment provider keeps growing. What do you do? - What is the difference between a decorator, a proxy and an adapter? They all wrap something.
- When is a pattern the wrong answer?
- This
Part II — The Browser Platform
68 questions across 15 chapters.
- Semantic HTML
- When do you use
<section>versus<article>versus<div>? - Why does heading order matter, and what breaks if you skip levels?
- A colleague puts every form field in a
<div>with floating text above it. What is wrong? - When would you not use a semantic element?
- When do you use
- Advanced CSS
- Why prefer
oklchoverhslfor design tokens? - What did
:has()let you delete? - What is the difference between a custom property and a Sass variable?
- When is a custom property the wrong tool?
- Why prefer
- Container Queries and Cascade Layers
- A card component looks wrong in the sidebar but right in the main column. How do you fix it?
- What problem do cascade layers solve that BEM did not?
- Where do cascade layers sit relative to specificity and
!important? - When is a container query the wrong tool?
- Animation and View Transitions
- An engineer reports that a slide-in panel stutters on mid-range Android. Where do you start?
- What does the View Transitions API actually do for you?
- How do you handle
prefers-reduced-motionwithout making the interface confusing? - When would you use a JavaScript animation library rather than the platform?
- Web Storage and IndexedDB
- What is the difference between
localStorageandsessionStorage? - A user logs out in one tab. How do the other open tabs find out?
- When would you choose IndexedDB over
localStorage? - How do IndexedDB schema migrations work?
- What happens when you hit the quota?
- What is the difference between
- Cookies and SameSite
- Walk me through
SameSite=StrictversusLaxversusNone. - Why is
HttpOnlymore important thanSecurefor an auth cookie? - How does
SameSiteprevent CSRF? - Why not store the JWT in
localStorage? - How would you do auth across
app.example.comandapi.example.com?
- Walk me through
- The Observer APIs
- Why is
IntersectionObserverfaster than a scroll listener that does the same job? - When would you use a
ResizeObserverrather than a container query? - What breaks if you forget to disconnect an observer?
- Why is
PerformanceObserverthe right way to collect Core Web Vitals?
- Why is
- Web Workers and the Main Thread
- A table freezes for half a second when a 20 MB CSV is uploaded. Walk through the fix.
- What can and cannot cross the worker boundary?
- When is a worker the wrong answer to a slow interaction?
- How does moving work to a worker relate to INP?
- Service Workers, Caching and Offline
- You shipped a fix an hour ago and users still report the bug. What happened?
- What is the difference between
skipWaiting()andclients.claim()? - Walk me through the strategy you would pick for each request on a dashboard.
- When would you not use a service worker at all?
- Internationalisation and the Intl APIs
- Why can you not build a sentence by joining translated fragments?
- Why is
count === 1 ? 'item' : 'items'wrong? - How would you show a price to users in several countries?
- How would you add right-to-left support to an existing app?
- When would you not add an i18n library?
- Why Accessibility, and the Law
- Which accessibility rules apply to a product your company sells across Europe?
- Why AA rather than A or AAA?
- What did WCAG 2.2 change?
- A designer's palette uses
#999for secondary text. What do you say? - When would you not fix an accessibility issue immediately?
- The Accessibility Tree
- What is the accessibility tree, and why does it matter to you rather than to a specialist?
- How is an accessible name computed?
- What is the difference between
hidden,aria-hiddenandinert? - A
<section>is not showing up as a landmark. Why? - When is it right to hide something from screen readers?
- ARIA, and When Not to Use It
- What is the first rule of ARIA, and why is it first?
- A component sets
aria-expandedbut the menu still announces wrongly. What do you check? - How do you announce that a background save succeeded?
- When is
aria-disabledbetter thandisabled? - Would you build a custom select, and what would it cost?
- Keyboard and Focus Management
- What is wrong with removing focus outlines, and what do you do instead?
- A dialog opens and Tab keeps moving through the page behind it. What is happening?
- Where should focus go after the user deletes a row from a table?
- How is keyboard navigation in a single-page application different?
- When should arrow keys navigate rather than Tab?
- Accessible Forms and Error Messaging
- A form uses placeholders instead of labels. What do you tell the designer?
- How do you report a validation error accessibly?
- When should validation run?
- Why are
autocompleteattributes an accessibility concern rather than a convenience? - What did WCAG 2.2 change about login forms?
Part III — The Modern Frontend Stack
148 questions across 34 chapters.
- The React Mental Model
- Why does this component re-render when its props have not changed?
- What actually goes wrong when you use the array index as a key?
- How would you reset a form when the selected record changes — and why not an effect?
- When would you not reach for
memo?
- Hooks in Depth
- Why can't hooks be called conditionally?
- This
setIntervalincrements the counter to 1 and then stops. What is wrong? - When would you choose
useRefoveruseStatefor a value that changes? - When is extracting a custom hook the wrong call?
- useEffect and When Not to Use It
- How do you decide whether a piece of logic belongs in an effect or an event handler?
- What is wrong with storing a filtered list in state and updating it in an effect?
- Your effect fires twice in development. Is that a bug?
- When is fetching in
useEffectstill the right answer?
- Component Composition Patterns
- A designer asks for a fifth variant of your Card. When is another prop the wrong answer?
- Compound components or a props object — how do you choose?
- Are render props obsolete?
- Why is an unmemoised context value a problem, and when does it stop being one?
- Server Components and Client Components
- Why can't you pass a function as a prop from a Server Component to a Client Component?
- A colleague says Client Components cannot render Server Components. Are they right?
- Where do you put the
'use client'boundary, and what happens if you get it wrong? - When is a Server Component the wrong choice?
- Suspense, Streaming and Error Boundaries
- What does adding a Suspense boundary actually do to the response?
- What does an error boundary catch, and what does it miss?
- How do you place boundaries in a dashboard with a dozen independent widgets?
- Suspense or a transition for a search filter?
- When is an error boundary the wrong tool?
- Actions and Forms
- What does React 19 give you that
onSubmitplusfetchdid not? - How would you build a submit button for a design system that knows when it is submitting?
- What stops a user calling your Server Function directly with arbitrary arguments?
- When is an optimistic update the wrong choice?
- What does React 19 give you that
- Performance, Transitions and the Compiler
- What does the React Compiler do, and what do you stop writing because of it?
- You enable the compiler and one component still re-renders constantly. Where do you look?
useTransitionoruseDeferredValue?- The list still feels slow after adding a transition. What now?
- A page takes four seconds to become interactive. Where do you start?
- When would you still write
useMemoby hand?
- React and TypeScript at Scale
- Why model async state as a union rather than
loading,dataanderrorfields? - What does typing
useReduceractions as a discriminated union buy you? - Why default a context to
undefinedrather than casting an empty object? - Does TypeScript stop you passing a function to a Client Component from a Server Component?
- Why model async state as a union rather than
- App Router Mental Model
- What is the difference between
layout.tsxandtemplate.tsx? - How do you build a modal that is also a shareable URL?
- A sidebar refetches its data on every navigation. What is wrong?
- When would you not use a route group?
- What is the difference between
- Data Fetching and Caching
- Why can you not read
cookies()inside ause cachefunction? revalidateTagorupdateTag?- A page is stale. How do you work out where?
- When is a Route Handler the right place for a read, rather than a Server Component?
- Why can you not read
- Server Actions
- What stops a user calling a Server Action directly?
- Every export in your actions file is reachable. What follows from that?
- A Server Action closes over a value from the page it was rendered in. Can you trust it?
- When would you write a Route Handler instead?
- Rendering in Next.js
- What problem does Partial Prerendering solve?
- How do you decide where the Suspense boundaries go?
- A route you expected to be prerendered is marked fully dynamic in the build output. What do you look for?
- When is a fully dynamic route the right answer?
- Middleware, Runtimes and Deployment
- Why is checking authentication in middleware not enough?
- When is the edge runtime the wrong choice?
- How would you serve different pricing pages by country without giving up prerendering?
- Why does incremental regeneration go wrong behind a load balancer?
- How would you deploy the same build to three environments?
- Auth Patterns
- Where do you put the authentication check in an App Router application, and why not middleware?
- Session or JWT for a new internal dashboard?
- Why is
httpOnlythe important flag, rather thansecureorsameSite? - A layout checks the session and redirects. Is the page underneath protected?
- Route Handlers and the BFF
- When should a Next.js application expose a Route Handler at all?
- What is a backend-for-frontend, and what does it cost?
- Route Handler or Server Action for a form submission?
- When is Next.js the wrong place for backend work?
- The Runes Model, Components and Snippets
- What is a rune, and why does it not need a dependency array?
- Why is
$effectthe wrong tool for computing a value? - How does Svelte 5's update model differ from React's, and does it matter?
- How would you build a table component that lets the caller render each row?
- When is something a snippet rather than a component?
- SvelteKit Routing and Loading
- What decides whether data loading happens in
+page.tsor+page.server.ts? - How does streaming work in a SvelteKit load, and what is the tradeoff?
- A page is slow because a layout load queries the session. What do you look at?
- How do you re-run one load after a mutation, without reloading everything?
- What decides whether data loading happens in
- SvelteKit Form Actions
- How does a SvelteKit form behave before hydration?
- What is the difference between
failand throwing an error in an action? - What does
use:enhancedo if you pass it a callback? - What stops someone posting directly to your form action?
- The Rendering Spectrum and the Cost of Hydration
- What is the difference between SSR and SSG in terms of what the server does?
- A page uses ISR with a 60-second revalidation. A user reports data five minutes old. Is this a bug?
- The page paints in 800 ms but does not respond to clicks for another two seconds. What is happening?
- Why does a hydration mismatch cost more than a console warning?
- How does resumability differ from progressive hydration?
- When are islands the wrong architecture, and when is CSR the right one?
- Streaming HTML
- Your TTFB is 1.8 seconds on a server-rendered page. What do you do?
- Can streaming make a page worse?
- Why can't a streamed response redirect when authentication fails halfway through?
- How would you prove that streaming is actually happening in production?
- Choosing a Rendering Strategy per Route, with SEO
- Walk me through how you would pick a rendering strategy for an e-commerce site.
- Is client-side rendering bad for SEO?
- When would you deliberately choose client-side rendering in 2027?
- A product page ranks, but its social preview card is blank. What is wrong?
- A page is declared static but the platform reports it as dynamic on every request. Where do you look?
- A streaming route's metadata depends on a slow query. What do you do?
- Edge Versus Origin Rendering
- When is the edge the wrong place to render?
- Cold starts used to be the argument for edge runtimes. Is that still true?
- Where would you do authentication in a globally distributed application?
- A route is server-rendered at origin and slow for European users. What are the options, in order?
- Choosing a Meta-Framework
- You are starting a new product application. Next.js or SvelteKit?
- Which parts of that choice can you reverse later?
- How would you migrate a five-year-old client-rendered application to a server-first framework?
- When is a meta-framework the wrong choice entirely?
- The Four Kinds of State
- How do you decide where a piece of state should live?
- What is actually wrong with putting API data in Redux or Zustand?
- Which state belongs in the URL, and how do you decide?
- Is the four-category model still useful when the framework fetches on the server?
- Server State with TanStack Query
- What is the difference between
staleTimeandgcTime? - How do you structure query keys in a large application?
- Walk me through an optimistic update.
- With server components fetching data, do you still need a client query cache?
- What is the difference between
- Client State and Signals
- When would you use Context instead of a state library?
- What is a signal, in terms a React developer already uses?
- What is a glitch, and why does it matter?
- Do signals replace TanStack Query?
- Your team wants to move all client state into Redux. Would you?
- Form State
- Why are uncontrolled inputs the default in modern form libraries?
- Where does validation belong when the server also validates?
- How do you decide when to show a validation error?
- A user is halfway through editing a record and a background refetch returns new server data. What do you do?
- URL as State
- Which state belongs in the URL?
- How do you stop a search box from destroying the back button?
- What breaks when the same value lives in both the URL and a store?
- What is the cost of reading search params on the server?
- Modules and Bundling
- What does a bundler actually do?
- A single import added 300 KB to the bundle. How do you find out why?
- Why did tree shaking only become practical with ES modules?
- How would you decide where to split chunks?
- Vite, Rust Bundlers and the Dev Loop
- Why does the Vite dev server start instantly on a large application?
- Why does saving one file sometimes reload the whole page?
- Something works in development and breaks in the production build. Where do you start?
- Why were the bundlers rewritten in Rust rather than optimised?
- Your production build succeeds but the application crashes on a type error. How?
- Your team wants to migrate off Webpack for build speed. What do you ask first?
- Monorepos
- What does a task graph buy you that workspaces alone do not?
- How is a task's cache key computed, and what breaks it?
- A staging deployment came out with production configuration. How does a build cache cause that?
- When is a monorepo the wrong choice?
- Type-Checking and Linting at Scale
- Why can't type-checking be parallelised the way linting is?
- How do project references speed up a large TypeScript codebase?
- Linting takes eight minutes in continuous integration. What do you look at first?
- What should block a merge, and what should not?
- Styling Strategy
- A team wants to add styled-components to a Next.js App Router project. What do you say?
- Where does utility-first CSS actually save you, and where does it cost you?
- Why are design tokens usually custom properties rather than a TypeScript object?
- When would you not reach for a styling framework at all?
Part IV — Frontend at Scale
62 questions across 15 chapters.
- Frontend Architecture Patterns
- How would you structure a frontend that forty engineers work in?
- Where do you put business logic in a React app, and why not in the component?
- When would you not introduce a layered architecture?
- A change to one API response shape touched nine files. What went wrong?
- Micro-Frontends
- When would you turn down micro-frontends?
- Why must React be a singleton across remotes, and what breaks if it is not?
- A remote is down in production. What does the user see?
- How do two micro-frontends share the current user?
- Design Systems, Dependencies and Upgrades
- How would you introduce a design system into forty teams that all have their own components?
- You need to rename a prop on your most-used component. How do you ship it?
- When is a design system the wrong investment?
- A team says they cannot upgrade React because "too much would break". How do you find out?
- Reviewing AI-Generated Code
- What do you look for in a pull request that was mostly written by an assistant?
- A team's velocity is up and their defect rate is up with it. What do you change?
- When would you not slow down for extra review of generated code?
- Core Web Vitals
- What replaced FID, and what does it measure differently?
- A page has an LCP of 4.2 seconds. Walk me through your first hour.
- Why can Lighthouse not tell you your INP?
- Your CLS is 0.3 and you have set width and height on every image. Where else do you look?
- Loading, Code Splitting and Bundle Budgets
- Does code splitting not just move the delay to the click?
- You import one function from a library and the bundle grows by 70 kB. What happened?
- How do you stop bundle size regressing over a year?
- A page ships 2 MB of JavaScript and half is third-party. Where do you start?
- Caching and Asset Delivery
- How would you set cache headers for a single-page application?
- What is the difference between
no-cacheandno-store? - A user says the app is stuck on an old version and a reload does not help. What do you check first?
- When would you not cache an API response at the CDN?
- Why is a late-arriving font a Core Web Vitals problem rather than a cosmetic one?
- Measuring in Production
- Lighthouse gives the site 95 and users say it is slow. Who is right?
- What do you need on an error report before it is worth triaging?
- What is the privacy exposure here, and what do you do about it?
- XSS Prevention and Untrusted Input
- Encoding or sanitisation — when do you use each?
- How does React prevent XSS, and where does it fall short?
- A colleague adds a
postMessagelistener for an analytics widget. What do you check in review? - Your team wants to rely on CSP instead of fixing every
innerHTML. Would you agree?
- Content Security Policy and Security Headers
- Why is
'unsafe-inline'dangerous inscript-src? - What is
'strict-dynamic', and why use it? - How do you deploy a strict CSP without breaking production?
- How does HSTS work, and what is the risk?
- A team wants to ship without a CSP because it keeps breaking third-party widgets. What do you say?
- Why is
- Testing Strategy
- How do you decide whether something gets a unit test or an integration test?
- Your suite takes 25 minutes and people are merging without it. What do you do?
- Is 100% coverage worth aiming for?
- When would you not write a test?
- Writing the Tests: Vitest and React Testing Library
- Why would you pick Vitest over Jest for a new project?
- Why does Testing Library refuse to give you access to component state?
- When is
getByTestIdacceptable? - A test passes on its own and fails in the suite. Where do you look?
- When is a module mock the wrong tool?
- Frontend Integration Testing
- Why intercept requests instead of mocking the API module?
- What does an integration test catch that a unit test cannot?
- What can this layer not tell you?
- How do you test a loading state without making the suite slow?
- End-to-End, Visual and Contract Testing with Playwright
- How do you decide what deserves an end-to-end test?
- Your E2E suite fails about once a week for no clear reason. How do you approach it?
- Integration tests all pass, but production broke because the API renamed a field. What was missing?
- Would you add visual regression to every page?
- Testing Accessibility
- How do you test accessibility?
- What can automated tooling not catch?
- How would you introduce accessibility gates into a large legacy codebase?
- Which screen reader would you test with, and how much does the choice matter?
- A pull request adds a component with no accessibility tests. What do you ask for?
Part V — Backend for Frontend Engineers
61 questions across 15 chapters.
- The Node.js Event Loop, Async and Errors
- Node is single-threaded, so how does it handle 10,000 concurrent connections?
- What logs first —
setTimeout(fn, 0)orsetImmediate(fn)? - Should you keep the process alive after an
uncaughtException? - When would you move work to a worker thread instead of making it async?
- Node.js Performance, Streams and Scaling
- A service's p99 is 3 s while p50 is 30 ms. Where do you look?
- What is backpressure, and what happens if you ignore it?
- Why stream an LLM response or a large file download instead of sending it whole?
- Worker threads or more processes — how do you choose?
- What breaks when you turn on clustering in an app that worked as one process?
- Express, Hono and Edge Runtimes
- An async Express handler throws and the client hangs. What happened?
- Why can't you use
pgin a Cloudflare Worker? - You move an API route to the edge and it gets slower. Why?
- A new backend-for-frontend: Express or Hono on the edge?
- REST Best Practices and Versioning
- Which methods are idempotent, and why does it matter?
- How do you paginate ten million rows?
- How do you add a required request field without breaking clients?
- When would you not ship a
/v2?
- GraphQL, tRPC and Typed API Choices
- What is the N+1 problem in GraphQL, and why is it structural?
- How do you rate limit a GraphQL API?
- Is a tRPC API type-safe in production?
- A mobile app, a web app and two partners need your API. GraphQL, tRPC or REST?
- Rate Limiting
- What is wrong with fixed window?
- How do you count correctly across many servers?
- What do you key on, and why is IP a poor choice?
- When would you not rate limit an endpoint?
- Real-Time and Streaming APIs
- Do you validate WebSocket messages?
- How do you authenticate a socket, and what goes wrong?
- How do you make a broadcast reach every client across ten pods?
- When would you not build a socket server at all?
- Testing a Node Service
- What do you not unit test in a service?
- Dependency injection or
vi.mock? - How do you keep an integration suite isolated and still fast?
- SQL Fundamentals and Schema Design
- A
LEFT JOINis returning only matched rows. Why? - How do you get the top three rows per group?
- When would you denormalise?
- How do you stop two overlapping bookings for the same room?
- A
- Indexes, Query Plans, ORMs and Migrations
- You have an index on
(user_id, status, created_at). Which queries use it? - A query has an index and is still slow. What do you check?
- When do you drop out of the ORM into raw SQL?
- How do you rename a column with zero downtime?
- You have an index on
- Transactions and Concurrency
- What is a lost update, and does the default isolation level prevent it?
- Optimistic or pessimistic locking?
- How do you prevent deadlocks?
- Choosing a Non-Relational Store: Documents and Redis
- When would you choose MongoDB over Postgres?
- How do you decide whether to embed or reference?
- Redis is single-threaded. How is it fast, and what is the risk?
- Pub/Sub or Streams?
- A team wants Redis as the only database for a new orders service. What do you say?
- Credentials, Sessions, CORS and CSRF
- Sessions or JWTs?
- How do you revoke a JWT?
- Does CORS protect your API?
SameSite=Laxis set. Do you still need CSRF tokens?
- OAuth, OIDC and Authorisation
- Walk me through the authorisation code flow with PKCE.
- What is
statefor, and is it the same as PKCE? - What is broken object-level authorisation, and how do you prevent it structurally?
- 403 or 404 for a resource the user may not see?
- When would you not reach for ABAC or a policy engine?
- Input Validation and Injection
- Why is parameterisation safer than escaping?
- An endpoint is parameterised and still injectable. How?
- How does NoSQL injection work if there is no SQL string?
- Is validation enough on its own?
Part VI — System Design
70 questions across 18 chapters.
- Driving the Design Round, Backend and Frontend
- You have 45 minutes and the prompt is "design Instagram". What are the first five minutes?
- The interviewer says "assume whatever you like" for the scale. What do you do?
- In a frontend round, where does state go, and how do you decide?
- When would you not follow RADIO in order?
- Back-of-Envelope Estimation
- How much storage does a photo-sharing service need after five years?
- Why round 86,400 to 100,000?
- Your estimate says the whole dataset fits in RAM on one server. Is that the design?
- Scalability, Latency and Throughput
- Vertical or horizontal scaling — how do you choose?
- p50 is 40 ms and p99 is 3 seconds. Where do you look?
- Your service looks fine at 70% CPU and falls over at 85%. Why?
- When would you accept worse latency on purpose?
- Reliability, Consistency and CAP
- Your service calls four dependencies, each 99.9% available. What is your ceiling?
- What is the difference between high availability and disaster recovery?
- A user says their profile edit "did not save" in an eventually consistent system. What do you do?
- When is eventual consistency not acceptable?
- Load Balancing
- Layer 4 or layer 7 for an HTTP API, and why?
- Your health check hits the database. What is wrong with that?
- When would you not put a load balancer in front of a service?
- Caching
- Which caching pattern would you start with, and why?
- How do you decide the TTL?
- A hot key expires and the database falls over. What happened, and what do you do?
- When is caching the wrong answer?
- Content Delivery Network
- Why is a CDN a scaling tool and not just a performance one?
- After a deploy, users still get the old JavaScript. What went wrong?
- What is origin shielding and when do you need it?
- When is a CDN the wrong answer?
- Queues, Async Work and WebSockets
- Your consumer processes the same message twice. Whose bug is it?
- When would you pick Kafka over SQS?
- When is a queue the wrong answer to a slow endpoint?
- WebSocket or SSE for streaming job progress to the browser?
- How do you scale real-time connections across many servers?
- Service Boundaries and the API Gateway
- How do you decide where to split a monolith?
- Two services need to update atomically. What do you do?
- When are microservices the wrong answer?
- What is the difference between an API gateway and a load balancer?
- The gateway is now a single point of failure. What do you do about it?
- Resilience Patterns
- A downstream service starts taking 30 seconds instead of 200 ms. What happens to your service?
- How do you choose retry settings?
- When would you not add a circuit breaker?
- Choosing a Datastore and Replicating It
- SQL or NoSQL for this system — how do you answer without hedging?
- What do you actually lose by moving from PostgreSQL to DynamoDB?
- Your primary dies. What is lost?
- A user says their profile update "did not save". Diagnose it.
- When would you accept multi-leader replication?
- Sharding and Transactions at Scale
- When do you shard, and what would you do instead?
- What makes a good shard key?
- Two users buy the last item at the same time. How do you stop overselling?
- An order service and a payment service must both succeed. Would you use two-phase commit?
- Frontend Real-Time Features
- A client reconnects after 30 seconds offline. How does it catch up?
- Why does reconnection need jitter?
- What does the UI owe the user when the connection drops?
- How do you keep a live feed from degrading the page?
- When would you not use a socket in the client at all?
- Offline-First Architecture
- A user creates three records offline, then comes back online. Walk me through what happens.
- Why does the idempotency key have to be generated on the client?
- When would you refuse to build offline-first?
- Last-write-wins is simple. What is wrong with it?
- Frontend Authentication
- Where do you store the token, and why not
localStorage? - Eight requests get a 401 at the same moment. What happens?
- The client hides the delete button for non-admins. Is that authorisation?
- When would you not use tokens at all?
- Where do you store the token, and why not
- Design a URL Shortener
- How do you generate short codes at 1,000 writes a second without collisions?
- The cache is cold after a deploy and the store falls over. What went wrong?
- Would you shard this database, and on what?
- Design a Collaborative Document Editor
- Two people insert a character at the same position at the same moment. What decides the order?
- When would you not use a CRDT?
- A client has been offline for a week and reconnects. What happens?
- Design an Infinite Feed
- Users say posts appear twice as they scroll. What is happening?
- The list is virtualised and still janky on Android. Where do you look?
- When would you not build infinite scroll at all?
Part VII — AI Engineering
95 questions across 20 chapters.
- How LLMs Behave and How to Choose One
- Why does the same prompt give a different answer each time, and how do you test it?
- A conversation gets slower and more expensive the longer it runs. Why?
- Your summariser returns half a sentence. Where do you look?
- How would you decide between a frontier model and a cheaper one for a feature?
- Where would you not use a small model?
- Prompting as Engineering
- What separates a prompt in a chat window from a prompt in production?
- Why put instructions in the system prompt rather than the user message?
- When does few-shot stop helping?
- How do you change a prompt without breaking cases that currently work?
- A colleague wants to fix a hallucination by adding "do not hallucinate" to the prompt. Your view?
- Context Engineering
- What is context engineering, and how is it different from prompt engineering?
- Your cost per request doubled with no traffic change and no deploy. Where do you look?
- A conversation is about to exceed the window. What do you do?
- Does a million-token window mean retrieval quality stops mattering?
- How do you count tokens reliably before sending a request?
- Calling an LLM from TypeScript
- What is the first thing you add to a naive
await callModel(prompt)before shipping it? - The provider returns 200 and the user sees a half-finished sentence. What happened?
- Would you use a provider SDK or a unified one?
- How do you rate-limit an AI endpoint differently from a normal one?
- Where do you put the API key, and what else does that endpoint need?
- What is the first thing you add to a naive
- Streaming Responses
- Why stream when the total time is the same?
- SSE or WebSocket for a chat feature?
- A user closes the tab mid-answer. What happens, and what should happen?
- Streaming works locally and hangs in production. Where do you look?
- When would you not stream?
- Structured Output
- How do you get reliable JSON out of a model?
- The schema validates but the data is wrong. What does that tell you?
- When validation fails, do you retry?
- Does the shape of the schema change the quality of the output?
- How would you extract fields from a document where some are genuinely absent?
- Tool Calling and the Tool Surface
- Walk through what happens when a model calls a tool.
- Your agent keeps calling the same tool with the same arguments. What do you check first?
- How do you stop a tool-calling feature from deleting production data?
- Can you just expose your existing REST API as tools?
- MCP (Model Context Protocol)
- What problem does MCP actually solve?
- Would you build an MCP server for your team's internal API?
- What is the security risk in connecting to a third-party MCP server?
- How do tools and resources differ, and why does it matter?
- A tool call through an MCP server fails. Where do you look?
- When RAG, When Fine-Tune, When Neither
- When would you fine-tune instead of using retrieval?
- Your company has 400 pages of internal documentation. Design the assistant.
- What does "neither" look like as an answer?
- How do permissions affect this decision?
- Can you use both?
- Ingestion and Chunking
- How big should a chunk be?
- Why does chunking matter more than the embedding model?
- What metadata would you store, and why at ingestion time?
- You change the embedding model. What happens to the existing index?
- How do you keep the index in step with the source documents?
- Embeddings, Vector Stores and Retrieval
- What does a cosine similarity of 0.82 tell you?
- pgvector or a dedicated vector database?
- Vector, keyword, or both?
- What does a reranker do that the retriever cannot?
- How do you scope retrieval to what a user may see?
- What an Agent Is, and When to Use More Than One
- When would you build a workflow instead?
- Your agent runs to the step limit on every task. What is happening?
- When is one agent better than three?
- Is a reviewer agent a good idea?
- How would you bound cost across several agents?
- Memory, State and Long-Running Work
- Your agent forgot a constraint from the first message. What went wrong?
- An agent's window fills after ten steps. Summarise, or something else first?
- How do you stop a retry from sending two emails?
- How do you implement human approval for a destructive step?
- Evals, Retrieval Metrics and Error Analysis
- How do you know a prompt change made things better?
- What is recall@k, and why do you start with it?
- A user says the assistant gave a wrong answer. Walk me through the diagnosis.
- When is LLM-as-judge acceptable?
- Your assistant is "unreliable". How do you turn that into work?
- How do you decide between fixing the pipeline and upgrading the model?
- Observability and Cost Engineering
- What do you log for an AI feature that you would not log for a normal endpoint?
- Cost doubled with no deploy. Where do you look first?
- When is a cheap-model cascade a good idea?
- Guardrails and Safety
- Where do you put guardrails, and why not in the prompt?
- How do you stop personal data reaching the provider?
- What is the risk in rendering model output in a web page?
- How do you keep an agent from doing damage?
- What is over-refusal, and why does it matter?
- Prompt Injection
- Explain prompt injection to a backend engineer.
- What is the difference between direct and indirect injection, and which worries you?
- What is the single most useful question to ask in a design review?
- How do you defend an agent that must read untrusted content?
- Can you not just detect and filter injection attempts?
- Latency and Generative UI
- The model takes eight seconds. What does the user see?
- You add a reranker that improves answers and costs 300 ms. Is it worth it?
- What is the risk in rendering components from model output, and how do you contain it?
- When would you not build generative UI?
- Trust, Correctness and Failure States
- How do you show the user the answer might be wrong?
- Why not show a confidence score?
- When would you auto-apply a generated change?
- The request is rate-limited halfway through streaming. What does the user see?
- When do you retry automatically?
- Why design the failure states first?
- AI in Interviews
- An agent is looping in production. Walk me through it.
- The provider deprecates the model you are on in thirty days. What happens?
- When would you tell a product manager not to build an AI feature?
Part VIII — Ship and Operate
59 questions across 11 chapters.
- Git Fundamentals and Recovery
- What is the difference between
git fetchandgit pull? - You deleted a branch, or someone force-pushed over it. How do you get it back?
- What do the three
git resetmodes actually change? - When would you not use rebase or interactive rebase?
- Walk me through finding which commit introduced a regression.
- A secret was committed six months ago. What is your sequence?
- What is the difference between
- Branching, Review and Repository Strategy
- How would you choose a branching strategy for a new team?
- Squash, rebase, or merge commit — which and why?
- How do you keep pull requests reviewable?
- Monorepo or polyrepo for a product with a web app, an admin app and a shared design system?
- How do you make a breaking change to a shared library in a polyrepo?
- When would you not recommend a monorepo?
- CI/CD Fundamentals
- What is the difference between Continuous Delivery and Continuous Deployment?
- Why should an artefact be built only once?
- How do you keep a CI pipeline fast without deleting tests?
- Is code coverage a useful quality gate?
- When would you not add another gate to the pipeline?
- Container Images: Building and Hardening
- What is the difference between an image and a container, and why is a container not a small virtual machine?
- An image takes nine minutes to build and the only change was one line of application code. What is wrong?
- Why can't you pass a build secret with
ARG? - Would you use a distroless base image?
- A container exited with 137. What happened, and what do you check?
- How would you find out whether a newly announced vulnerability affects you?
- GitHub Actions and Pipeline Security
- How do you authenticate a workflow to a cloud provider without storing credentials?
- What is the risk of
pull_request_target, and when would you use it? - What is the difference between a reusable workflow and a composite action?
- When would you use a self-hosted runner, and what does it cost you?
- A token leaks from your pipeline. What do you do, and what do you need in place?
- Monitoring and Observability Fundamentals
- What is the difference between monitoring and observability?
- What is cardinality and why does it matter?
- Why alert on percentiles instead of averages?
- Explain SLI, SLO, SLA and error budgets.
- You are asked to add observability to a service that has none. Where do you start, and what do you deliberately not do?
- Metrics, Dashboards and Alerting
- How do you calculate p99 latency across many instances, and what is the common mistake?
- A metrics server keeps getting killed for using too much memory. What is happening and what do you do?
- What makes a good alert, and why alert on symptoms rather than causes?
- Explain burn-rate alerting.
- An alarm never fired even though the service was completely down. Why?
- When is a dashboard the wrong tool?
- Cloud Fundamentals, Storage and Delivery
- What is the difference between a region and an availability zone?
- Explain the shared responsibility model without naming a provider.
- When would you not use a managed service?
- How would you handle user file uploads in a web application?
- After a deploy, users are getting the old JavaScript. What went wrong and how do you fix it?
- Serverless Functions
- What actually happens on a cold start, and which parts can you influence?
- Why do serverless functions break databases, and what do you do about it?
- A function fires on file upload and sometimes processes the same file twice. Why?
- When would you choose a long-running server over functions?
- How do you keep secrets out of a function's environment variables?
- Platform Deploys and Preview Environments
- What actually happens when you promote a deployment to production?
- Why can moving a route to the edge make it slower?
- A user reports a white screen right after a deploy, but you cannot reproduce it. What is happening?
- What does a preview environment give you that a staging environment does not?
- How do you make sure the artefact you tested is the artefact you shipped?
- Deployment Strategies, Rollback and Feature Flags
- Explain blue/green versus canary.
- Your deploy went out ten minutes ago and errors are climbing. Walk me through what you do.
- How do you do a zero-downtime deployment when the change includes a schema migration?
- What is the difference between a canary deployment and a feature flag?
- When would you deliberately choose the strategy with the larger blast radius?
Part IX — The Human Layer
31 questions across 7 chapters.
- The STAR Framework and the Story Bank
- Your answer is running long and the interviewer looks restless. What do you do?
- The question is about a situation you have genuinely never been in. Now what?
- Why does "we" hurt an answer that is otherwise accurate?
- When would you deliberately not use STAR?
- Leadership, Influence and Saying No
- How do you know when to compromise and when to hold the line?
- What if the conflict never got resolved?
- How do you get technical debt prioritised when nobody wants to fund it?
- You think a feature is a waste of effort and you have been told to build it. What do you do?
- When is mentoring the wrong thing to offer?
- Problem Solving, Challenges and Failure
- What if your hardest technical problem is not that impressive?
- You are asked for a failure and every real one was partly someone else's fault. What do you say?
- When is the right answer to stop debugging?
- How do you tell a "risk that did not pay off" story without looking reckless?
- Ways of Working and Engineering Culture
- Your team runs two-week sprints but keeps missing the goal because of incidents. What do you change?
- Which DORA metric would you look at first on joining a team, and why?
- A director asks you to report deployment frequency per engineer. What do you say?
- Tell me about an incident you were involved in and what changed afterwards.
- How would you improve a team's code review culture?
- Explaining and Thinking Aloud
- How much clarifying is too much?
- You realise ten minutes in that your approach will not work. What do you say?
- How do you explain a technical trade-off to a product manager who wants both options?
- The interviewer clearly disagrees with your design mid-explanation. What do you do?
- How do you talk about team work without overclaiming or disappearing?
- Written Communication
- What makes a pull request easy to review?
- Your team has no ADRs. How do you introduce them without a process mandate?
- When is writing it down the wrong call?
- How do you disagree with a reviewer in writing without it escalating?
- The AI-Assisted Interview
- We allow an AI assistant in this round. How will you use it?
- The assistant just gave you twenty lines. What do you do next?
- How is the code-comprehension round different from a normal coding round?
- When would you refuse to use the assistant even though it is allowed?
What to Read Next
- Glossary — a term you met in a question, in one line
- How to Read This Book — where this index sits in the six-week plan
- Further Reading — what to read when a whole part came back blank