Questions
4 of 27
1What are client components?
2How to implement client rendering in next js?
3Describe how client components are rendered.
4How to decide what part should be rendered on the server and what on the client?
5Combining client and server components
6How to render a server component in the client component?
7Discuss best approaches with client components.
8Does using 'use client' ensure that the component only renders on the client?
9Explain the full lifecycle of a CSR page in Next.js — from initial HTML delivery to interactive UI.
10What is the difference between useEffect data fetching and React Query / SWR in a CSR context?
11When would you choose CSR over SSR or SSG in a production Next.js app? Give real-world examples.
12How does React's concurrent rendering model affect CSR behaviour in Next.js 13+?
13How do you handle deeply nested Client Components without causing unnecessary re-renders?
14Explain the concept of "client component boundaries" — how do they affect the component tree?
15How would you implement optimistic UI updates in a CSR-heavy Next.js application?
16What are the challenges of using Context API at scale in a CSR and SSR? How do you solve them?
17How does next/dynamic work? How is it different from React's lazy() and Suspense?
18What is the "flash of unstyled/unloaded content" problem in CSR, and how do you prevent it?
19How do you prefetch data for CSR pages in Next.js to reduce perceived latency?
20How do useMemo and useCallback help performance in CSR components? When are they overkill?
21How do you implement skeleton screens or loading states for CSR data fetching?
22Compare SWR vs React Query vs useEffect for client-side data fetching — when do you use each?
23How do you implement infinite scrolling or pagination purely on the client side in Next.js?
24How do you handle race conditions in CSR data fetching with useEffect?
25What is the difference between client-side fetch and server actions in Next.js App Router?
26How do you cancel in-flight API requests when a component unmounts in CSR?
27How would you handle real-time data (WebSockets / SSE) in a Next.js CSR component?
04 / 27

How to decide what part should be rendered on the server and what on the client?

Difficulty: 5/10
SSR vs CSR, performance tradeoffs, data fetching
  1. 1

    Fetch data on the Server Component

  2. 2

    Access backend resources (directly) on the Server Component

  3. 3

    Keep the sensitive information on the server (access tokens, API keys, etc) on the Server Component

  4. 4

    Keep large dependencies on the server / Reduce client-side JavaScript on Server Component

  5. 5

    Add interactivity and event listeners (onClick(), onChange(), etc) on Client Component

  6. 6

    Use State and Lifecycle Effects (useState(), useReducer(), useEffect(), etc) on Client Component

  7. 7

    Use browser-only APIs on Client Component

  8. 8

    Use custom hooks that depend on state, effects, or browser-only APIs on Client Component

  9. 9

    Use React Class components on Client Component

Scenario Questions

0-2 years experience

  1. 1You have a simple blog page that fetches posts from an external API. How would you decide whether to use getStaticProps, getServerSideProps, or client‑side fetching in Next.js, and what steps would you take to implement it?
  2. 2If you add a dynamic comment widget that should only load after the user scrolls to the bottom, how would you ensure it renders on the client only?
  3. 3What happens if you mistakenly import a client‑only component inside getStaticProps, and how would you debug the resulting error?

2-5 years experience

  1. 1Your team is building a product catalog with filters that depend on user selections. The initial list needs SEO, but filters must update instantly. Walk me through how you’d split server‑rendered and client‑rendered parts and the trade‑offs you’d consider.
  2. 2During a rollout, a page that previously used getStaticProps now shows a blank page after adding a heavy third‑party chart. How would you investigate whether the rendering strategy caused the issue?
  3. 3Explain why moving a component from server‑side rendering to client‑side caused a noticeable increase in Time to First Byte (TTFB). What would you change to mitigate it?

5-8 years experience

  1. 1Design a strategy for a large e‑commerce site where personalized recommendations must be client‑only but product listings need SEO. Discuss data fetching, caching, and how you’d orchestrate hydration to avoid content mismatch.
  2. 2Your application shows a hydration mismatch warning on a page mixing server‑rendered product listings with a client‑only interactive map. How would you refactor to eliminate the mismatch while keeping performance optimal?
  3. 3In a Next.js monorepo shared across multiple teams with differing SEO requirements, how would you establish guidelines for deciding SSR vs CSR at the component level, and what tooling would you introduce to enforce consistency?

8+ years experience

  1. 1Your company is migrating a legacy React SPA to Next.js. Leadership wants maximum SEO benefits with minimal rewrite effort. Outline an architecture plan for progressively moving routes to server‑rendered, including handling of shared state, authentication, and incremental adoption.
  2. 2Across the organization, teams are debating whether to standardize on static generation, server‑side rendering, or client‑side rendering for new features. As a staff engineer, how would you create a decision framework that balances performance, developer velocity, and operational cost, and how would you communicate it?
  3. 3A new regulation requires that certain user data never be sent to the client unless the user explicitly consents. How would you redesign the rendering pipeline in Next.js to enforce this at scale, considering both existing pages and future development?

Follow-up Questions

  • What metrics would you monitor to confirm your rendering choice is effective?
  • How would you handle a scenario where network latency spikes after deployment?
  • Which trade‑offs become most important when traffic scales dramatically?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.