A.HTML is generated on the server for each request
B.HTML is generated once during development
C.HTML is stored only in a database
D.HTML is generated only in the browser
Correct Answer: HTML is generated on the server for each request
Explanation:
SSR creates the initial HTML on the server before sending it to the browser.
Incorrect! Try again.
2What is the main characteristic of Static Site Generation (SSG)?
Static Site Generation (SSG)
Easy
A.Pages are generated only by the browser
B.Pages are generated from live data per request
C.Pages are generated after every user click
D.Pages are generated during the build process
Correct Answer: Pages are generated during the build process
Explanation:
SSG creates pages ahead of time, usually when the application is built.
Incorrect! Try again.
3What does Incremental Static Regeneration (ISR) allow a website to do?
Incremental Static Regeneration (ISR)
Easy
A.Render every page only in the browser
B.Update static pages after deployment
C.Remove all static pages after deployment
D.Prevent pages from ever changing
Correct Answer: Update static pages after deployment
Explanation:
ISR allows selected static pages to be regenerated periodically without rebuilding the entire site.
Incorrect! Try again.
4Where is most of the page content generated in Client-side Rendering?
Client-side Rendering
Easy
A.In the database server
B.In the build system
C.In the web server only
D.In the user's browser
Correct Answer: In the user's browser
Explanation:
Client-side rendering uses JavaScript in the browser to create or update the page content.
Incorrect! Try again.
5Which rendering strategy is generally suitable for content that changes rarely?
Rendering Strategy Selection
Easy
A.Repeated server polling
B.Client-side Rendering
C.Server-side Rendering
D.Static Site Generation
Correct Answer: Static Site Generation
Explanation:
SSG is a good choice for content that is stable because pages can be created during the build.
Incorrect! Try again.
6Which factor is important when selecting a rendering strategy?
Rendering Strategy Selection
Easy
A.The operating system of the database
B.The number of developer comments
C.How often the data changes
D.The color of the page background
Correct Answer: How often the data changes
Explanation:
Data freshness requirements help determine whether SSR, SSG, ISR, or client-side rendering is appropriate.
Incorrect! Try again.
7Where do Server Components primarily render?
Server Components
Easy
A.On the server
B.Only inside the browser
C.Inside the user's database
D.Only during CSS processing
Correct Answer: On the server
Explanation:
Server Components run and render on the server, reducing the amount of JavaScript sent to the browser.
Incorrect! Try again.
8Which feature commonly requires a Client Component?
Client Components
Easy
A.Generating a build manifest
B.Handling a button click
C.Reading a static stylesheet
D.Creating a server log
Correct Answer: Handling a button click
Explanation:
Client Components can use browser interactions, event handlers, and other client-side features.
Incorrect! Try again.
9What is one benefit of using Server Components?
Server Components
Easy
A.No need for HTML responses
B.More database access from the browser
C.Less JavaScript sent to the browser
D.Automatic removal of all server code
Correct Answer: Less JavaScript sent to the browser
Explanation:
Server Components can keep rendering logic on the server, which can reduce the client-side JavaScript bundle.
Incorrect! Try again.
10Client Components are mainly used for which purpose?
Client Components
Easy
A.Database table creation
B.Static file compression only
C.Interactive user interface behavior
D.Server hardware configuration
Correct Answer: Interactive user interface behavior
Explanation:
Client Components support interactive features such as state, event handlers, and browser APIs.
Incorrect! Try again.
11What is the Fetch API commonly used for?
Fetch API
Easy
A.Creating database indexes
B.Compiling JavaScript files
C.Styling HTML elements
D.Making network requests
Correct Answer: Making network requests
Explanation:
The Fetch API allows an application to request resources such as data from a server.
Incorrect! Try again.
12What does a successful HTTP response usually provide when using the Fetch API?
Fetch API
Easy
A.A Response object
B.A CSS selector
C.A database schema
D.A browser extension
Correct Answer: A Response object
Explanation:
The Fetch API returns a Promise that resolves to a Response object representing the server's response.
Incorrect! Try again.
13Which method is commonly used to read JSON from a Fetch API response?
Fetch API
Easy
A.response.render()
B.response.style()
C.response.sql()
D.response.json()
Correct Answer: response.json()
Explanation:
The json() method parses the response body as JSON and returns a Promise.
Incorrect! Try again.
14When does client-side fetching usually occur?
Client-side Fetching
Easy
A.Before the server receives a request
B.Only during database installation
C.Before the application is written
D.After JavaScript runs in the browser
Correct Answer: After JavaScript runs in the browser
Explanation:
Client-side fetching happens in the browser, often after the initial page has loaded.
Incorrect! Try again.
15Which is a common advantage of client-side fetching?
Client-side Fetching
Easy
A.It always improves the first page load
B.It removes the need for an internet connection
C.It can update data without a full page reload
D.It prevents all network requests
Correct Answer: It can update data without a full page reload
Explanation:
Client-side fetching can retrieve new data and update part of a page without navigating away or reloading the whole document.
Incorrect! Try again.
16Where does server-side data fetching take place?
Server-side Data Fetching
Easy
A.During the user's keyboard input
B.On the server before the response is sent
C.Inside the browser's CSS engine
D.Only after the user closes the page
Correct Answer: On the server before the response is sent
Explanation:
Server-side data fetching retrieves data on the server before generating or sending the page response.
Incorrect! Try again.
17What is one benefit of fetching sensitive data on the server?
Server-side Data Fetching
Easy
A.The browser receives every database password
B.Server credentials can remain private
C.The user can bypass server authorization
D.The database no longer needs authentication
Correct Answer: Server credentials can remain private
Explanation:
Fetching sensitive data on the server helps prevent private credentials from being exposed to users.
Incorrect! Try again.
18What is caching?
Caching and Revalidation
Easy
A.Storing data for possible reuse
B.Converting HTML into a database
C.Deleting data after every request
D.Blocking all repeated requests
Correct Answer: Storing data for possible reuse
Explanation:
Caching stores a previously obtained result so it can be reused, often improving performance.
Incorrect! Try again.
19What does revalidation usually mean?
Caching and Revalidation
Easy
A.Checking whether cached data is still current
B.Removing the application source code
C.Changing a user's password automatically
D.Converting a server into a browser
Correct Answer: Checking whether cached data is still current
Explanation:
Revalidation checks or refreshes cached content so that users can receive updated data.
Incorrect! Try again.
20What is a possible result of using a long cache duration?
Caching and Revalidation
Easy
A.Automatic deletion of all page content
B.Slower responses with no stored data
C.More database writes on every request
D.Faster responses with older data
Correct Answer: Faster responses with older data
Explanation:
A long cache duration can improve response speed, but the cached data may be less recent.
Incorrect! Try again.
21An e-commerce product page must display current inventory in its initial HTML and remain discoverable by search engines. Which rendering strategy best fits these requirements?
Server-Side Rendering (SSR)
Medium
A.Render the page on the server for each request
B.Render an empty shell and fetch inventory in the browser
C.Store the complete page only in browser storage
D.Generate the page once during the application build
Correct Answer: Render the page on the server for each request
Explanation:
SSR produces request-time HTML containing the latest inventory, while also giving search engines immediately available page content.
Incorrect! Try again.
22A server-rendered dashboard reads a user identifier from an authenticated request before loading account data. What is the main consequence for caching the complete HTML response?
Server-Side Rendering (SSR)
Medium
A.The response should be cached separately by user
B.The response can be shared publicly across all users
C.The response becomes static after its first request
D.The response no longer requires authorization checks
Correct Answer: The response should be cached separately by user
Explanation:
Because the HTML contains user-specific data, a shared public cache could expose one user's content to another user.
Incorrect! Try again.
23A documentation website changes only when a new software version is released. Which approach generally provides the lowest request-time server workload?
Static Site Generation (SSG)
Medium
A.Generate all documentation pages during the build
B.Fetch every document after the browser loads
C.Render every documentation page for each request
D.Regenerate every document on a fixed short interval
Correct Answer: Generate all documentation pages during the build
Explanation:
SSG creates the HTML ahead of time, allowing the pages to be served directly without request-time rendering.
Incorrect! Try again.
24A statically generated catalog contains 100,000 product pages, and every build is becoming too slow. Which change most directly reduces build-time generation work?
Static Site Generation (SSG)
Medium
A.Prebuild every product with a shorter cache duration
B.Request every product twice during the same build
C.Hydrate every product page with additional client code
D.Prebuild popular products and generate others on demand
Correct Answer: Prebuild popular products and generate others on demand
Explanation:
Generating only high-traffic pages at build time avoids processing the entire catalog while still permitting less common pages to be created later.
Incorrect! Try again.
25A news article page uses ISR with a revalidation interval of 300 seconds. An editor publishes a correction 100 seconds after the latest generation. What should readers generally expect?
Incremental Static Regeneration (ISR)
Medium
A.The old page may remain until revalidation occurs
B.The correction appears instantly without regeneration
C.The browser rewrites the stored HTML automatically
D.The page returns an error until the next full build
Correct Answer: The old page may remain until revalidation occurs
Explanation:
ISR can serve the existing static page until it becomes eligible for revalidation and a refreshed version is generated.
Incorrect! Try again.
26A product page uses time-based ISR, but an urgent price update must appear as soon as the pricing system changes. Which addition best addresses this requirement?
Incremental Static Regeneration (ISR)
Medium
A.Store the new price only in local browser storage
B.Trigger on-demand revalidation after the price update
C.Increase the time-based revalidation interval
D.Disable all server-side requests for the product
Correct Answer: Trigger on-demand revalidation after the price update
Explanation:
On-demand revalidation lets the pricing system invalidate or regenerate the affected page immediately instead of waiting for a timer.
Incorrect! Try again.
27A browser-rendered analytics page shows an empty container until a large JavaScript bundle executes and its API request completes. Which user-facing metric is most directly at risk?
Client-side Rendering
Medium
A.Time required to write source files to disk
B.Time required to issue a TLS certificate
C.Time required to resolve the server hostname
D.Time until meaningful content becomes visible
Correct Answer: Time until meaningful content becomes visible
Explanation:
With client-side rendering, meaningful content may be delayed by JavaScript download, execution, and data fetching.
Incorrect! Try again.
28A team is building an authenticated drawing tool with frequent pointer events, local state changes, and little need for search indexing. Why is client-side rendering suitable for its main workspace?
Client-side Rendering
Medium
A.It guarantees that JavaScript is unnecessary in the browser
B.It allows private API credentials to be embedded in code
C.It generates every user drawing during the deployment build
D.It supports rich interactions without full-page navigation
Correct Answer: It supports rich interactions without full-page navigation
Explanation:
Client-side rendering is well suited to highly interactive interfaces that update local UI state frequently without reloading entire pages.
Incorrect! Try again.
29A site has public marketing pages, frequently updated product prices, and a private interactive account area. Which combination is the most appropriate starting point?
Rendering Strategy Selection
Medium
A.ISR for marketing, browser storage for prices, and SSR without scripts for accounts
B.Client rendering for marketing, SSG for products, and SSG for accounts
C.SSG for marketing, SSR or ISR for products, and client rendering for accounts
D.SSR for marketing, SSG for prices, and build-time rendering for accounts
Correct Answer: SSG for marketing, SSR or ISR for products, and client rendering for accounts
Explanation:
Stable public content benefits from SSG, changing product data can use SSR or ISR, and interactive private workflows commonly rely on client rendering.
Incorrect! Try again.
30A public transit page must show live arrival times, but its route descriptions change only monthly. Which design best balances freshness and performance?
Rendering Strategy Selection
Medium
A.Rebuild the entire application whenever a vehicle moves
B.Fetch descriptions repeatedly but embed fixed arrival times
C.Statically render both descriptions and arrival times monthly
D.Statically render descriptions and fetch arrivals dynamically
Correct Answer: Statically render descriptions and fetch arrivals dynamically
Explanation:
The stable route content can be generated ahead of time, while live arrival data should be fetched at request time or in the browser.
Incorrect! Try again.
31A component reads records directly from a database and renders a non-interactive table. What is a key benefit of implementing it as a Server Component?
Server Components
Medium
A.The database connection becomes available to every visitor
C.The component can use browser local storage during rendering
D.Database access code stays out of the browser bundle
Correct Answer: Database access code stays out of the browser bundle
Explanation:
Server Components can access server-only resources and send rendered output without shipping database code or credentials to the browser.
Incorrect! Try again.
32A Server Component needs to include an interactive favorite button. Which component structure is most appropriate?
Server Components
Medium
A.Move the database credentials into the favorite button's props
B.Keep data rendering on the server and nest a Client Component button
C.Convert the entire page into static HTML with no JavaScript
D.Add the browser click handler directly to the Server Component
Correct Answer: Keep data rendering on the server and nest a Client Component button
Explanation:
The server can render data-heavy content while a small Client Component provides the event handler and interactive state.
Incorrect! Try again.
33A search filter uses useState, responds to input events, and reads localStorage. Why must it run as a Client Component?
Client Components
Medium
A.It depends on browser APIs and interactive state
B.It must generate all search pages during the build
C.It needs direct access to private database credentials
D.It can execute only before HTML reaches the browser
Correct Answer: It depends on browser APIs and interactive state
Explanation:
State hooks, event handlers, and browser-only APIs require execution in the client environment.
Incorrect! Try again.
34A page currently marks its top-level layout as a Client Component only because one nested menu needs toggle state. What change is most likely to reduce client-side JavaScript?
Client Components
Medium
A.Move the client boundary up to the application root
B.Move the client boundary down to the menu
C.Fetch the entire layout again after every toggle
D.Duplicate the menu state in every server component
Correct Answer: Move the client boundary down to the menu
Explanation:
Keeping the interactive boundary close to the menu allows the surrounding layout to remain server-rendered and avoids shipping unnecessary component code.
Incorrect! Try again.
35The code fetch('/api/orders').then(response => response.json()) attempts to parse an HTTP 404 response as normal data. Which check should be added before parsing?
Fetch API
Medium
A.Check response.ok and handle a false value
B.Check response.type and require an opaque value
C.Check response.redirected and require a true value
D.Check response.bodyUsed and require a true value
Correct Answer: Check response.ok and handle a false value
Explanation:
fetch usually resolves for HTTP error statuses, so response.ok should be checked before treating the body as successful data.
Incorrect! Try again.
36A user changes a search term quickly, and an older request sometimes finishes after a newer request and overwrites the results. Which Fetch API feature best prevents this?
Fetch API
Medium
A.Convert the previous response with response.text()
B.Clone the previous response before parsing it
C.Set the previous request method to HEAD
D.Cancel the previous request with AbortController
Correct Answer: Cancel the previous request with AbortController
Explanation:
AbortController can cancel an obsolete request so its result does not replace data from the user's newer search.
Incorrect! Try again.
37A client-rendered component starts a data request inside an effect whenever productId changes. What should it do when the component unmounts or productId changes again?
Client-side Fetching
Medium
A.Reload the browser before sending another request
B.Reuse the obsolete result for every product
C.Abort or ignore the obsolete request
D.Store the unfinished response in the document title
Correct Answer: Abort or ignore the obsolete request
Explanation:
Cleaning up or ignoring stale requests prevents outdated responses from updating state after the component or selected product has changed.
Incorrect! Try again.
38A page must call an internal service using a private API key and include the result in the initial HTML. Where should the request be made?
Server-side Data Fetching
Medium
A.In local storage using a user-provided API key
B.In the browser using a bundled environment variable
C.In the HTML using a visible metadata attribute
D.On the server using a protected environment variable
Correct Answer: On the server using a protected environment variable
Explanation:
Server-side fetching can use private credentials without exposing them in browser code while still including the fetched data in the initial response.
Incorrect! Try again.
39A shared cache stores responses for /api/profile, but the endpoint returns data based on the current user's session cookie. Which cache policy is safest?
Caching and Revalidation
Medium
A.Use a private cache or disable shared caching
B.Use the same public cache key for every session
C.Share one cached response among all authenticated users
D.Cache forever and remove session validation
Correct Answer: Use a private cache or disable shared caching
Explanation:
User-specific responses must not be reused across sessions; a private cache or no shared caching prevents data leakage.
Incorrect! Try again.
40An API response includes Cache-Control: max-age=60, stale-while-revalidate=300. What behavior does this permit after the first 60 seconds?
Caching and Revalidation
Medium
A.Serve stale content temporarily while refreshing it
B.Delete the cached content and block for five minutes
C.Treat the content as permanently fresh for six minutes
D.Send every request directly to the origin without caching
Correct Answer: Serve stale content temporarily while refreshing it
Explanation:
After the fresh period ends, stale-while-revalidate permits a stale response to be served while an updated response is fetched in the background.
Incorrect! Try again.
41A news page is rendered on every request. Its HTML contains current headlines, but the browser later reports a hydration mismatch because the server and client rendered different timestamps. Which change most directly preserves SSR while preventing the mismatch?
Server-Side Rendering (SSR)
Hard
A.Render the server timestamp again from the client's current clock
B.Pass the server timestamp to the client and reuse it during hydration
C.Cache the entire server response until both clocks become synchronized
D.Remove the timestamp from HTML and obtain all headlines after hydration
Correct Answer: Pass the server timestamp to the client and reuse it during hydration
Explanation:
Hydration requires the client's initial render to match the server HTML. Reusing the serialized server timestamp provides deterministic initial output while retaining SSR.
Incorrect! Try again.
42An SSR product page performs three independent upstream requests taking ms, ms, and ms. Ignoring framework overhead, what is the best achievable data-fetching latency if all requests begin concurrently?
Server-Side Rendering (SSR)
Hard
A. ms
B. ms
C. ms
D. ms
Correct Answer: ms
Explanation:
Concurrent independent requests complete when the slowest request finishes, so latency is ms.
Incorrect! Try again.
43A documentation site has 500,000 versioned pages, but only 2% receive regular traffic. A full build has become prohibitively slow. Which design best preserves static delivery without generating every page during each deployment?
Static Site Generation (SSG)
Hard
A.Server-render all pages on every request without response caching
B.Prebuild popular pages and generate uncommon pages on first request
C.Render every page in the browser from an empty HTML shell
D.Prebuild every page and increase the deployment timeout indefinitely
Correct Answer: Prebuild popular pages and generate uncommon pages on first request
Explanation:
Prebuilding high-traffic routes and generating long-tail routes on demand retains static delivery while avoiding build work proportional to the entire page set.
Incorrect! Try again.
44A statically generated pricing page reads prices from a database only during the production build. The database changes two hours later, and no regeneration mechanism is configured. What will users receive from the existing deployment?
Static Site Generation (SSG)
Hard
A.The old prices only for users with active sessions
B.The new prices after the browser cache expires
C.The old prices until another build is deployed
D.The new prices when the CDN performs validation
Correct Answer: The old prices until another build is deployed
Explanation:
Pure SSG fixes the generated output at build time. Browser or CDN validation cannot create updated HTML unless a new build or regeneration process runs.
Incorrect! Try again.
45An ISR page has a revalidation interval of 60 seconds. A cached version is 75 seconds old when a request arrives, and the platform uses stale-while-revalidate behavior. What response pattern should be expected?
Incremental Static Regeneration (ISR)
Hard
A.The request blocks until regeneration finishes and then receives new content
B.The request receives stale content while regeneration starts in the background
C.The request receives an error until a deployment replaces the stale page
D.The request bypasses regeneration and permanently extends the cached version
Correct Answer: The request receives stale content while regeneration starts in the background
Explanation:
With stale-while-revalidate ISR, the first request after expiry can receive the stale page while regeneration updates the cache for later requests.
Incorrect! Try again.
46A regenerated ISR page depends on a database that is temporarily unavailable. The previous generated page is valid but stale. Which failure policy usually provides the strongest availability without publishing an incomplete page?
Incremental Static Regeneration (ISR)
Hard
A.Keep serving the previous page and retry regeneration later
B.Convert the page permanently to uncached client-side rendering
C.Delete the cached page and return an error to every request
D.Replace the previous page with the partial regeneration output
Correct Answer: Keep serving the previous page and retry regeneration later
Explanation:
A failed regeneration should not replace a valid cached artifact. Serving the previous version preserves availability while a later attempt can refresh it.
Incorrect! Try again.
47A client-rendered dashboard fetches /api/account after mounting. When a user signs out and another signs in within the same browser tab, the old request completes last and overwrites the new account state. Which solution addresses the underlying race?
Client-side Rendering
Hard
A.Cancel obsolete requests or ignore responses whose request identity is stale
B.Render the previous account until the next full browser navigation
C.Increase the cache lifetime so both account responses remain available
D.Move the fetch into a later timer so authentication settles beforehand
Correct Answer: Cancel obsolete requests or ignore responses whose request identity is stale
Explanation:
Request cancellation or identity checks prevent an older asynchronous result from committing after a newer request has become authoritative.
Incorrect! Try again.
48A CSR application receives a minimal HTML shell and loads a large JavaScript bundle before requesting page data. On slow mobile devices, which change most directly improves first meaningful content without abandoning CSR for later interactions?
Client-side Rendering
Hard
A.Disable HTTP compression to reduce browser decompression work
B.Store the JavaScript bundle in component state after execution
C.Embed route-critical data and prerender the initial content
D.Add more client effects that fetch the same data independently
Correct Answer: Embed route-critical data and prerender the initial content
Explanation:
Prerendering initial content and embedding its data removes the initial JavaScript-and-fetch dependency chain while allowing subsequent navigation to remain client-rendered.
Incorrect! Try again.
49A commerce application has public product descriptions updated hourly, user-specific inventory by region, and a cart that changes immediately in the browser. Which rendering composition best matches those requirements?
Rendering Strategy Selection
Hard
A.Regenerate product content, fetch regional inventory per request, and manage the cart client-side
B.Render product content, inventory, and cart entirely on every server request
C.Render an empty shell and fetch product content, inventory, and cart only after mounting
D.Build all product, inventory, and cart states statically during each hourly deployment
Correct Answer: Regenerate product content, fetch regional inventory per request, and manage the cart client-side
Explanation:
The public catalog benefits from regeneration, request-specific inventory requires dynamic server data, and the cart needs immediate client interaction.
Incorrect! Try again.
50A page must be indexed with complete content, uses request-time authorization, and displays confidential records that must never be stored in a shared cache. Which primary rendering strategy is most appropriate?
Rendering Strategy Selection
Hard
A.Uncached SSR after server-side authorization
B.Shared ISR with a short regeneration interval
C.Public SSG with authorization performed during hydration
D.CSR using an API credential embedded in the bundle
Correct Answer: Uncached SSR after server-side authorization
Explanation:
Request-time server rendering can authorize access and return complete HTML, while disabling shared caching prevents confidential output from leaking across users.
Incorrect! Try again.
51A Server Component imports a database client, reads records, and passes selected fields to a nested Client Component. Which boundary rule is essential?
Server Components
Hard
A.The Server Component must attach browser event listeners directly
B.The Client Component must execute its initial render in the database
C.The database client must also be imported by the Client Component
D.Props crossing the boundary must be serializable values
Correct Answer: Props crossing the boundary must be serializable values
Explanation:
Data sent from a Server Component to a Client Component crosses a serialization boundary. Database connections, arbitrary class instances, and server-only objects cannot be passed directly.
Incorrect! Try again.
52A component only formats fetched records into a table and has no state, effects, browser APIs, or event handlers. It currently ships a large formatting dependency to the browser. What is the strongest reason to make it a Server Component?
Server Components
Hard
A.Its formatting dependency can remain outside the client bundle
B.Its database records will become permanently cached by default
C.Its table will automatically become editable without event handlers
D.Its output will no longer require any server computation
Correct Answer: Its formatting dependency can remain outside the client bundle
Explanation:
Server Components can execute rendering dependencies on the server and send rendered results, reducing JavaScript shipped to the browser.
Incorrect! Try again.
53An interactive search Client Component receives an initial result list from a Server Component, then filters that list as the user types. Which implementation respects the component boundary while avoiding an unnecessary initial duplicate request?
Client Components
Hard
A.Import the server database module and query it directly from the browser
B.Pass serializable initial results as props and store only interactive state on the client
C.Discard the initial results and always refetch them in a mount effect
D.Pass a live database cursor as a prop and iterate over it on input
Correct Answer: Pass serializable initial results as props and store only interactive state on the client
Explanation:
Serializable server-fetched props can seed the Client Component. The browser then owns only interaction state, avoiding a redundant mount-time fetch.
Incorrect! Try again.
54A developer marks the application root as a Client Component merely because one deeply nested button uses onClick. What is the most significant architectural consequence?
Client Components
Hard
A.Server-only modules become safe to expose through browser imports
B.Every nested fetch automatically becomes private and uncached
C.All nested components become statically generated without JavaScript
D.A much larger subtree becomes part of the client JavaScript boundary
Correct Answer: A much larger subtree becomes part of the client JavaScript boundary
Explanation:
Placing the client boundary too high can pull a broad module subtree into the client bundle. The boundary should generally be close to components requiring interactivity.
Incorrect! Try again.
55A request made with fetch() receives HTTP status 404 and a valid JSON error body. No network failure occurs. Which statement describes the promise behavior?
Fetch API
Hard
A.The promise remains pending until the JSON error body is discarded
B.The promise resolves, so code must inspect response.ok or response.status
C.The promise resolves only if the request used the HEAD method
D.The promise rejects automatically because every 4xx status is an exception
Correct Answer: The promise resolves, so code must inspect response.ok or response.status
Explanation:
fetch() normally rejects for network-level failures, not ordinary HTTP error statuses. Applications must explicitly check the response status.
Incorrect! Try again.
56The same Response object's body is parsed with await response.json() and then read with await response.text(). What should the code expect under standard Fetch API body semantics?
Fetch API
Hard
A.The second read fails because the body stream has already been consumed
B.The second read returns the original JSON with normalized indentation
C.The second read starts a new HTTP request using the same response headers
D.The second read succeeds because parsed bodies are automatically rewound
Correct Answer: The second read fails because the body stream has already been consumed
Explanation:
A response body is generally a one-use stream. Use response.clone() before consumption when two independent reads are genuinely required.
Incorrect! Try again.
57A search field requests results for each query. Responses may arrive out of order, and cached results should be reused when the user returns to an earlier query. Which cache key design is necessary for correctness?
Client-side Fetching
Hard
A.A constant key shared by every query and authenticated user
B.A timestamp key based only on when the component mounted
C.A stable key containing every input that changes the result
D.A random key generated after each response has completed
Correct Answer: A stable key containing every input that changes the result
Explanation:
The key must identify the resource's full data dependency, such as query and relevant user scope. Otherwise distinct results may collide or cached data cannot be reused.
Incorrect! Try again.
58A server-rendered page fetches an internal API that merely forwards the request to a database available to the same server process. Under what condition is querying the database directly usually preferable?
Server-side Data Fetching
Hard
A.When database credentials must be serialized into the generated browser bundle
B.When the query must run again in a client effect after every hydration
C.When the API adds no required policy boundary and the direct module is server-only
D.When the API response must cross an additional network hop for consistency
Correct Answer: When the API adds no required policy boundary and the direct module is server-only
Explanation:
Direct server-side access avoids an unnecessary HTTP hop when the API provides no essential authorization, isolation, or service boundary. The database module must remain server-only.
Incorrect! Try again.
59A shared cache stores /profile responses, but the server chooses the profile from an authentication cookie. Which caching change is required to prevent one user's profile from being served to another?
Caching and Revalidation
Hard
A.Use a private cache or bypass shared caching for the personalized response
B.Increase the shared cache lifetime so each profile remains stable
C.Use one public cache key because the URL is identical for all users
D.Remove cookie variation while retaining the shared cached response
Correct Answer: Use a private cache or bypass shared caching for the personalized response
Explanation:
Cookie-dependent personalized content must not use an unpartitioned shared cache. A private cache or no shared caching prevents cross-user disclosure.
Incorrect! Try again.
60A product mutation succeeds, and the application invalidates only the cache entry for /products/42. The product also appears in /products, /featured, and a category page. Which strategy most reliably prevents stale derived views?
Caching and Revalidation
Hard
A.Invalidate the detail URL and assume list caches detect the mutation
B.Tag related cache entries by product and invalidate that tag
C.Shorten only the browser cache lifetime for /products/42
D.Change the mutation to GET so intermediary caches observe it
Correct Answer: Tag related cache entries by product and invalidate that tag
Explanation:
Tag-based invalidation can connect the detail page and every derived listing to the same product dependency, allowing one mutation to revalidate all affected entries.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →