Sample questions
Question 1Easy
What does server-side rendering (SSR) do on each request?
- Serves a file that was generated once during the build step
- Compiles the JavaScript bundle again for every new visitor
- Renders fresh HTML on the server for that request
- Sends a blank page and lets the browser fetch all data later
Answer: C. Renders fresh HTML on the server for that request
Explanation
SSR renders the HTML on the server per request, so the response already contains content and can use request-specific data.
Step-by-step solution
- Server-side rendering runs on the server for each incoming request.
- It produces fresh HTML for that request.
- So SSR renders new HTML on the server per request (option C).
Why the other options are wrong
- A. A file generated once at build time is SSG.
- B. The bundle is not recompiled per visitor; the HTML is rendered per request.
- D. Sending a blank page and fetching data later is CSR.
Tip: SSR gives request-specific HTML, at the cost of server work per request.
Question 2Easy
What is hydration in frameworks such as React?
- Compressing static assets so they download faster over the network
- Filling a CDN cache with pages before the first user visits
- Fetching JSON from an API and converting it into a JavaScript object
- Attaching event handlers and state to server-rendered HTML
Answer: D. Attaching event handlers and state to server-rendered HTML
Explanation
Hydration makes the static HTML interactive: React runs on the client, matches the existing DOM and wires up listeners and state.
Step-by-step solution
- The server sends static HTML first.
- On the client, the framework runs and matches the existing DOM.
- It then attaches event handlers and state to that HTML, making it interactive.
Why the other options are wrong
- A. Compression is a transfer optimisation, not hydration.
- B. Filling a CDN cache is caching, not hydration.
- C. Fetching JSON is data loading, not hydration.
Tip: Hydration makes server-rendered HTML interactive without rebuilding it.
Question 3Easy
Which rendering strategy generates HTML for a page once at build time and serves the same file to every visitor?
- Client-side rendering (CSR)
- Static site generation (SSG)
- Streaming server-side rendering
- Server-side rendering (SSR)
Answer: B. Static site generation (SSG)
Explanation
SSG pre-renders pages during the build, so requests are served as plain static files, often from a CDN.
Step-by-step solution
- Static site generation renders each page during the build.
- The resulting files are the same for every visitor.
- So the strategy is static site generation (option B).
Why the other options are wrong
- A. CSR builds the page in the browser at each visit, not once at build time.
- C. Streaming SSR renders on the server per request.
- D. SSR renders on the server for each request, not at build time.
Tip: SSG fits pages whose content changes only at deploy time.
Question 4Easy
Which strategy is generally the best fit for a marketing page whose content changes only when the site is redeployed?
- Static site generation
- Polling the server every few seconds
- Client-side rendering with an API call
- Server-side rendering on every request
Answer: A. Static site generation
Explanation
Content that changes only at deploy time can be built once and served from a CDN, which is the fastest and cheapest option.
Step-by-step solution
- The content changes only when the site is redeployed.
- So the pages can be built once in advance.
- Static files can then be served from a CDN, which is fast and cheap.
Why the other options are wrong
- B. Polling is unnecessary when content only changes on deploy.
- C. CSR with an API call adds work on each visit for content that is fixed.
- D. SSR per request does server work for content that never changes between deploys.
Tip: Choose SSG when content changes only at deploy time.
Question 5Medium
Which code is most likely to cause a hydration mismatch if used directly while rendering a server-rendered component?
- A constant string such as
"Welcome" new Date().toLocaleTimeString()- A map over a fixed array of labels
props.title passed from the parent
Answer: B. new Date().toLocaleTimeString()
Explanation
The time differs between server render and client hydration, so the text nodes will not match.
Step-by-step solution
- The server renders the time at the moment of the server request.
- The client renders the time again when hydrating, at a different moment.
- The two text nodes differ, so the hydration check fails (option B).
Why the other options are wrong
- A. A constant string renders the same on server and client.
- C. A map over a fixed array renders the same markup on both sides.
- D. props.title is the same value on server and client, so it does not differ.
Tip: Move time-based or random output into an effect so it runs only on the client.
Question 6Medium
Under ISR with a 60-second revalidation window, a request arrives 90 seconds after the page was generated. What typically happens?
- The page is permanently switched to client-side rendering
- The user waits while the page is rebuilt, then gets the fresh version
- The request fails with an error until the next full site deployment
- The stale page is served and rebuilt in the background
Answer: D. The stale page is served and rebuilt in the background
Explanation
ISR follows a stale-while-revalidate model: the visitor gets the cached page immediately and later visitors see the regenerated one.
Step-by-step solution
- After 60 s the page is stale.
- The next request gets the stale page.
- A rebuild happens in the background.
Why the other options are wrong
- A. It stays static.
- B. Users do not wait.
- C. No error occurs.
Tip: ISR serves stale, rebuilds quietly.
Question 7Medium
What is the main benefit of streaming SSR?
- The browser downloads the JavaScript bundle before any HTML arrives
- The server sends the whole page only after every query has finished
- HTML is sent in chunks, so parts appear before all data is ready
- Pages are cached on the user device so the server is never called
Answer: C. HTML is sent in chunks, so parts appear before all data is ready
Explanation
Streaming flushes ready parts of the HTML early (with placeholders for slower parts), improving time to first byte and first paint.
Step-by-step solution
- Streaming SSR sends the HTML in chunks as they become ready.
- Parts of the page appear before slower data is ready, using placeholders.
- So the benefit is that parts of the HTML arrive before all data is ready (option C).
Why the other options are wrong
- A. Streaming is about HTML chunks, not the order of the JavaScript bundle.
- B. Waiting for every query is the opposite of streaming.
- D. Device caching is a separate concern, not what streaming does.
Tip: Streaming improves time to first byte and first paint for slow data.
Question 8Medium
What does incremental static regeneration (ISR) add to plain static generation?
- Pages are rendered only in the browser after the first visit completes
- Every page is rendered on the server for each request without caching
- Static pages are rebuilt in the background after a set period
- Static pages are converted into a single-page app at runtime
Answer: C. Static pages are rebuilt in the background after a set period
Explanation
ISR serves a cached static page and regenerates it in the background once it is older than the configured interval (or on demand), so content updates without a full rebuild.
Step-by-step solution
- Plain static generation builds all pages once and does not change them afterwards.
- ISR serves a cached page and rebuilds it in the background after a set interval.
- So ISR adds background rebuilds of static pages after a period (option C).
Why the other options are wrong
- A. ISR still serves static pages; it is not CSR.
- B. ISR serves cached static pages and does not render each request.
- D. ISR keeps pages static; it does not turn them into a single-page app.
Tip: ISR updates static pages without a full rebuild of the whole site.
Question 9Hard
In the "islands architecture", how is a mostly static page made interactive?
- Only interactive widgets are hydrated; the rest stays static
- The whole page is hydrated as one React tree after the bundle loads
- Interactivity is added with CSS only, so no JavaScript is shipped at all
- Every element is re-rendered on the client and the server HTML is dropped
Answer: A. Only interactive widgets are hydrated; the rest stays static
Explanation
Islands ship JavaScript only for the interactive widgets, leaving the surrounding static HTML unhydrated, which cuts JS cost.
Step-by-step solution
- Islands architecture starts from a mostly static HTML page.
- Only the interactive widgets, the islands, get JavaScript and are hydrated.
- The surrounding static HTML is left as it is, which cuts the JavaScript cost.
- So only interactive widgets are hydrated and the rest stays static (option A).
Why the other options are wrong
- B. Hydrating the whole page as one tree is the usual SPA or SSR approach, not islands.
- C. Islands still ship JavaScript for their interactive widgets.
- D. Islands keep the server HTML; they do not re-render every element.
Tip: Islands keep JavaScript small by hydrating only the widgets that need interactivity.
Question 10Hard
A product page shows price and stock that must be accurate per user and per request, plus a static description. Which approach fits best?
- Generate the whole page at build time and never revalidate it
- Render on the server per request, caching only the static parts
- Pre-render the page once and store it in localStorage for reuse
- Use ISR with a one-day revalidation window for the entire page
Answer: B. Render on the server per request, caching only the static parts
Explanation
Per-request, user-specific data requires dynamic rendering; static parts can still be cached separately so the page stays fast.
Step-by-step solution
- Price and stock must be accurate for each user and each request.
- That data is dynamic, so the page must be rendered on the server per request.
- The static description can still be cached separately to keep the page fast.
- So render per request and cache only the static parts (option B).
Why the other options are wrong
- A. Build-time pages cannot show accurate per-request, per-user data.
- C. LocalStorage is on the device and is not a server-side cache for accurate stock.
- D. ISR with a daily window would show stock that can be up to a day old.
Tip: Match the rendering method to how often the data changes and whether it depends on the user.
Practise all 15 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 →