React and Next.js · 27 concepts
Next.js
Next.js 16 App Router in depth: routing, Server and Client Components, Cache Components and caching, Server Actions, proxy, auth, performance and deployment, plus the Pages Router knowledge interviewers still ask.
Asked in these mock interviews
Part 1 · 4 concepts
App Router foundations
- 01
File-system routing and special files
In the App Router each folder under app/ is a route segment, page.tsx makes it reachable, layout.tsx wraps it and stays mounted across navigation, and special files…
- 02
Navigation, prefetching and the client cache
<Link> makes client-side transitions that keep shared layouts and fetch only changed segments, and it prefetches routes as links enter the viewport; Next.js 16 rewrote…
- 03
Parallel and intercepting routes (the modal pattern)
Parallel routes (@slot folders) render several pages in one layout; combined with intercepting routes ((.)photo/[id]) they give modals with a real, shareable URL that…
- 04
Errors and not-found in the App Router
Model expected errors as return values, call notFound() for missing records so the response is a real 404, and let error.tsx (route level), catchError (component level…
Part 2 · 3 concepts
Server and Client Components in Next.js
- 05
The "use client" boundary
"use client" declares a boundary in the module graph: the file and everything it imports become client code, so put it on small interactive leaves and pass…
- 06
Secrets, serialisation and environment poisoning
Only serializable data crosses from server to client, only NEXT_PUBLIC_ variables reach the browser (inlined at build time), and server-only code should be marked with…
- 07
Fetching data in Server Components without waterfalls
Server Components fetch data directly with await; start independent requests in parallel (or pass promises down) to avoid waterfalls, dedupe repeated reads in one…
Part 3 · 4 concepts
Rendering strategies
- 08
CSR, SSR, SSG and ISR
CSR renders in the browser from an empty shell, SSR renders HTML per request, SSG renders HTML at build time, and ISR is SSG that regenerates in the background; modern…
- 09
Pages Router: getServerSideProps, getStaticProps and migrating
Interviewers still ask Pages Router data functions: getServerSideProps runs on every request, getStaticProps at build (plus revalidate for ISR), getStaticPaths lists…
- 10
Streaming with loading.tsx and Suspense
Streaming sends the page shell first and each Suspense boundary's content later in the same response; loading.tsx is a route-level Suspense boundary, and pushing slow…
- 11
Hydration errors in Next.js
A hydration error means the HTML the server sent differs from the client's first render; in Next.js the usual causes are dates and time zones, random values…
Part 4 · 6 concepts
Caching in Next.js 16
- 12
Is this fetch cached? Next.js 14 vs 15 vs 16
Next.js caching changed twice: 14 cached fetch, GET handlers and routes implicitly; 15 made them uncached by default; 16 introduced Cache Components where everything is…
- 13
Cache Components and Partial Prerendering: the static shell
With Cache Components, Next.js prerenders a static shell for every route from everything that can finish at build time (static code, "use cache" results, Suspense…
- 14
"use cache", cacheLife and cacheTag
"use cache" caches the return value of an async function, component or whole file; its key is built from the build id, the function id, its serialized arguments and…
- 15
Revalidation: updateTag, revalidateTag, revalidatePath and refresh
After a mutation, updateTag(tag) (Server Actions only) expires a tag so the user immediately sees their change, revalidateTag(tag, "max") refreshes in the background…
- 16
ISR and rendering a large catalog
For tens of thousands of product pages, prerender only the popular ones with generateStaticParams, serve an instant App Shell for the rest and upgrade them after the…
- 17
Cross-user data leaks through caching
Two users seeing each other's data usually means user-specific output was cached without the user in the key, a route was made static while rendering per-user data…
Part 5 · 5 concepts
Mutations, APIs and the request layer
- 18
Server Actions: how they work
A Server Action is a "use server" function that the client calls with a POST to the current page; Next.js runs it, and in the same response returns its value plus the…
- 19
Securing Server Actions and Server Functions
Every Server Action is a public HTTP endpoint: Next.js adds origin checks, encrypted ids and closure encryption, but you must authenticate, authorise, validate input…
- 20
Route Handlers vs Server Actions vs a separate backend
Route Handlers (route.ts) are HTTP endpoints built on Web Request/Response, for webhooks, public or mobile APIs, files and streams; Server Actions are for mutations…
- 21
proxy.ts (formerly middleware.ts)
In Next.js 16 middleware.ts was renamed proxy.ts; it runs on the Node.js runtime before routing for every matched request and is for redirects, rewrites, headers and…
- 22
Authentication and authorisation in the App Router
Keep public pages static and do auth checks close to the data: an optional optimistic cookie check in proxy, a Data Access Layer whose verifySession() runs in every…
Part 6 · 2 concepts
Images, fonts, scripts and SEO
- 23
next/image, next/font and next/script
next/image serves resized modern-format images with reserved space and lazy loading, next/font self-hosts fonts with fallback metrics so text does not shift, and…
- 24
Metadata, SEO and social previews
Next.js builds <head> tags from a static metadata export or an async generateMetadata in Server Components, plus file conventions for icons, Open Graph images, robots…
Part 7 · 3 concepts
Build, deploy and upgrade
- 25
Turbopack and the build pipeline
Turbopack is the default bundler for next dev and next build since Next.js 16; custom webpack() config is ignored unless you opt out with --webpack, and later 16.x…
- 26
Deploying: Vercel vs self-hosting, environment variables and version skew
Next.js runs on Vercel, any Node server (next start, Docker), platforms through the stable Adapter API, or as a static export; self-hosting at scale means sharing…
- 27
Upgrading to Next.js 16: what breaks
Next.js 16 removed sync access to request APIs, renamed middleware to proxy, made Turbopack the default, changed revalidateTag, image defaults and parallel-route rules…
Your first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.