Skip to content
RED SAGSkills
hardFull Stack Developer interview question

For a large e-commerce site in Next.js, how would you choose the rendering and caching strategy for the home page, product pages, cart and account pages?

What the interviewer wants to hear

  • Static or cached rendering for pages shared by all users
  • Revalidation by time or on-demand tags when products change
  • Dynamic, personalized parts streamed or rendered separately
  • Cart and account are user-specific and never cached publicly
  • Trade-offs between freshness, cost, SEO and Core Web Vitals

Model answer

I would decide per route based on how personal and how fresh the data must be. The home page and category pages are mostly the same for everyone, so I prerender them and cache them at the CDN, with revalidation by time or on-demand by cache tags when the catalog changes. Product pages matter most for SEO, so I prerender popular ones and render the rest on first request and cache them; when a price or description changes, the admin action invalidates that product tag. Fast-changing parts like live stock or personalized recommendations I render dynamically inside a Suspense boundary, so the static shell streams instantly, which is what partial prerendering is designed for. Cart, checkout and account pages are per user, so they are rendered dynamically and marked private, never stored in a shared cache. I would watch Core Web Vitals and cache hit rates to tune this.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Full Stack Developer questions