Questions
10 of 33
1Explain server-side rendering (SSR) in Next.js.
2List the benefits of Server-Side Rendering in Next.js.
3What are server components?
4How to use server components in next js?
5What is the React Server Component Payload (RSC)?
6Describe how server components are rendered.
7Describe server rendering strategies
8How can you keep Server-only Code out of the Client Environment
9What are the issues of using context provider at the root of the application?
10List dynamic functions available to server components.
11List all Dynamic APIs.
12How do we opt for Static Rendering, Dynamic Rendering and Streaming?
13Explain the difference between SSR, SSG, ISR, and CSR in Next.js. When would you choose each?
14How does getServerSideProps work internally? What is its execution context?
15What are the performance trade-offs of SSR vs SSG in a high-traffic production app?
16How does Next.js handle hydration? What is a hydration mismatch, and how do you debug it?
17What happens when getServerSideProps throws an error? How do you handle it gracefully?
18How would you architect a Next.js app that needs both personalised (SSR) and cacheable (SSG) pages at scale?
19Explain the App Router vs Pages Router SSR model differences. How does React Server Components change the SSR paradigm?
20How do React Server Components (RSC) differ from traditional SSR? Can they be used together?
21How does streaming SSR work in Next.js 13+? What role does Suspense play?
22How would you implement partial hydration or Islands Architecture in Next.js?
23Explain how Next.js handles data fetching waterfall problems in SSR and how you'd mitigate them.
24How would you implement partial hydration or Islands Architecture in Next.js?
25How do you implement caching strategies for SSR responses in Next.js? (CDN, Cache-Control, stale-while-revalidate)
26How would you reduce TTFB (Time to First Byte) in an SSR-heavy Next.js app?
27What's the difference between fetch caching in the App Router vs traditional getServerSideProps?
28How do you avoid redundant database/API calls across multiple server components on the same page?
29How do you securely handle authentication in SSR? What are the risks of passing tokens via cookies vs headers?
30How do you prevent sensitive server-side data from leaking to the client bundle?
31How would you implement role-based rendering on the server without exposing protected routes to the client?
32How do you debug SSR-only issues that don't appear in local development?
33How can we control dynamic rendering behaviour in next js?
10 / 33

List dynamic functions available to server components.

Dynamic functions rely on information that can only be known at request time such as a user's cookies, current requests headers, or the URL's search params. In Next.js, these dynamic functions are:

  1. 1

    cookies() and headers(): Using these in a Server Component will opt the whole route into dynamic rendering at request time.

  2. 2

    useSearchParams(): In Client Components, it'll skip static rendering and instead render all Client Components up to the nearest parent Suspense boundary on the client. We recommend wrapping the Client Component that uses useSearchParams() in a <Suspense/> boundary. This will allow any Client Components above it to be statically rendered.

Difficulty: 5/10
Topics: server components, dynamic data fetching, Next.js caching

Scenario Questions

0-2 years experience
  1. 1

    How would you fetch data inside a server component using the built‑in fetch function and control its caching?

  2. 2

    What happens if you call the cookies() function inside a server component?

  3. 3

    Which dynamic function would you use to trigger a redirect from a server component, and how does it work?

2-5 years experience
  1. 1

    You notice that a page using fetch in a server component is not revalidating as expected. Walk me through how you would debug it using the dynamic functions available.

  2. 2

    Explain a scenario where you would choose revalidatePath versus revalidateTag in a server component, and the trade‑offs involved.

  3. 3

    If you need to read request headers in a server component, which function do you use and what are its limitations?

5-8 years experience
  1. 1

    Design a strategy for a large e‑commerce site to invalidate cached data across many server components when inventory changes, using the dynamic functions. What edge cases do you consider?

  2. 2

    How would you architect a feature that conditionally disables caching for certain server component calls, and which functions would you employ?

  3. 3

    Discuss the performance implications of using unstable_noStore versus cache in high‑traffic server components.

8+ years experience
  1. 1

    Your organization is migrating a monolith to Next.js with server components. How would you establish guidelines for using dynamic functions like redirect, notFound, and revalidateTag to ensure consistency and avoid subtle bugs across teams?

  2. 2

    When multiple teams need to share a common data‑fetching layer in server components, how would you design an abstraction that leverages the built‑in dynamic functions while keeping the API stable?

  3. 3

    Consider a scenario where a legacy API returns varying cache headers. How would you reconcile those with Next.js’s dynamic functions to maintain correct revalidation across the platform?

Follow-up Questions

  • Can you give an example of when you’d prefer revalidateTag over revalidatePath?
  • What pitfalls have you seen when using redirect inside a server component?
  • How does unstable_noStore impact SSR performance and cache behavior?