Questions
1 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?
01 / 33

Explain server-side rendering (SSR) in Next.js.

Difficulty: 6/10
getServerSideProps, data fetching, performance

Server-side rendering (SSR) is a technique used in web development to improve the performance and SEO of web applications. In the context of Next.js, SSR refers to the process of rendering React components on the server side before sending the fully-rendered HTML to the client's browser. This approach has several advantages over traditional client-side rendering (CSR), where the rendering process occurs on the client's device.

Here's how server-side rendering works in Next.js:
  1. 1

    User Requests a Page: When a user requests a page of your Next.js application by entering a URL or clicking a link, the server receives the request.

  2. 2

    Server-side Rendering: In a Next.js application configured for SSR, the server renders the requested page on the server side. This involves executing the relevant React components for the requested page and generating the HTML content that represents the page's initial state.

  3. 3

    HTML Response: Once the rendering process is complete, the server sends the fully-rendered HTML content to the client's browser as a response to the user's request. This HTML content includes the initial data and UI of the requested page.

  4. 4

    Client Hydration: When the browser receives the HTML content, it also downloads the necessary JavaScript bundles that contain the React components and logic. The JavaScript code takes over the interactivity of the page, attaching event listeners, handling user interactions, and managing dynamic updates.

  5. 5

    Interactivity and Routing: From this point on, the application behaves like a traditional React application, handling client-side routing, state management, and dynamic updates as users interact with the page.

Scenario Questions

0-2 years experience

  1. 1How would you fetch data for a page using server‑side rendering in Next.js?
  2. 2What happens if you try to use a browser‑only API like window inside getServerSideProps?
  3. 3If you add getServerSideProps to a page that previously fetched data on the client, how does the rendering flow change?

2-5 years experience

  1. 1We have a product page that shows personalized content based on a cookie. How would you implement that with SSR, and what trade‑offs do you consider?
  2. 2During a recent deployment a page using getServerSideProps started returning 500 errors. How would you debug the issue?
  3. 3Why can heavy computation inside getServerSideProps hurt page latency, and what techniques could you use to mitigate it?

5-8 years experience

  1. 1Design a strategy for a large e‑commerce site where most pages are static but some need real‑time inventory data. Which Next.js patterns would you combine?
  2. 2How would you handle caching of SSR responses at the edge while still delivering per‑user personalization?
  3. 3If traffic spikes dramatically, what architectural changes (e.g., serverless functions, ISR) would you consider to keep SSR performant?

8+ years experience

  1. 1Our monorepo contains many legacy React apps. Propose a migration plan to a unified Next.js platform using SSR that minimizes disruption across teams.
  2. 2Discuss the long‑term maintenance implications of relying heavily on getServerSideProps versus static generation with incremental static regeneration in a multi‑team environment.
  3. 3How would you set up observability and performance budgeting for SSR pages across the organization, and which metrics would you track?

Follow-up Questions

  • Can you walk me through how you’d test the SSR data fetching locally?
  • What metrics would you monitor in production to catch SSR performance regressions?
  • How does SSR impact SEO compared to client‑side rendering?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.