Question presented to candidate: "Why is Next.js considered better for SEO than a React single-page app, and what can still go wrong for SEO in a Next.js app?"
What a strong answer should cover:
- A client-rendered SPA sends an almost empty HTML shell; content and titles appear only after JavaScript runs and data loads.
- Next.js renders on the server (static, ISR, dynamic or PPR), so the first HTML already contains content, title, description and social tags.
- Crawlers that do not run JavaScript, and social preview bots, see the full page; Google also indexes faster when it does not need to render.
- Built-in helpers: Metadata API, opengraph-image, sitemap.ts, robots.ts, and structured data via JSON-LD.
- It can still go wrong: client-only data fetching, missing metadataBase, content behind client components that fetch after load, and slow server responses.
Clarifying questions expected:
- "Which pages need to rank?" β they must render their content on the server.
- "Are social previews important?" β then metadata must be in the head for HTML-limited bots.
Code / implementation expected: Optional β the difference in the first HTML.