T

TechIdea

Ecosystem

Next.js Interview Questions

Master Server Components, caching strategies, routing, and Next.js 14+ architecture.

Written by:TechIdea Vercel Experts (Next.js Architects)
Reviewer:Interview Board
Last Verified:2026-06-25
🛡️

Editorial Integrity

Updated for Next.js 14+ App Router paradigms, completely ignoring deprecated Pages Router patterns.

Intermediate

What is the difference between Server Components and Client Components?

Server Components render on the server and send zero JavaScript to the browser, making the page load much faster. Client Components render on the browser and are required whenever you need interactivity (like `onClick`) or state (`useState`).

Deep Dive Explanation

In Next.js 13+ (App Router), all components are Server Components by default. They can directly query databases and keep sensitive API keys secure. To use a Client Component, you must add the `'use client'` directive at the top of the file. Client Components add to the client-side JavaScript bundle size, so they should be pushed down the component tree as far as possible (e.g., wrap a button in a Client Component, not the whole page).

Enterprise Use Case: A blog post page. The article text, title, and comments list can be Server Components (fetched directly from the DB). The 'Like' button at the bottom needs an `onClick` handler, so it must be extracted into a small Client Component.
💡 Interview Strategy:Always emphasize that Server Components are the default, and Client Components should only be used at the 'leaves' of the component tree to minimize JS payload.
🚨 Common Pitfalls to Avoid:

Adding 'use client' at the top of `page.tsx`, effectively disabling all Server Component benefits for the entire route.

Growth Newsletter

Get practical AI tools, SEO tips, and growth guides weekly.

Join creators, students, and businesses scaling with TechIdea.