React Server Components Questions with Answers

13 practice questions on React Server Components (Modern Web (Next.js, PWA, Performance)) with answers and step-by-step solutions. Try 10 samples below, then practise all 13 free in the AptiNest app.

Sample questions

Question 1Easy

Where do React Server Components (RSC) execute?

  1. On both server and client, rendering twice
  2. Inside a service worker in the browser
  3. Only on the server
  4. Only in the browser after hydration completes

Answer: C. Only on the server

Explanation

Server Components run only on the server; their code is not shipped to the browser, only their rendered output.

Step-by-step solution

  1. React Server Components are rendered on the server.
  2. Their code is not shipped to the browser; only their output is sent.
  3. So Server Components execute only on the server (option C).

Why the other options are wrong

  • A. They do not render twice on both sides.
  • B. A service worker is not where Server Components run.
  • D. They do not run in the browser after hydration.

Tip: Server Components can read data and files directly because they never run in the browser.

Question 2Easy

Which of these can a Server Component do that a Client Component cannot?

  1. Read window.innerWidth
  2. Query a database directly
  3. Use the useEffect hook
  4. Handle an onClick event

Answer: B. Query a database directly

Explanation

Server Components run on the server with access to server resources; events, effects and browser APIs need Client Components.

Step-by-step solution

  1. Server Components run on the server.
  2. They can use server-only resources such as a database.
  3. Client Components handle events, effects and browser APIs.
  4. So the correct answer is querying a database directly.

Why the other options are wrong

  • A. Window only exists in the browser, so Server Components cannot read it.
  • C. UseEffect is a client-side hook.
  • D. Event handlers such as onClick need Client Components.

Tip: Server Components fetch data directly; Client Components handle interaction.

Question 3Easy

What directive at the top of a file marks it as a Client Component boundary?

  1. "use client"
  2. "use server"
  3. "client only"
  4. "use strict"

Answer: A. "use client"

Explanation

The "use client" directive marks the module (and what it imports) as client code that is sent to the browser and hydrated.

Step-by-step solution

  1. "use client" at the top marks a Client Component boundary.
  2. It and its imports are bundled for the browser.
  3. Server Components are the default.

Why the other options are wrong

  • B. That marks server functions.
  • C. Not a directive.
  • D. That enables strict mode.

Tip: use client = browser boundary.

Question 4Easy

A key benefit of Server Components for bundle size is that:

  1. They compress the client bundle with a better minifier
  2. Their code and server-only libraries never reach the browser
  3. They load all dependencies lazily after the page becomes idle
  4. They replace JavaScript bundles with WebAssembly modules

Answer: B. Their code and server-only libraries never reach the browser

Explanation

Heavy libraries used only for rendering on the server (e.g. a markdown parser) stay on the server, so the client downloads less JS.

Step-by-step solution

  1. Server Components run only on the server.
  2. Libraries they use for rendering stay on the server and are not sent to the browser.
  3. So the client downloads less JavaScript (option B).

Why the other options are wrong

  • A. Compression of the client bundle is a different step and not the benefit of Server Components.
  • C. Lazy loading after idle is a separate technique.
  • D. Server Components do not replace JavaScript with WebAssembly.

Tip: Keep heavy rendering-only libraries in Server Components so they stay out of the bundle.

Question 5Medium

What is the "use server" directive used for?

  1. Declaring that a file must never be imported by a Client Component
  2. Turning on server-side rendering for the whole application
  3. Marking async functions the client can call on the server
  4. Forcing a component to render on the server instead of the client

Answer: C. Marking async functions the client can call on the server

Explanation

"use server" marks async functions callable from the client (e.g. form actions); it is not how you declare a Server Component, which is the default.

Step-by-step solution

  1. "use server" marks Server Functions, async functions run on the server.
  2. Client code can call them like normal functions.
  3. It does not mean "render on the server".

Why the other options are wrong

  • A. That describes "server-only".
  • B. It does not toggle SSR.
  • D. Server rendering is the default for Server Components.

Tip: use client = boundary; use server = callable actions.

Question 6Medium

How are Server Components different from traditional SSR?

  1. They are the same thing; RSC is just a new name for SSR
  2. They run only at build time and cannot use request data
  3. Their output never hydrates; only Client Components ship JS and hydrate
  4. They render HTML on the server and then re-render all of it in the browser

Answer: C. Their output never hydrates; only Client Components ship JS and hydrate

Explanation

