React•intermediate•single choice
Sample #1In React 18 and 19, what is the primary purpose of the useMemo hook?
A.To execute side-effects after every render
B.To cache the result of a computationally expensive calculation between re-renders✓ Key
C.To directly mutate the DOM without triggering a re-render
D.To create global state shared across asynchronous boundaries
Tested Engineering Concept:useMemo caches the result of a calculation between renders unless one of its specified dependencies changes.
JavaScript•beginner•true false
Sample #2In JavaScript, variables declared with 'const' are immutable, meaning their object properties cannot be modified.
Tested Engineering Concept:'const' prevents re-assigning the variable binding itself, but object properties or array elements can still be mutated.
Next.js•advanced•scenario
Sample #3You are building a high-traffic e-commerce product page in Next.js App Router. You need the product details to be cached globally on the edge, while the inventory count must remain real-time. Which approach is recommended?
A.Mark the entire page with 'use client' and query the database directly from browser useEffect
B.Use Partial Prerendering (PPR) or wrap the dynamic inventory section inside a React Suspense boundary with dynamic fetching✓ Key
C.Disable caching globally across all routes in next.config.js
D.Render everything on the client with polling intervals of 100ms
Tested Engineering Concept:Wrapping dynamic sections in <Suspense> allows Next.js to prerender the static product shell while streaming fresh dynamic inventory data without delaying the initial TTFB.
REST APIs•intermediate•single choice
Sample #4Which HTTP status code should a RESTful server return when a client attempts to access a protected resource without supplying valid credentials?
A.400 Bad Request
B.401 Unauthorized✓ Key
C.403 Forbidden
D.404 Not Found
Tested Engineering Concept:HTTP 401 Unauthorized indicates that the request lacks valid authentication credentials. HTTP 403 indicates authentication was provided but insufficient permissions exist.