Summary
CSR renders in the browser. SSR renders HTML on the server per request. SSG pre-renders HTML at build time.
Interview Points
- CSR is rich and app-like but can delay first meaningful content.
- SSR improves first paint and SEO for dynamic pages.
- SSG is fastest for mostly static content.
- Hybrid rendering often gives the best route-by-route tradeoff.
- Consider auth, freshness, SEO, caching, and interactivity.
2-3 Minute Interview Script
“CSR, SSR, and SSG are rendering strategies. Client-side rendering ships JavaScript and renders in the browser. It works well for highly interactive apps, but first load can suffer if the bundle is large.
Server-side rendering creates HTML per request, which can improve first paint and SEO, especially for dynamic content. The tradeoff is server cost and request-time complexity.
Static site generation pre-renders pages at build time. It is very fast and cacheable, but only fits content that can tolerate build-time freshness or incremental regeneration.
In an interview, I would choose per route: SSG for docs or marketing, SSR for dynamic SEO or authenticated first paint, and CSR for deeply interactive surfaces after initial load.”
Follow-Ups
- What is hydration?
- When does SSR hurt performance?