CSR: the browser cooks it with JavaScript. Fast server, slow first view, weak SEO.
SSR: the server cooks a fresh page on every request. Always fresh, more server work.
SSG: cooked once at build time and served instantly. Great for content that rarely changes.
ISR: static, but re-cooked in the background every X seconds or on demand.
Say it like this in the interview
“CSR renders in the browser; SSR renders on each request; SSG pre-renders at build; ISR is static with periodic or on-demand regeneration. In the App Router, a page is static by default and becomes dynamic when it uses request data like cookies or headers. I choose per route: static for marketing and docs, dynamic for personalised dashboards.”
Server Components run only on the server: they can read the database directly and send zero JavaScript to the browser. Client Components ('use client') also run in the browser, so they can use state, effects and click handlers.
Say it like this in the interview
“In the App Router components are server components by default. They can be async, fetch data directly and keep secrets, and they ship no JS. I add 'use client' only at interactive leaves like forms, toggles and charts. Server components can render client components and pass them serialisable props, but not the other way round by import.”
Traps that make people fail
Putting 'use client' at the top of the layout, which turns the whole tree into client code.
The server drew a picture, then the browser tried to attach interactivity to it but drew something different. Usually because the output depends on things that differ between server and browser: time, random numbers, window, locale.
Say it like this in the interview
“Output differs between server and client render: Date.now(), Math.random(), typeof window branches, locale-formatted dates, browser extensions modifying the DOM, or invalid HTML nesting like a <div> inside a <p>. Fixes: render such values only after mount in an effect, use suppressHydrationWarning for things like timestamps, or dynamic(..., { ssr: false }) for browser-only components.”
Next.js caches aggressively so pages are fast. After you change data, you have to tell it which cached pages or data are now out of date.
Say it like this in the interview
“After a mutation in a Server Action or route handler I call revalidatePath('/products') or revalidateTag('products') for tagged fetches. For data that must always be fresh, I opt into dynamic rendering. I check which version of Next.js the project uses, since caching defaults changed across versions, and newer versions use the use cache directive with cache tags and lifetimes.”
A Server Action is a server function you can call straight from a form or button, without writing an API route. But it’s still a public endpoint anyone can call with any data.
Say it like this in the interview
“Server Actions are async functions marked 'use server' that the client can invoke, ideal for form mutations with progressive enhancement. Because they’re exposed as POST endpoints, every action must authenticate the user, authorise the specific operation and validate input, for example with Zod, just like an API route.”
“app/api/items/route.ts exports GET, POST and so on, receiving a Request and returning Response.json(). Dynamic segments come from the params argument. Validate input and authenticate inside.”
Make sure every page has its own title, description and canonical URL, is rendered as real HTML on the server, loads fast, and is listed in a sitemap.
Say it like this in the interview
“Server-rendered content, the Metadata API or generateMetadata per route with title, description, canonical and Open Graph tags, sitemap.ts and robots.ts, structured data with JSON-LD, next/image for optimised images, next/font to avoid layout shift, and good Core Web Vitals.”
Two ways of building Next.js apps. The newer App Router uses folders with page.tsx and layout.tsx, Server Components by default, and nested layouts. The Pages Router is the older system with getServerSideProps.
Say it like this in the interview
“The App Router uses React Server Components, nested layouts, streaming, Server Actions and a new caching model; the Pages Router uses getStaticProps and getServerSideProps and client components everywhere. New projects use the App Router.”
Special files that automatically show a loading state, an error screen, or a 404 page for that part of the app.
Say it like this in the interview
“loading.tsx wraps the segment in a Suspense boundary, error.tsx is an error boundary (a client component) with a reset function, and not-found.tsx renders when notFound() is called. They’re scoped to their route segment.”
Code that runs before a request reaches a page: redirect logged-out users, rewrite URLs, set headers, A/B testing.
Say it like this in the interview
“It runs before routing for matched paths, used for auth redirects, rewrites, geolocation or header changes. It should stay lightweight; authorisation must still be checked where data is accessed, because middleware alone isn’t a complete security layer.”
It automatically resizes images for each screen, serves modern formats, lazy-loads, and prevents layout jumping.
Say it like this in the interview
“Automatic resizing and srcset, WebP or AVIF conversion, lazy loading, required dimensions or fill to prevent layout shift, and priority for the LCP image.”
For safety, only variables starting with NEXT_PUBLIC_ are sent to the browser. Others stay on the server.
Say it like this in the interview
“Only NEXT_PUBLIC_-prefixed variables are inlined into client bundles at build time. Secrets must stay server-only and be accessed in server components or route handlers. Changing a public variable requires a rebuild.”