Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
You're offline
Unit 6 MCQsAdvanced Features and Industry Practices
What is the main purpose of Parallel Routes in Next.js?
Not quite. Try another option.
Answer: Render multiple views in one layout
Parallel Routes allow multiple route segments to be displayed simultaneously within a shared layout.
Question 2 of 60 · Parallel Routes · Easy
Which folder naming convention defines a Parallel Route slot in Next.js?
Not quite. Try another option.
Answer: @folder
A folder beginning with @, such as @analytics, defines a named slot for a Parallel Route.
Question 3 of 60 · Parallel Routes · Easy
Where are named Parallel Route slots commonly received for rendering?
Not quite. Try another option.
Answer: As layout component props
Named slots are passed to their shared layout as props that can be placed in the rendered interface.
Question 4 of 60 · Proxy · Easy
What is a common use of Proxy in a web application?
Not quite. Try another option.
Answer: Inspect requests before routing
Proxy can inspect or modify incoming requests before the application completes route handling.
Question 5 of 60 · Proxy · Easy
Which task is well suited to a request Proxy?
Not quite. Try another option.
Answer: Redirecting unauthenticated users
A Proxy can check authentication information and redirect users who are not allowed to access a route.
Question 6 of 60 · Intercepting Routes · Easy
What do Intercepting Routes allow an application to do?
Not quite. Try another option.
Answer: Show a route within the current context
Intercepting Routes display another route while preserving the context of the current page.
Question 7 of 60 · Intercepting Routes · Easy
Which interface pattern commonly uses Intercepting Routes?
Not quite. Try another option.
Answer: Photo displayed in a modal
A photo can open in a modal during client navigation while remaining available as a full page through its direct URL.
Question 8 of 60 · Edge Runtime · Easy
Where does Edge Runtime code typically execute?
Not quite. Try another option.
Answer: Near the application's users
Edge Runtime code runs on geographically distributed infrastructure close to users.
Question 9 of 60 · Edge Runtime · Easy
What is a common benefit of using the Edge Runtime?
Not quite. Try another option.
Answer: Lower request latency
Running code closer to users can reduce the time needed to process and return a request.
Question 10 of 60 · Edge Runtime · Easy
Which statement about the Edge Runtime is generally correct?
Not quite. Try another option.
Answer: It supports a limited set of APIs
Edge environments commonly provide web-standard APIs but may not support every API available in a full Node.js runtime.
Question 11 of 60 · Internationalization · Easy
What does internationalization prepare an application to support?
Not quite. Try another option.
Answer: Multiple languages and regions
Internationalization prepares an application to adapt its language and regional formatting for different audiences.
Question 12 of 60 · Internationalization · Easy
What is a locale in an internationalized application?
Not quite. Try another option.
Answer: A language and regional preference
A locale identifies language and often regional conventions, such as en-US or fr-FR.
Question 13 of 60 · Internationalization · Easy
Which content commonly changes according to a user's locale?
Not quite. Try another option.
Answer: Date and currency formatting
Locales affect how dates, numbers, and currencies are presented to users.
Question 14 of 60 · Project Architecture · Easy
What is the main goal of a clear project architecture?
Not quite. Try another option.
Answer: Make the codebase easier to maintain
Clear architecture organizes responsibilities so developers can understand, modify, and extend the codebase.
Question 15 of 60 · Project Architecture · Easy
Where should shared utility functions generally be placed?
Not quite. Try another option.
Answer: In a dedicated utilities module
A dedicated utilities module keeps shared functions discoverable and avoids unnecessary duplication.
Question 16 of 60 · Component Organization · Easy
What is a reusable component?
Not quite. Try another option.
Answer: A component used in multiple places
A reusable component provides common interface or behavior that can be used across several parts of an application.
Question 17 of 60 · Component Organization · Easy
Which practice improves component organization?
Not quite. Try another option.
Answer: Grouping related components together
Grouping components by feature or responsibility makes them easier to locate and maintain.
Question 18 of 60 · Security Best Practices · Easy
How should application secrets such as API keys usually be stored?
Not quite. Try another option.
Answer: In protected environment variables
Protected environment variables keep secrets outside public client code and source files.
Question 19 of 60 · Security Best Practices · Easy
Why should an application validate user input?
Not quite. Try another option.
Answer: To reject invalid or harmful data
Input validation helps prevent malformed or malicious data from being processed by the application.
Question 20 of 60 · Testing Overview · Easy
What does a unit test usually verify?
Not quite. Try another option.
Answer: One small piece of functionality
A unit test checks a focused unit, such as a function or component, in isolation.
Question 21 of 60 · Parallel Routes · Medium
In a dashboard application, which feature allows the layout to render a sidebar and a main content area independently using named slots?
Not quite. Try another option.
Answer: Parallel Routes
Parallel Routes use named slots to render multiple route segments simultaneously within the same layout.
Question 22 of 60 · Parallel Routes · Medium
A user navigates between pages inside a dashboard, but the analytics panel should preserve its state while the main content changes. Which approach is most appropriate?
Not quite. Try another option.
Answer: Use a parallel route for the analytics panel
A parallel route can maintain an independently rendered panel while another route segment changes.
Question 23 of 60 · Proxy · Medium
What is the most suitable use of a Next.js proxy for a protected application area?
Not quite. Try another option.
Answer: Checking authentication before forwarding a request
A proxy can inspect incoming requests and redirect or rewrite them before the request reaches the application route.
Question 24 of 60 · Proxy · Medium
A proxy should run only for requests beginning with /admin. Which configuration principle should be applied?
Not quite. Try another option.
Answer: Configure a route matcher
A route matcher limits proxy execution to selected URL patterns, reducing unnecessary processing.
Question 25 of 60 · Intercepting Routes · Medium
A product list should open a product detail page in a modal when navigated from the list, but show a full page after a direct URL visit. Which feature supports this behavior?
Not quite. Try another option.
Answer: Intercepting Routes
Intercepting Routes allow navigation to be presented in a different UI context, such as a modal, while direct visits can render the normal page.
Question 26 of 60 · Intercepting Routes · Medium
Why should a modal opened through an intercepted route usually include a normal page implementation as well?
Not quite. Try another option.
Answer: To support direct navigation and refreshes
A user may access the URL directly or refresh the browser, so the route needs a full-page fallback in addition to the intercepted modal view.
Question 27 of 60 · Edge Runtime · Medium
Which implementation is most compatible with an edge runtime?
Not quite. Try another option.
Answer: A request handler using standard Web APIs
Edge runtimes generally support Web APIs such as Request, Response, and fetch, but not all Node.js-specific modules.
Question 28 of 60 · Edge Runtime · Medium
An edge function must access a database driver that depends on Node.js TCP sockets. What is the main concern?
Not quite. Try another option.
Answer: The driver may not be supported
Edge environments have a restricted runtime and may not provide Node.js networking APIs required by some database drivers.
Question 29 of 60 · Internationalization · Medium
An application supports English and French URLs such as /en/products and /fr/products. What should determine the displayed language?
Not quite. Try another option.
Answer: The locale associated with the route
The locale segment identifies the language context used to load translations and format content.
Question 30 of 60 · Internationalization · Medium
A price must display correctly for users in Germany and the United States. Which strategy is most reliable?
Not quite. Try another option.
Answer: Use locale-aware number and currency formatting
Internationalization APIs can apply locale-specific decimal separators, grouping, currency symbols, and formatting conventions.
Question 31 of 60 · Project Architecture · Medium
Which architectural choice best supports independent development of a large web application?
Not quite. Try another option.
Answer: Organize code by clear domain boundaries
Domain-oriented boundaries improve ownership, maintainability, testing, and the ability to change one feature without affecting unrelated features.
Question 32 of 60 · Project Architecture · Medium
A team wants to prevent UI code from directly constructing database queries. Which architectural practice is most appropriate?
Not quite. Try another option.
Answer: Use a service or repository layer
A service or repository layer separates data access from presentation and provides a clearer boundary for validation and testing.
Question 33 of 60 · Component Organization · Medium
A button is reused across unrelated features and has no feature-specific behavior. Where should it generally be organized?
Not quite. Try another option.
Answer: In a shared UI component directory
Generic reusable components belong in a shared UI area, while feature-specific components should remain near their feature.
Question 34 of 60 · Component Organization · Medium
A page needs browser event handlers, but most of its content is static. How should the components be organized?
Not quite. Try another option.
Answer: Keep the page server-rendered and isolate the interactive part
Isolating interactivity in a small client component preserves server-rendering benefits and reduces client-side JavaScript.
Question 35 of 60 · Security Best Practices · Medium
Which practice best protects a web application from SQL injection?
Not quite. Try another option.
Answer: Use parameterized queries
Parameterized queries keep user input separate from executable SQL syntax, preventing input from changing the intended query.
Question 36 of 60 · Security Best Practices · Medium
A server action receives an isAdmin value from a form. Why should the server avoid trusting that value?
Not quite. Try another option.
Answer: Clients can modify submitted form values
Authorization must be checked using trusted server-side identity and permissions, not a client-controlled field.
Question 37 of 60 · Security Best Practices · Medium
Which cookie configuration is most appropriate for a session identifier that should not be accessible to JavaScript?
Not quite. Try another option.
Answer: Set the HttpOnly attribute
The HttpOnly attribute prevents browser JavaScript from reading the cookie, reducing exposure to certain cross-site scripting attacks.
Question 38 of 60 · Testing Overview · Medium
Which test type is most appropriate for verifying that a form displays an error when a required field is empty?
Not quite. Try another option.
Answer: A component or integration test
Component or integration tests can simulate user input and verify the resulting validation message and UI behavior.
Question 39 of 60 · Testing Overview · Medium
A test passes locally but fails intermittently in continuous integration because it depends on timing. What is the best improvement?
Not quite. Try another option.
Answer: Wait for observable conditions instead of fixed delays
Waiting for a specific UI or network condition makes tests more deterministic than relying on arbitrary sleep intervals.
Question 40 of 60 · Testing Overview · Medium
Which test provides the strongest check that a user can log in, reach a protected page, and log out through the browser?
Not quite. Try another option.
Answer: An end-to-end test
End-to-end tests exercise the complete workflow across the browser, application routes, authentication, and user interface.
Question 41 of 60 · Parallel Routes · Hard
A dashboard uses parallel routes for @analytics and @activity. The user navigates from /dashboard/reports to /dashboard/settings, but the activity panel should preserve its existing state while the analytics panel refreshes. Which design best achieves this behavior?
Not quite. Try another option.
Answer: Use separate slots with independent loading and error boundaries
Parallel route slots can preserve independent UI state and manage loading or errors separately, allowing one slot to refresh without remounting the others.
Question 42 of 60 · Parallel Routes · Hard
A modal is implemented with a parallel route slot. On a hard refresh at /inbox, the modal slot receives no active child, although client-side navigation correctly opens the modal. Which file most directly defines the refresh fallback for that slot?
Not quite. Try another option.
Answer: default.tsx inside the modal slot
A parallel route's default.tsx defines the fallback UI when no matching slot content exists during an initial load or hard refresh.
Question 43 of 60 · Parallel Routes · Hard
Two parallel route slots display independent resources. One resource returns a 403 response while the other succeeds. What is the most appropriate boundary arrangement?
Not quite. Try another option.
Answer: An error boundary colocated within each parallel slot
Slot-level error boundaries isolate failures, so a denied resource can show its own recovery UI without replacing unrelated successful content.
Question 44 of 60 · Proxy · Hard
A proxy should protect /admin routes but must not run for /_next/static, image optimization requests, or files containing a dot in their final path segment. Which matcher strategy is most precise?
Not quite. Try another option.
Answer: Use a negative-lookahead matcher excluding framework assets and dotted paths
A carefully scoped matcher prevents unnecessary proxy execution and avoids applying authentication logic to framework assets or file-like URLs.
Question 45 of 60 · Proxy · Hard
A proxy validates an access token and then redirects unauthenticated users to /login?returnTo=<original path>. Which issue must be addressed before deploying this implementation?
Not quite. Try another option.
Answer: The return path must be validated to prevent open redirects
An attacker could supply an external return URL and turn the login redirect into an open redirect. Only validated same-origin paths should be accepted.
Question 46 of 60 · Intercepting Routes · Hard
A product detail route should open as a modal when reached from a product list, but render as a full page after a direct URL entry or browser refresh. Which combination is required?
Not quite. Try another option.
Answer: An intercepting route for soft navigation and a canonical page route
Intercepting routes alter the presentation during client navigation, while the canonical route supplies the full-page representation for direct entry and refresh.
Question 47 of 60 · Intercepting Routes · Hard
A modal opened through an intercepting route remains visible after the user presses the browser Back button. Which implementation detail is most likely missing?
Not quite. Try another option.
Answer: The modal must close by navigating back through browser history
Intercepted modal navigation should create a history entry. Returning with browser history removes the modal state and restores the underlying route.
Question 48 of 60 · Edge Runtime · Hard
An API handler works in Node.js but fails after being configured for the Edge Runtime because it imports a package that depends on fs and Node's TCP APIs. What is the correct diagnosis?
Not quite. Try another option.
Answer: The package violates Edge Runtime API constraints
The Edge Runtime does not provide arbitrary Node.js built-ins such as filesystem and TCP APIs. The dependency must be replaced or the route must run in Node.js.
Question 49 of 60 · Edge Runtime · Hard
A globally distributed request handler performs a 700 ms database query against a single regional database. Moving the handler to the Edge Runtime does not improve median latency. Why?
Not quite. Try another option.
Answer: The database remains the dominant regional bottleneck
Edge execution reduces compute distance, but a remote single-region dependency can still dominate total latency. Data locality and connection strategy must also be addressed.
Question 50 of 60 · Internationalization · Hard
An application supports locale-prefixed URLs and must preserve a user's requested path when redirecting / to a detected locale. Which behavior avoids a common routing defect?
Not quite. Try another option.
Answer: Redirect to the detected locale while preserving the normalized path
Locale detection should select the locale without discarding the requested route. The path must be normalized carefully to avoid duplicate prefixes and redirect loops.
Question 51 of 60 · Internationalization · Hard
A localized page is statically generated for en, fr, and de. A request arrives for fr-CA, which is configured as a fallback of fr. What is the most robust rendering strategy?
Not quite. Try another option.
Answer: Use fr resources while preserving fr-CA formatting rules where supported
Locale fallback should separate translation-resource availability from regional formatting. Base-language messages can be reused while regional conventions remain explicit when supported.
Question 52 of 60 · Project Architecture · Hard
A team wants feature ownership to remain clear as a Next.js application grows. Which structure best supports localized changes and prevents unrelated domain code from accumulating in a global utilities folder?
Not quite. Try another option.
Answer: Organize code by business feature with local components, data access, and tests
Feature-oriented architecture keeps related behavior together, clarifies ownership, and reduces accidental coupling between unrelated domains.
Question 53 of 60 · Project Architecture · Hard
A route group is introduced to give authenticated pages a shared layout without changing their public URLs. Which statement correctly describes the purpose of route groups?
Not quite. Try another option.
Answer: They group routes structurally without adding path segments
Parenthesized route groups organize layouts and route ownership while remaining invisible in the URL. They do not provide authentication by themselves.
Question 54 of 60 · Component Organization · Hard
A server component fetches private data and passes a callback that closes over a secret-bearing object to a client component. Why is this design invalid or unsafe?
Not quite. Try another option.
Answer: Functions and secret-bearing values cannot cross the server-client boundary safely
Props crossing the boundary must be serializable, and secrets must never be exposed to client code. Server actions or narrow data contracts should be used instead.
Question 55 of 60 · Component Organization · Hard
A large interactive table causes an otherwise static page to become client-rendered. Which refactoring best preserves server rendering while retaining table interactivity?
Not quite. Try another option.
Answer: Keep the page server-rendered and isolate table behavior in a client island
Client boundaries should be as narrow as practical. A focused interactive component can receive serializable data while the surrounding page remains a server component.
Question 56 of 60 · Security Best Practices · Hard
A server action updates a user's email address. The form is rendered only for administrators, but a malicious client invokes the action directly. What control is essential inside the action?
Not quite. Try another option.
Answer: Recheck authentication and authorization on the server
UI visibility is not an authorization boundary. Every server action must independently authenticate the caller and verify permission for the requested operation.
Question 57 of 60 · Security Best Practices · Hard
An application accepts a next query parameter after login and performs redirect(next). Which validation is strongest for preventing an attacker-controlled external redirect?
Not quite. Try another option.
Answer: Allow only normalized same-origin paths beginning with /
Encoding does not establish trust, and string blacklists are incomplete. A normalized same-origin relative path is the appropriate allowlist.
Question 58 of 60 · Security Best Practices · Hard
A page displays user-submitted Markdown. The renderer permits raw HTML because some trusted authors need formatting. Which mitigation is required?
Not quite. Try another option.
Answer: Sanitize generated HTML with a strict allowlist before insertion
Markdown conversion can produce dangerous HTML. Sanitization must remove unsafe tags, attributes, and URL schemes; CSP is defense in depth, not a replacement.
Question 59 of 60 · Testing Overview · Hard
A component test passes because it mocks the router, but production fails when a parallel route slot is missing during a hard refresh. Which test addition most directly covers the defect?
Not quite. Try another option.
Answer: Add an end-to-end test for direct entry and refresh of the route
The failure depends on routing, server rendering, and refresh behavior. An end-to-end test exercises the actual navigation mode and slot fallback together.
Question 60 of 60 · Testing Overview · Hard
A test verifies that an unauthorized user cannot access /admin. The implementation returns either a redirect or a 403 depending on whether the request is browser navigation or an API call. What assertion strategy is most resilient?
Not quite. Try another option.
Answer: Test each contract separately: redirect behavior for navigation and 403 for the API
Different clients have different response contracts. Tests should verify the intended status, headers, and behavior for each request type rather than forcing one implementation outcome.
That's unit 6
Answer a few questions and your score shows up here.
Nearly through. Did unit 6 of INT257 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 6 of INT257 save you a night before the exam?
Then you can help keep it free for the next batch. 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.