What is the difference between static site generation and server side rendering?
Assesses fundamental understanding of Next.js conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
Both Static Site Generation (SSG) and Server-Side Rendering (SSR) are pre-rendering techniques in Next.js, but differ in when the HTML is rendered:
| Criterion | Static Site Generation (SSG) | Server-Side Rendering (SSR) |
| :--- | :--- | :--- |
| When Rendered | At build time (next build) or via ISR | On every incoming HTTP request |
| Response Latency | Extremely fast (served directly from CDN edge) | Slower (waits for server computation & DB queries) |
| Server Overhead | Zero origin server compute required per visit | Consumes server CPU/RAM on every user request |
| Dynamic Content | Best for content that changes infrequently (blogs, docs) | Best for personalized dashboards, live data feeds |
| Next.js Implementation | Server Components with cached fetch or getStaticProps | Server Components with cache: 'no-store' or getServerSideProps |
### Architectural Recommendation:
Use SSG / ISR whenever possible for maximum SEO performance, low server hosting costs, and instant page loads. Reserve SSR for pages requiring user authentication, dynamic cookies, or real-time query parameters.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.