Next.js Senior interview questions and answers
75 questions for a Next.js (Senior) interview - with correct answers, explanations and links to the docs.
Take this quiz- 1.What is the RSC payload?
- 2.What happens during client navigation via
<Link>in the App Router? - 3.With
cacheComponents: true, the dev overlay shows "blocking route". What does it mean? - 4.How does
'use cache: remote'differ from'use cache'? - 5.What do you need to consider when self-hosting Next.js on several Kubernetes pods?
- 6.What do the
stale,revalidateandexpireparameters incacheLifemean? - 7.How does Next.js protect Server Actions from CSRF?
- 8.Why shouldn't Server Actions be used for loading data?
- 9.A Server Action is declared inside a component and uses a variable from its closure. What happens to it?
- 10.What is the React Taint API (
experimental_taintObjectReference) for in Next.js? - 11.Why does a CSP with a nonce make pages dynamic?
- 12.Why does
error.tsxin production get a generic message for an error from a server component? - 13.What changed in
next/imagedefaults in Next.js 16? - 14.Which runtime does
proxy.tsuse in Next.js 16? - 15.What prefetching optimizations appeared in the Next.js 16 router?
- 16.What does
optimizePackageImportsdo? - 17.When do you need the
serverExternalPackagesoption? - 18.What is Draft Mode for?
- 19.What is the
instrumentation.tsfile with aregister()function for? - 20.How do you implement on-demand ISR via a CMS webhook?
- 21.Why are Context providers in the App Router moved into a separate client component?
- 22.A third-party component uses hooks but has no
'use client'. How do you use it in a server page? - 23.How do you get configuration from an environment variable at runtime rather than at build time?
- 24.What is version skew, and how does
deploymentIdhelp with it? - 25.Why can't
generateStaticParamsreturn an empty array with Cache Components? - 26.How do
GETRoute Handlers behave with Cache Components enabled? - 27.What does the user get if a Server Action calls
revalidatePathand returns a value? - 28.How do you connect
forbidden()andunauthorized()to UI? - 29.How does metadata from
generateMetadatabehave during streaming? - 30.When should you enable
reactCompilerin Next.js 16? - 31.How does
unstable_rethrowhelp with error handling? - 32.Why shouldn't a layout be the only place where authorization is checked?
- 33.What are Multi-Zones?
- 34.Why is page data sometimes sent twice - in the HTML and in the RSC payload?
- 35.What is prefetched for a dynamic route by
<Link>with default settings? - 36.How does
refresh()fromnext/cachediffer fromrevalidatePath? - 37.How does Next.js 16 speed up repeated runs of
next devandnext build? - 38.What is
typedRoutesuseful for? - 39.How does the Edge runtime differ from Node.js for routes?
- 40.A component shows
new Date().toLocaleString()and causes a hydration mismatch. What's the most correct fix? - 41.What does
after()in a Route Handler give you compared toawait logEvent()before responding? - 42.How do you make sure a
'use cache'function doesn't cache different users' data together? - 43.How does the URL-preserving modal pattern work in the App Router?
- 44.What's the right outcome for an error in
generateStaticParamsduring the build? - 45.Why does reading
searchParamsat the top level of a page reduce the benefit of PPR? - 46.Which command generates the
PagePropsandLayoutPropstypes without running the dev server? - 47.How does
htmlLimitedBotsdiffer from regular bot handling? - 48.What happens if a layout calls
await paramsat the top level with Cache Components and nogenerateStaticParams? - 49.How does
'use cache'caching work on a serverless platform with the default handler? - 50.Why do Server Actions get encrypted, non-deterministic IDs?
- 51.With Partial Prefetching enabled, what does
await prefetch()inside a component do? - 52.What does
export const ensureStatic = 'shell'guarantee for a route? - 53.What does
export const instant = truein a segment do? - 54.Why does
useOffline()fromnext/offlinealways returnfalsein a project? - 55.With Cache Components, how do you reset a subtree on
<Link>navigation but still restore it on browser Back? - 56.How can a
'use cache'component acceptchildrenif JSX can't be serialized as a cache key? - 57.Why does a
'use cache'function withcacheLife('seconds')end up as a dynamic hole instead of in the prerendered page? - 58.Where do you plug in a shared cache store (e.g. Redis) for
'use cache'when self-hosting? - 59.What is the Build Adapters API (
adapterPath) for? - 60.Why can
next devandnext buildrun at the same time in Next.js 16? - 61.
publicRuntimeConfigwas removed in Next.js 16. How do you provide config that differs per environment without rebuilding? - 62.The site uses
scroll-behavior: smooth, and after upgrading to Next.js 16 every navigation scrolls smoothly to the top. How do you restore instant jumps? - 63.Why is
images.domainsdeprecated in favor ofimages.remotePatterns? - 64.Why does Next.js 16 block optimizing images from local IP addresses by default?
- 65.Why shouldn't a server component
fetchyour own Route Handler (/api/products) for data? - 66.A Server Action
deletePost(id)is used only on an admin page. Why must it still check authorization itself? - 67.How do you apply a saved theme or locale-specific date before the first paint without a hydration error or flash?
- 68.How does
generateStaticParamswork for nested dynamic segments like/[category]/[product]? - 69.
notFound()is called inside a component that streams in a<Suspense>boundary. What does the crawler get? - 70.Why should
proxy.tsdo only optimistic auth checks? - 71.A CDN in front of a self-hosted Next.js keeps serving an old page after
revalidateTag(). Why? - 72.A catalog has 1M products. How do you build quickly but still serve all of them statically (without Cache Components)?
- 73.Where does Turbopack configuration live in Next.js 16?
- 74.What changed for the props of
opengraph-image,iconandapple-iconfunctions in Next.js 16? - 75.With Cache Components, when is
connection()still the right choice overio()?