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

Explain the difference between SSR, SSG, ISR, and CSR in Next.js. When would you choose each?

SSR renders pages on each request, SSG pre-renders at build time, ISR adds background updates to SSG, and CSR renders in the browser—choose based on data freshness needs, performance requirements, and user personalization

Next.js offers four primary rendering strategies: Server-Side Rendering (SSR), Static Site Generation (SSG), Incremental Static Regeneration (ISR), and Client-Side Rendering (CSR). Each strategy determines when and where the HTML for your pages is generated, with different trade-offs in performance, SEO, data freshness, and user experience. Modern Next.js applications often combine multiple strategies within the same application, using SSG for marketing content, ISR for product pages, SSR for personalized dashboards, and CSR for interactive components that need real-time updates.

Quick Comparison Overview
  1. 1

    SSR (Server-Side Rendering): HTML generated per request on the server. Best for personalized, user-specific content that needs to be fresh and indexable .

  2. 2

    SSG (Static Site Generation): HTML generated at build time. Best for public, unchanging content where performance is critical .

  3. 3

    ISR (Incremental Static Regeneration): SSG with background updates. Best for large sites where content changes but not instantly, combining static speed with freshness .

  4. 4

    CSR (Client-Side Rendering): HTML generated in browser after JavaScript loads. Best for highly interactive, authenticated content where SEO isn't a priority .

SSR Example: Real-time Dashboard
SSG Example: Blog or Marketing Site
ISR Example: E-commerce Product Pages
CSR Example: Interactive Dashboard

To choose the right rendering strategy, ask these questions in order: First, does the page need SEO? If yes, you need server-rendered HTML (SSR, SSG, or ISR). Second, is the content personalized per user? If yes, SSR or client-side fetching after static shell. Third, how often does the data change? Real-time needs client-side updates; occasional updates work with ISR; never-changing works with SSG. Fourth, how many pages do you have? Large catalogs need ISR to avoid massive builds. Fifth, what's your performance budget? SSG gives the best Core Web Vitals scores, while SSR adds server time .

Strategy Selection Matrix
  1. 1

    Marketing homepage: SSG with ISR (updates when campaigns change)

  2. 2

    Blog posts: SSG (build-time generation, occasional updates via rebuild)

  3. 3

    E-commerce product pages: ISR (popular pages pre-rendered, long-tail on-demand)

  4. 4

    User dashboard: SSR for initial load + CSR for real-time updates

  5. 5

    Admin panel: CSR (authenticated, SEO irrelevant, highly interactive)

  6. 6

    Documentation site: SSG (content changes with version releases)

  7. 7

    Social media feed: CSR with WebSockets (real-time, user-specific)

  8. 8

    News article: ISR with on-demand (publish via webhook, instant update)

Hybrid Approach: Combining Strategies

SSG delivers the best performance (Time to First Byte under 100ms from CDN edge) and excellent SEO (complete HTML at load). SSR adds server processing time (typically 200-500ms TTFB) but still provides complete HTML for SEO. ISR gives SSG-like performance with freshness windows. CSR has the worst initial load performance (blank page until JS loads) and poor SEO unless using techniques like dynamic rendering or prerendering, which add complexity . Modern Next.js apps often use a hybrid strategy: SSG for content, ISR for updates, and CSR for real-time features within the same page.

Real-World Examples
  1. 1

    Vercel Marketing Site: SSG for marketing pages, ISR for blog posts, SSR for dashboard after login

  2. 2

    Nike.com: ISR for product pages (millions of products, updates with inventory), CSR for cart and checkout

  3. 3

    The New York Times: ISR with on-demand for articles (publish via webhook), CSR for comments and real-time updates

  4. 4

    Notion: CSR for the editor (highly interactive), SSR for public pages (documentation, marketing)