Questions
9 of 33
1Explain server-side rendering (SSR) in Next.js.
2List the benefits of Server-Side Rendering in Next.js.
3What are server components?
4How to use server components in next js?
5What is the React Server Component Payload (RSC)?
6Describe how server components are rendered.
7Describe server rendering strategies
8How can you keep Server-only Code out of the Client Environment
9What are the issues of using context provider at the root of the application?
10List dynamic functions available to server components.
11List all Dynamic APIs.
12How do we opt for Static Rendering, Dynamic Rendering and Streaming?
13Explain the difference between SSR, SSG, ISR, and CSR in Next.js. When would you choose each?
14How does getServerSideProps work internally? What is its execution context?
15What are the performance trade-offs of SSR vs SSG in a high-traffic production app?
16How does Next.js handle hydration? What is a hydration mismatch, and how do you debug it?
17What happens when getServerSideProps throws an error? How do you handle it gracefully?
18How would you architect a Next.js app that needs both personalised (SSR) and cacheable (SSG) pages at scale?
19Explain the App Router vs Pages Router SSR model differences. How does React Server Components change the SSR paradigm?
20How do React Server Components (RSC) differ from traditional SSR? Can they be used together?
21How does streaming SSR work in Next.js 13+? What role does Suspense play?
22How would you implement partial hydration or Islands Architecture in Next.js?
23Explain how Next.js handles data fetching waterfall problems in SSR and how you'd mitigate them.
24How would you implement partial hydration or Islands Architecture in Next.js?
25How do you implement caching strategies for SSR responses in Next.js? (CDN, Cache-Control, stale-while-revalidate)
26How would you reduce TTFB (Time to First Byte) in an SSR-heavy Next.js app?
27What's the difference between fetch caching in the App Router vs traditional getServerSideProps?
28How do you avoid redundant database/API calls across multiple server components on the same page?
29How do you securely handle authentication in SSR? What are the risks of passing tokens via cookies vs headers?
30How do you prevent sensitive server-side data from leaking to the client bundle?
31How would you implement role-based rendering on the server without exposing protected routes to the client?
32How do you debug SSR-only issues that don't appear in local development?
33How can we control dynamic rendering behaviour in next js?
09 / 33

What are the issues of using context provider at the root of the application?

Context providers are typically rendered near the root of an application to share global concerns, like the current theme. Since React context is not supported in Server Components, trying to create a context at the root of your application will cause an error. To fix this, create your context and render its provider inside of a Client Component.

Difficulty: 5/10
Topics: React Context, Next.js rendering, Performance

Scenario Questions

0-2 years experience
  1. 1

    If you wrap your entire Next.js app in a Context Provider in _app.js, what happens when you navigate to a page that uses server‑side rendering?

  2. 2

    How would you fetch data inside a root context and what pitfalls might you run into on the first page load?

  3. 3

    What effect does placing a global provider at the top have on the initial JavaScript bundle size?

2-5 years experience
  1. 1

    You added a global auth context at the root, but after a client‑side navigation some pages still show the previous user. How would you debug and fix it?

  2. 2

    Explain why a root context can cause unrelated components to re‑render on every state change, and suggest a way to limit that in a Next.js app.

  3. 3

    We need per‑page theme overrides while keeping a global theme context. How would you structure the providers to avoid conflicts?

5-8 years experience
  1. 1

    Design a strategy for using Context in a large Next.js codebase where some routes are statically generated and others are server‑side rendered, keeping performance impact low.

  2. 2

    What are the trade‑offs of putting a provider at the root versus using route‑level providers in terms of hydration, memory usage, and code‑splitting?

  3. 3

    If the root context holds a large mutable store, how would you prevent full‑tree re‑renders on every update in a high‑traffic site?

8+ years experience
  1. 1

    Your team is migrating a legacy Next.js app that uses a root‑level feature‑flag context to a micro‑frontend architecture. How would you refactor the context to support independent deployment while preserving type safety?

  2. 2

    Discuss the long‑term maintenance risks of many teams depending on a single root context and propose governance or modularization patterns to reduce coupling.

Follow-up Questions

  • What specific symptom would tell you the context is causing a performance regression?
  • How would you measure the impact of a root provider on page load time?
  • Can you describe a case where moving the provider solved a bug you encountered?