SSR produces HTML for the whole tree and then hydrates everything. RSC output is a serialized tree; only Client Component parts get JS and hydrate. The two are often combined.

Step-by-step solution

  1. Traditional SSR renders HTML on the server and then hydrates the whole tree.
  2. Server Component output is a serialized tree, and it is not hydrated.
  3. Only Client Components ship JavaScript and hydrate, so option C is correct.

Why the other options are wrong

  • A. RSC is a different model; it is not just a new name for SSR.
  • B. Server Components can use request data; they run on each request, not only at build time.
  • D. Server Component output is not rendered again on the client as full HTML.

Tip: Server Components cut JavaScript cost, while SSR is often used with them.

Question 7Medium

Can a Client Component render a Server Component?

  1. Yes, if it is passed in as children or another prop
  2. No, Server Components can only be rendered at the root of the tree
  3. Yes, by importing the Server Component directly into the client file
  4. No, Client and Server Components can never appear on the same page

Answer: A. Yes, if it is passed in as children or another prop

Explanation

Importing a module into a client file makes it client code. The pattern is to pass the server-rendered element as children from a Server Component parent.

Step-by-step solution

  1. Importing a Server Component into a client file would turn it into client code.
  2. Instead, the Server Component is passed in as children or another prop.
  3. So a Client Component can render a Server Component that is passed to it (option A).

Why the other options are wrong

  • B. Server Components can appear below the root.
  • C. A direct import makes the component client code, not a server one.
  • D. Client and Server Components can appear on the same page.

Tip: Pass Server Components into Client Components as children to keep them on the server.

Question 8Medium

Why can a Server Component be declared as an async function?

  1. Making a component async automatically turns it into a Client Component
  2. It renders on the server, so it can await data before returning JSX
  3. React waits for async components on the client using useEffect
  4. async components render faster in the browser after hydration

Answer: B. It renders on the server, so it can await data before returning JSX

Explanation

Server Components can await fetches or database queries directly while rendering, removing the need for client-side data-fetching effects.

Step-by-step solution

  1. A Server Component renders on the server before its HTML is sent.
  2. An async function can await data, such as a fetch or database query, before returning JSX.
  3. So it can wait for data directly (option B).

Why the other options are wrong

  • A. Being async does not change the component type.
  • C. React does not use useEffect to wait for async server components.
  • D. Async components do their work on the server, not in the browser.

Tip: Async Server Components remove the need for data-fetching effects on the client.

Question 9Hard

Why is Suspense useful together with async Server Components?

  1. It shows a fallback for a slow part while the rest streams in
  2. It stops the server from rendering any component that fetches data
  3. It caches the data so that the server never needs to fetch it again
  4. It converts the slow subtree into a Client Component automatically

Answer: A. It shows a fallback for a slow part while the rest streams in

Explanation

Wrapping a slow async component in Suspense lets the server stream the rest of the page with a fallback, then stream the subtree when its data resolves.

Step-by-step solution

  1. A slow async Server Component can be wrapped in Suspense.
  2. The server streams the rest of the page first, showing the fallback in place of the slow part.
  3. When the slow data resolves, its subtree is streamed in (option A).

Why the other options are wrong

  • B. Suspense does not stop rendering; it shows a fallback while waiting.
  • C. Caching is a separate concern; Suspense is about showing a fallback.
  • D. Suspense does not change a component into a Client Component.

Tip: Wrap slow async parts in Suspense so the rest of the page is not held back.

Question 10Hard

What does the client actually receive for a Server Component subtree on navigation?

  1. Only a list of CSS class names that the client uses to rebuild the UI
  2. A serialized description of the rendered tree, not its code
  3. The original component source code, which the browser then executes
  4. A WebAssembly module compiled from the component at build time

Answer: B. A serialized description of the rendered tree, not its code

Explanation

The server streams a compact payload describing the rendered elements plus references to Client Components; React on the client merges it into the existing tree.

Step-by-step solution

  1. On navigation the server streams a compact payload.
  2. The payload describes the rendered elements and references the Client Components.
  3. The client merges that description into the existing tree, so it does not receive the component code (option B).

Why the other options are wrong

  • A. The payload describes rendered elements, not CSS class lists.
  • C. The component source is not sent to the browser.
  • D. No WebAssembly module is produced for Server Components.

Tip: Server Component code never reaches the browser; only its rendered description does.

Practise all 13 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Modern Web (Next.js, PWA, Performance) topics · All topics