Concept Quiz Bank
Practice targeted active recall. Search our extensive catalog of quiz questions, test your knowledge on demand, or launch a randomized practice session to master frontend concepts.
Practice Session Runner
Select filters to launch a fast recall drill with N questions. Works offline, scored instantly.
Browse Bank2352 matches
What's the defining difference between a single tool-use round trip and an 'agent'?
True or false: an agent loop with no max_iterations guard is safe as long as the model 'should' eventually stop requesting tools.
In Managed Agents, when should client.beta.agents.create() typically be called?
True or false: Managed Agents hosts only the agent's decision-making loop; tool execution (bash, file operations) still happens on your own infrastructure.
A multi-step task like 'book a flight, then find a hotel near the airport' typically requires a loop rather than one batch of parallel tool calls because:
True or false: the SDK's beta Tool Runner is a different, incompatible mechanism from the manual while-loop agent pattern — it doesn't do the same thing.
What real benefit does logging each agent step's tool calls (name + input) provide?
True or false: adopting a framework like LangChain removes the need to understand the underlying stop_reason and tool_use/tool_result mechanics.
What does session.status_idle indicate in a Managed Agents session's event stream?
True or false: creating a fresh Managed Agents Agent object per user session preserves prompt-caching benefits better than reusing one persisted Agent.
Which of the three agent-building approaches (manual loop, Tool Runner, Managed Agents) is the appropriate choice specifically when you want Anthropic to host BOTH the loop AND the sandboxed tool-execution environment?
True or false: an agent loop hitting its max_iterations cap should ideally return a deliberate, informative response rather than crashing or hanging.
Why should a user's own message be rendered optimistically, before the network request completes?
True or false: a single boolean like isLoading is sufficient to represent both 'waiting for the first token' and 'actively streaming' states.
What mechanism underlies a 'Stop generating' button?
True or false: when a user clicks 'stop generating,' the best practice is to remove the entire in-progress assistant message from the UI.
Why is presenting a stop_reason: 'refusal' as a generic 'Something went wrong, try again' error misleading?
True or false: giving a tool call a specific, labeled progress indicator (e.g. 'Searching flights...') instead of a generic spinner has been shown to measurably improve perceived responsiveness.
What's the recommended pattern for a response that's naturally structured data (e.g. a set of selectable options), rather than prose?
True or false: a 'propose_options' tool used purely to trigger a UI component must also perform some real side effect to be a valid tool.
What is the benefit of modeling chat turn state as a discriminated union (pending | streaming | tool_call | done | stopped) rather than several independent boolean flags?
True or false: stop_reason: 'max_tokens' represents genuinely useful partial content that should still be shown to the user, rather than being hidden as an error.
A junior developer implements the stop button as `setMessages(prev => prev.slice(0, -1)); controller.abort();`. What's the more correct behavior?
What is the reliable way to determine the actual token cost of a request that was just made?
True or false: a generic, non-Claude-specific tokenizer library gives an accurate token count for a Claude model.
What effect does lowering output_config.effort typically have?
True or false: streaming a response reduces its total token cost compared to a non-streaming request for the same content.
What should an application do when it receives a RateLimitError that the SDK's automatic retries didn't resolve?
True or false: stop_reason: 'refusal' should be treated as a transient error worth automatically retrying with the identical request.
Why is disguising a failed tool call as a successful tool_result (e.g. content: 'Success.' when the tool actually threw) a safety-relevant issue, not just a bug?
True or false: applying one blanket effort/model configuration across every route in an application is generally the recommended approach.
What is the primary architectural mitigation for prompt injection via untrusted user content flowing into a prompt?
True or false: prompt caching guarantees a cost reduction the moment cache_control is added to a request, with no need to verify it in production.
A summarization feature is given a tool that can delete files, 'just in case it's ever useful.' What's the concern here from a safety/cost perspective?
True or false: a tighter max_tokens cap bounds worst-case cost and latency, but risks truncating a genuinely long, valid response.
What does client.messages.countTokens() provide that response.usage does not?
What does MCP (Model Context Protocol) actually standardize?
True or false: declaring an MCP server in the mcp_servers array is sufficient on its own to grant Claude access to that server's tools.
In the Managed Agents MCP pattern, where do MCP OAuth credentials live?
True or false: a service's ordinary REST API key can always be used directly as the vault credential for that service's hosted MCP server.
How is an mcp_oauth vault credential matched to the correct MCP server?
True or false: an mcp_oauth credential's access token must be manually refreshed by the application before it expires.
What happens when an MCP tool call returns more than roughly 100K tokens of output?
True or false: the Messages API's MCP connector requires your own backend to proxy MCP traffic between Claude and the MCP server.
Why does the Managed Agents pattern deliberately split MCP server declaration (on the agent) from credential storage (in a vault, at the session)?
True or false: an MCP server, once built, can only be used by Anthropic's Claude models — it's not interoperable with other vendors' clients.
A developer wants a one-off Messages API call to use an MCP-hosted tool, with no need for a persisted or resumable session. Which is the more appropriate path?
True or false: MCP exposes only 'tools' (callable functions) — prompts and resources are not part of the MCP specification.
What problem does RAG solve that fine-tuning or retraining the model does not solve as cheaply?
True or false: ingestion (chunking, embedding, storing) and query-time retrieval happen at the same time, triggered by the same user request.
Why is chunk overlap (e.g. 50 characters of overlap between adjacent 500-character chunks) used during ingestion?
True or false: the embedding model used to embed documents at ingestion time must be the exact same model used to embed the user's query at retrieval time.
What is the practical symptom of accidentally mixing embedding models between ingestion and query time?
True or false: at query time, the entire vector database's contents (all stored vectors) are typically injected into the model's context.
What role does the vector database play once similarity search returns results?
True or false: without an explicit system instruction to answer only from retrieved context, the model may blend in its own frozen training-data knowledge, reintroducing staleness.
A toy implementation ranks stored chunks by cosine similarity to a query vector and returns the top K. What does the vector database's ANN (approximate nearest neighbor) index, like HNSW, provide over this brute-force approach?
True or false: a vector database should store only the raw numeric vector for each chunk, since that's all that's needed for similarity search.
What's the tradeoff between smaller and larger chunk sizes during ingestion?
True or false: RAG requires retraining or fine-tuning the generation model whenever the underlying knowledge base is updated.
Six months after launch, a team upgrades their embedding provider to a newer model version and updates only the query-time embedding call, leaving the vector database's stored vectors untouched. What is the correct remediation?
True or false: the embedding model used to turn text into vectors is generally the same model used to generate the final natural-language answer.
How does the Anthropic Messages API remember a conversation across multiple turns?
True or false: 'regenerating' a response can be correctly implemented by resending the exact same messages array, unchanged, to the API.
What must happen when a user edits an earlier message in a chat conversation and expects the conversation to continue from there?
True or false: the `messages` array sent to the API effectively IS the conversation state for a chat application.
Why is caching the stable portion of the system prompt (persona, instructions) valuable in a chat application specifically?
True or false: two separate conversations for the same user share some hidden state that must be explicitly managed.
What's the risk of a naive fixed-window trim (e.g. always keep only the last 20 turns) as a context-management strategy?
True or false: a chat application's backend must reload and resend the FULL conversation history from persistence on every single new user message.
In the regenerateLastResponse function, what condition determines whether a turn should be dropped from the end of the messages array?
True or false: streaming and multi-turn conversation history management are unrelated concerns that never need to interact.
A developer implements per-user chat by storing one giant shared messages array across ALL of a user's separate conversations, tagging each message with a conversationId field. What's wrong with this?
True or false: the API's compaction feature (beta, on supporting models) requires the application to manually decide which specific turns to discard.
Why does waiting until a request actually fails on context length (rather than proactively trimming/summarizing) hurt the user experience?
True or false: appending the assistant's response to the persisted messages array should use response.content directly, not just the extracted text string.
What should generally live in the `system` parameter versus `messages`?
True or false: prompt caching matches on request semantics — two requests that 'mean the same thing' will share a cache entry.
A system prompt interpolates `new Date().toISOString()` at its very start, followed by a large stable instruction block with a cache_control breakpoint at the end. What will response.usage.cache_read_input_tokens show across repeated requests?
What is the current, supported way to inject runtime context mid-conversation without invalidating the cached system prompt?
True or false: embedding runtime context as plain text inside a user-role message is functionally identical in trust level to a role: 'system' message.
What replaced assistant-turn message prefills for forcing structured output on current-generation models?
True or false: an assistant-turn prefill (ending the messages array with a partial assistant response) still works without error on current-generation Claude models.
A system prompt reads: 'Be helpful and answer questions about our product.' What's the main risk of this phrasing at scale?
True or false: prompt cache write cost is cheaper than an uncached request, so it's always worth adding cache_control even to a prompt sent only once.
Which usage field would you check to confirm prompt caching is actually being hit, rather than assuming it is because cache_control is present?
True or false: there is a minimum prefix length below which cache_control silently has no effect, with no error raised.
Why does cramming the user's live question directly into the system string (e.g. `You are helpful. The user asked: "${q}"`) hurt both caching and clarity?
A prompt template splits a request into a `stableSystem` string and a `buildMessages(userInput, context)` function. What is `context` typically used for?
True or false: reordering the keys of a JSON object sent as part of the request prefix can invalidate prompt caching.
What guarantee does output_config.format (structured outputs) provide that an assistant-turn prefill never did?
What is the current recommended default model id for new Claude API integrations, per this app's installed SDK?
True or false: it is safe to call the Anthropic SDK directly from a Next.js Client Component as long as the API key is stored in a NEXT_PUBLIC_ environment variable.
Given `response.content = [{ type: 'thinking', thinking: '...' }, { type: 'text', text: 'Done.' }]`, what does `response.content[0].text` evaluate to in a plain JS (non-TypeScript) codebase?
Which parameter replaces the deprecated fixed-token-budget approach to extended thinking on current-generation models?
Where does the `effort` parameter belong in a messages.create() call?
True or false: retrying a 400 Bad Request error in a loop will eventually succeed if you just wait long enough.
Which SDK exception class should be caught first (most specific) when distinguishing rate limiting from other failures?
True or false: response.content is always a single string containing the model's reply.
Why is it recommended to shape a small custom response object (e.g. { text, stopReason }) instead of returning the raw SDK response object to the frontend?
True or false: the zero-argument Anthropic() client constructor requires ANTHROPIC_API_KEY to be set, with no other credential path.
In TypeScript, a per-request timeout override such as `{ timeout: 15_000 }` is specified in which unit?
At roughly what output size should a non-streaming request be converted to a streaming one to avoid SDK-level HTTP timeouts?
True or false: adaptive thinking and the effort parameter serve the exact same purpose and using both together is redundant.
A teammate wants to store the Anthropic API key in a variable named NEXT_PUBLIC_CLAUDE_KEY so 'the frontend can call Claude directly and skip the extra network hop.' What's the correct response?
What does the SDK's default max_retries behavior automatically retry?
True or false: reusing a single module-level Anthropic client instance across requests is preferred over constructing a new one per request.
Which SSE event type carries the incremental text fragments a client should render?
Given the code below, what does `rendered` contain after all three deltas ('The ', 'quick ', 'fox.') have been processed?
True or false: each content_block_delta event contains the full accumulated text generated so far, not just a small new fragment.
At roughly what output token count does a non-streaming request risk hitting an HTTP timeout, making streaming effectively required rather than optional?
True or false: input_json_delta fragments (for a streamed tool_use block) can be safely parsed with JSON.parse() as soon as each individual fragment arrives.
What does stop_reason: 'tool_use' mean in the context of a streamed response, compared to 'end_turn'?
True or false: message_start carries visible response text as part of its payload.
In a hand-rolled SSE parser reading from a fetch() ReadableStream, why is it necessary to buffer an incomplete trailing frame across multiple reader.read() calls?
True or false: it's safe and recommended for a browser-side script to open a streaming connection directly to Anthropic's API.
What is the benefit of calling `stream.finalMessage()` after consuming a stream, instead of manually reconstructing the full Message from tracked deltas?
True or false: re-rendering the UI on every single content_block_delta event, with no batching, is the recommended approach for the smoothest user experience.
Which event signals that the ENTIRE streamed message is complete, not just one content block?
True or false: a streamed response can contain ordinary text blocks followed by a tool_use block in the same message.
A junior developer says: 'Streaming is just a nice UX polish — for a backend job with no visible UI, there's no reason to ever use it.' What's the flaw in this reasoning?
True or false: message_delta events can include a running usage object and the final stop_reason.
What is the correct fix for code that does `renderedText = event.delta.text` instead of `renderedText += event.delta.text` inside a streaming loop?
What does stop_reason: 'tool_use' actually mean?
True or false: tool definitions only need to be sent on the first request of a conversation; Claude remembers them for subsequent calls.
What must a follow-up request include, beyond the new tool_result block, in order for Claude to correctly process it?
True or false: if Claude requests two independent tools in the same turn, you should return each tool's result in its own separate follow-up message.
What field correlates a tool_result block back to the specific tool_use block it's responding to?
True or false: if a tool execution throws an error, the best practice is to silently omit sending any tool_result for that call.
Why does a well-written tool description state WHEN to call the tool, not just what it does?
A follow-up request's messages array is: [user Q, tool_result block] — with NO assistant turn containing the original tool_use in between. What is the most likely outcome?
True or false: the SDK's beta Tool Runner requires you to hand-write the request/execute/loop cycle yourself.
When should you reach for a hand-written manual tool loop instead of the SDK's Tool Runner?
True or false: a max_iterations guard is only relevant for the SDK's Tool Runner, not for a hand-written manual loop.
Independent tool calls requested in the same turn should be executed how?
True or false: an overly broad tool input_schema that accepts many optional fields 'just in case' generally makes tool calling more reliable.
A junior developer's agent loop breaks after the first tool call because they wrote `messages.push({ role: 'user', content: response.content })` instead of `messages.push({ role: 'assistant', content: response.content })`. What's wrong here?
True or false: in a multi-turn agent loop, a later tool call can depend on information returned by an earlier tool call in a previous turn.
True or false: RFC 9457 obsoletes the earlier RFC 7807, and is the current standard for this purpose.
In an RFC 9457 problem response, what's the difference between 'title' and 'detail'?
True or false: choosing 'no explicit versioning' (an evolvable API) means less ongoing discipline is required compared to URL-path versioning.
Why is URL path versioning (/v1/, /v2/) attractive despite 'polluting' the URL?
True or false: in the Try It scenario, changing userName from a string to a structured object is safe under evolvable-API discipline because no field was removed.
What's the downside of header/content-negotiation versioning (Accept: application/vnd.myapi.v2+json) compared to URL path versioning?
True or false: extension members (custom fields beyond type/title/status/detail/instance) are allowed in an RFC 9457 problem response.
Why does bumping the ENTIRE API's version for a change affecting only one endpoint cause unnecessary cost?
True or false: using application/problem+json as the actual Content-Type header (not just application/json) lets clients and tooling programmatically recognize the standardized error shape.
A team invents a custom error shape { ok: false, msg: '...', code: 42 } for their new API instead of using RFC 9457. What's the main downside?
True or false: the 'no versioning' (evolvable) strategy is generally riskier for a public API with many uncontrolled third-party clients than for an internal API with clients the team controls.
Why is problemResponse() in Implement It Yourself designed as a single shared helper rather than each route building its own error body inline?
True or false: the 'status' field inside an RFC 9457 problem body is meant to be a completely independent value from the actual HTTP response status code.
What single discipline rule does the evolvable/no-versioning strategy rely on for every single change?
Confirmed via a real curl round-trip against a live API, what does the server return when a client's If-None-Match value matches the current ETag?
True or false: Cache-Control: public means the response may be stored by ANY cache, not just the requesting client's own browser cache.
What's the difference between max-age and s-maxage in a Cache-Control header?
True or false: a weak ETag (prefixed with W/) guarantees byte-for-byte identical content, the same as a strong ETag.
In the Try It scenario, why must the server return a full 200 (not 304) when the client's If-None-Match doesn't match the current ETag?
True or false: a server implementation that returns 304 whenever an If-None-Match header is present, without comparing its actual value, is a subtle but real bug.
Why is Last-Modified/If-Modified-Since generally considered coarser than ETag/If-None-Match?
True or false: setting Cache-Control: public on a response containing one user's private order history is a real data-leak risk.
Why might a strong ETag defeat caching for JSON content with non-deterministic key ordering across serializations?
True or false: computing an ETag has zero performance cost, regardless of resource size.
What connects list-endpoint caching correctness to the pagination strategy chosen (per Under the Hood)?
True or false: only safe HTTP methods (like GET) are meaningfully cacheable under HTTP's caching model.
A code review finds an endpoint returning Cache-Control: public, max-age=3600 on GET /api/me/orders (the CURRENT user's order history). What should be flagged?
True or false: in the Implement It Yourself example, the ETag is recomputed fresh from the resource's actual current content on every single request, rather than being cached from the first computation.
Why does a 304 Not Modified response save meaningful bandwidth compared to a 200 with the same data?
What is the single most important practical fact about gRPC for frontend engineers, per this topic?
True or false: a single .proto file can generate strongly-typed client AND server code across different programming languages from one shared schema.
True or false: grpc-web and BFF-proxy patterns are optional performance optimizations for gRPC, not required workarounds.
In the Try It scenario, why is gRPC a poor fit for a public API consumed directly by third-party browser apps?
True or false: gRPC's protobuf wire format is human-readable JSON-like text, the same as a typical REST API response.
What HTTP/2 feature does gRPC rely on for multiplexed concurrent calls over one connection?
True or false: gRPC only supports a single unary (one request, one response) call pattern, the same as typical REST.
How does gRPC's approach to type safety compare to tRPC's, per Under the Hood?
True or false: gRPC is generally considered a strong fit for internal, backend-to-backend microservice communication where the team controls both ends.
What does the Implement It Yourself UserServiceClient example illustrate, given it doesn't actually use real protobuf?
True or false: choosing REST or GraphQL over gRPC for a public, browser-consumed API is a legitimate, often-correct engineering tradeoff, not a sign of using an inferior technology.
A team adopts gRPC for internal microservices but reports significant friction debugging failed calls in production. What's the most likely explanation, per this topic?
True or false: server streaming, client streaming, and bidirectional streaming are all distinct RPC patterns gRPC supports natively, beyond simple unary calls.
Why does the topic describe protobuf's binary format as a real tradeoff rather than a strict improvement over JSON?
What is the specific, demonstrated consistency bug in offset pagination?
True or false: cursor pagination is immune to the offset skip/duplicate bug because it anchors to an actual VALUE rather than a row count.
What's the real tradeoff cursor pagination makes compared to offset pagination?
True or false: a single-field cursor (e.g. just createdAt) is always sufficient, even when multiple rows can share the exact same value on that field.
In the Try It scenario, why does order #21 (original ordering) get silently skipped rather than order #22?
True or false: cursor pagination generally performs BETTER than offset pagination at deep pages, because it doesn't need to scan and discard skipped rows.
When is offset pagination still a reasonable choice, per this topic?
True or false: a structured field:operator:value filter grammar scales better than inventing a new query parameter per field/operator combination.
Why does an unbounded, client-supplied page limit pose a real risk?
True or false: a compound database index matching the cursor's exact sort/filter columns is what makes cursor pagination's performance advantage real in practice.
Why is offset pagination's consistency bug described as 'deterministic, not probabilistic'?
True or false: offset-based paginated responses are generally easier to cache correctly than cursor-based ones.
A code review finds GET /feed?offset=8000&limit=50 used for a social media feed with very high write volume. What should be flagged?
True or false: the implement-it-yourself paginateByCursor function correctly handles a deletion between requests because it filters on a VALUE (createdAt + id), not an index/count.
What does the compound cursor's second component (the unique id) specifically guard against?
What is the structural inefficiency of short polling?
True or false: long-polling eliminates almost all of short polling's wasted round-trips by having the server hold the request open until something actually happens or a timeout is reached.
In the Try It scenario, why does a 5-second client timeout against a 30-second server hold window degrade the system?
True or false: exponential backoff should keep doubling the retry delay indefinitely with no upper bound.
Why does the implement-it-yourself backoff function reset delay to baseDelay on a successful poll?
True or false: an unthrottled, immediate retry loop against a failing server can itself worsen or prolong the outage, especially with many clients doing it simultaneously.
What server-side race condition does long-polling need to explicitly handle?
True or false: failing to handle a client disconnecting mid-long-poll (not cleaning up subscriptions/timers) is a real resource leak.
How does long-polling's per-request nature differ fundamentally from a WebSocket connection?
True or false: short polling's total request cost scales with actual event frequency, the same way long-polling's does.
What's the connection between exponential backoff and the shipped redux saga take-pattern work on debouncing, per Under the Hood?
True or false: long-polling requires the same kind of persistent, protocol-upgraded connection management that WebSockets need.
A code review finds a polling client that retries every failed request after exactly 1 second, with no growth in delay over repeated consecutive failures. What's the risk?
True or false: long-polling is best understood as a relic technique with no legitimate place once WebSockets/SSE exist.
Why must the client's long-poll timeout be set with real margin ABOVE the server's hold window, not just barely longer?
What is the specific, demonstrable bug in fixed-window rate limiting?
True or false: in the Try It scenario, the fixed-window implementation technically allows all 2000 requests without violating either individual window's stated limit.
Why doesn't token bucket have the same boundary bug as fixed window?
True or false: a true sliding-window-log approach has zero boundary bug, but at a real memory cost compared to a single counter.
Why does setting a token bucket's capacity EQUAL to the full intended long-run quota reintroduce a burst problem?
True or false: rate-limiting exclusively by IP address is generally more accurate than limiting by authenticated identity.
Why does the topic recommend always returning a Retry-After header on a 429 response?
True or false: in the runnable TokenBucket implementation, tokens are added based on real elapsed wall-clock time since the last check, not on a fixed periodic timer.
How does rate limiting relate to pagination's limit parameter, per Under the Hood?
True or false: a leaked API key without any rate-limit backstop turns the leak into effectively unlimited resource consumption for whoever obtained it.
Why is token bucket's per-client state described as O(1) and cheaper than a true sliding-window-log?
True or false: the 'sliding window counter' approximation interpolates between two fixed windows specifically to avoid storing every individual request timestamp.
A code review finds a rate limiter that resets its counter to 0 at the top of every clock minute, with a limit of 60/minute. What real-world risk does this design have?
True or false: layering rate limiting at multiple levels (coarse per-IP plus a primary per-API-key limit) provides defense-in-depth against different evasion strategies.
Why does the severity of the fixed-window boundary bug scale with the window size (e.g. worse for hourly windows than per-second windows)?
What is the core idea behind REST's resource-oriented URL design?
True or false: PATCH is guaranteed idempotent by the HTTP specification, the same way PUT is.
What does it mean for an HTTP method to be 'safe'?
True or false: an idempotent method guarantees calling it N times produces the same end server-side state as calling it once.
True or false: in the Try It scenario, blindly retrying a PATCH that increments a view count on timeout is safe because PATCH requests are always safe to retry.
What does the topic mean by 'pragmatic REST' versus textbook REST?
True or false: returning HTTP 200 with an error message in the response body is a recommended pattern for signaling failures.
Why can GET requests participate in HTTP caching/CDN edge-caching in a way mutating methods cannot?
True or false: DELETE is idempotent even though calling it a second time on an already-deleted resource typically returns a 404 instead of the original success status.
What's the general fix for making an operation safe to retry when its natural expression (like an increment) is inherently non-idempotent?
True or false: nesting resource URLs arbitrarily deep (e.g. 5+ levels) is always the correct REST design choice with no downsides.
A code review finds POST /users/updateEmail alongside the existing PATCH /users/:id endpoint. What's the issue?
True or false: HATEOAS (responses containing links to related available actions) is rarely fully implemented in real-world production APIs, according to this topic.
What determines whether a specific PATCH request is idempotent — the method name, or something else?
Confirmed by an actual sign/tamper/verify test this session, what happens when a webhook payload is modified after signing?
True or false: a webhook URL should be treated as a real secret, sufficient on its own without signature verification.
What delivery guarantee do nearly all production webhook systems (Stripe, GitHub, etc.) actually provide?
True or false: in the Try It scenario, having a deduplication check present in the code guarantees the handler is actually safe against duplicates.
Why must a webhook receiver return a 2xx status for a successfully-deduplicated duplicate event, not an error status?
True or false: crypto.timingSafeEqual throws an exception (rather than returning false) when comparing buffers of different lengths.
Why should signature verification be performed over the RAW received body, not a re-serialized version of the parsed payload?
True or false: a naive check-then-insert deduplication pattern can still have a race condition under concurrent duplicate deliveries of the same event ID.
Why is a webhook handler that credits a user's balance on every payment.succeeded event, with no deduplication, described as guaranteed to eventually double-credit, not just theoretically at risk?
True or false: processing a slow side effect synchronously within the webhook handler, before responding, is generally recommended.
How does webhook signature verification relate to CSRF token comparison, per Under the Hood?
True or false: a webhook receiver that's briefly overwhelmed and returns 5xx errors can trigger a retry storm that worsens its own overload, connecting directly to rate-limiting concerns.
A code review finds a webhook handler that verifies the signature correctly but processes the side effect BEFORE checking for a duplicate event ID. What's the actual risk level?
True or false: HMAC signing the same payload with the same secret twice produces different signatures each time.
Why does the topic recommend an atomic database unique constraint for the check-and-record deduplication step, rather than a simple read-then-write?
Confirmed by running a real ws server this session, what type is incoming WebSocket message data by default?
True or false: SSE (Server-Sent Events) supports true bidirectional communication over the same connection.
What is the main practical advantage of SSE over WebSockets for a purely server-to-client push requirement?
True or false: in the Try It scenario, comparing WebSocket message data directly with === against a string literal will silently never match, with no error thrown.
Why does a WebSocket start as a regular HTTP request before becoming a persistent connection?
True or false: failing to remove a closed connection from a server-side tracking Set/Map is a genuine, common memory leak source in long-running WebSocket servers.
In the broadcast implementation, why is checking readyState === OPEN necessary before calling client.send()?
True or false: the raw SSE wire format confirmed in this topic (id:/data: lines separated by a blank line) requires a special binary protocol library to parse server-side.
Why does the single-threaded Node event loop make the Set-based broadcast pattern safe without explicit locking?
True or false: reaching for WebSockets by default for any 'real-time-sounding' feature is recommended, even when the actual requirement is purely server-to-client.
What real resource cost does an open WebSocket connection impose that a typical stateless HTTP request doesn't?
True or false: SSE generally passes through existing proxies and corporate firewalls more transparently than WebSockets.
A code review finds a WebSocket handler that does JSON.parse(data) directly on incoming message data. What's the risk?
True or false: the browser's native EventSource API automatically handles reconnection on disconnect for SSE, with no custom client-side code required for that specific behavior.
What's the fundamental deciding factor between choosing WebSockets versus SSE, per this topic?
What does OAuth 2.0 fundamentally provide, on its own?
True or false: OpenID Connect (OIDC) is a completely separate protocol unrelated to OAuth 2.0.
Which token should an app use to determine the authenticated user's identity in an OIDC flow?
True or false: an attacker who intercepts the authorization code (e.g. via a browser history entry) can complete the token exchange without needing anything else.
Why does PKCE exist as an extension to the authorization code flow?
True or false: PKCE is now broadly recommended as a default for essentially all OAuth clients, not just ones that technically cannot hold a client_secret.
In the Implement It Yourself PKCE example, why does the attacker's guessed code_verifier fail verification?
True or false: skipping state parameter validation on an OAuth callback endpoint exposes the flow to a CSRF-style attack.
Why is embedding a client_secret in a mobile app's binary or in browser-shipped JavaScript considered unsafe?
True or false: the code-for-token exchange step happens directly from the browser to the identity provider, the same as the initial authorization redirect.
What's the recommended practice regarding the identity provider's own tokens once the OAuth/OIDC flow completes?
True or false: the extra redirect round-trips in the authorization code flow are considered an unnecessary performance cost that should be optimized away.
A code review finds an app decoding the access_token to extract a 'name' field for display purposes, assuming this works reliably across any OAuth provider. What's the issue?
True or false: 'sign in with Google' style flows work as authentication specifically because they combine OAuth 2.0 with OpenID Connect, not because of OAuth alone.
What specifically makes the authorization code safe to pass through the browser's less-trusted redirect channel, despite the risk of it appearing in browser history or referrer headers?
What is the current, accurate distinction between 'OpenAPI' and 'Swagger'?
True or false: an OpenAPI document is purely descriptive prose meant only for human reading, with no machine-readable structure.
In the Try It scenario, why does the generated TypeScript client compile fine but fail at RUNTIME?
True or false: this exact drift failure mode (spec says one thing, real API does another, generated client silently trusts the wrong spec) is structurally IMPOSSIBLE in tRPC's approach.
What is OpenAPI's genuine advantage over tRPC, named explicitly in this topic?
True or false: a hand-maintained OpenAPI spec that has drifted from the real API is generally considered WORSE than having no formal documentation at all.
What's the recommended way to prevent OpenAPI spec drift, per this topic?
True or false: OpenAPI's error response schemas can reference the same RFC 9457 problem-details format covered elsewhere in this course.
In the Implement It Yourself example, why does deriving the OpenAPI path doc from UserSchema (rather than hand-writing it) help prevent drift?
True or false: contract tests that verify a live API's actual behavior against its OpenAPI spec are a recommended practice for catching drift.
Why might a team choose OpenAPI over tRPC even for a project where both ends happen to currently be TypeScript?
True or false: Swagger UI is an example of tooling that CONSUMES an OpenAPI spec to produce interactive documentation, rather than being the spec format itself.
A code review finds a hand-written OpenAPI YAML file with no CI check verifying it matches the actual route implementations, on a codebase where routes change weekly. What risk should be flagged?
True or false: an OpenAPI document can only describe successful (2xx) responses, not error response shapes.
What does generating a client SDK from an OpenAPI spec fundamentally NOT protect against, that tRPC does structurally protect against?
What makes session cookies inherently, trivially revocable, unlike a stateless bearer token?
True or false: a bearer token is automatically attached to outgoing requests by the browser, the same way a cookie is.
In the Try It scenario, why are bearer tokens the better fit for a native mobile app compared to cookie-based sessions?
True or false: refresh token rotation alone, without checking for reuse of an already-invalidated token, provides the same theft-detection benefit as rotation WITH reuse detection.
In the implement-it-yourself token family example, what specifically triggers 'THEFT DETECTED' and family-wide revocation?
True or false: storing a bearer token in localStorage makes it directly readable by any JavaScript running on the page, including an XSS payload.
Why does the topic push back on the framing 'JWTs are stateless, so they're just better than sessions'?
True or false: HttpOnly and SameSite cookie attributes protect against the same specific attack.
Why is it recommended that a well-designed system commonly uses BOTH session cookies and bearer tokens, rather than picking just one universally?
True or false: a session-based approach is inherently always slower than a token-based approach due to requiring server-side state.
What does 'family-wide' refresh token revocation mean, and why revoke the WHOLE family rather than just the reused token?
True or false: bearer tokens are naturally immune to the classic cookie-based CSRF attack pattern.
A code review finds an SPA storing its access token in sessionStorage instead of relying on an HttpOnly cookie, with no other justification given. What should be flagged?
True or false: this app's own next-auth v5 configuration ships HttpOnly, Secure, and SameSite=Lax on its session cookie by default, confirmed in the CSRF topic's verification.
Why does a SHORT access-token lifetime matter even though the refresh token is the one that's actually revocable?
Confirmed via a real tsc compile this session, what happens when frontend code accesses a field that doesn't exist on the server's actual return type?
True or false: tRPC requires a separate schema definition language (like .proto for gRPC or an OpenAPI YAML file) to define its API contract.
What is the ONE hard constraint that makes tRPC's approach possible?
True or false: using `import type { AppRouter }` instead of a plain value import matters because it guarantees zero runtime bundle cost from server-only code.
Why is zod's runtime input validation still necessary even though TypeScript already provides compile-time type checking?
True or false: in the Try It scenario, renaming a server field from email to emailAddress causes the frontend build to fail at compile time, given a shared router type.
How does tRPC's approach to type safety fundamentally differ from gRPC's, per Under the Hood?
True or false: tRPC could reasonably be used between a TypeScript frontend and a Python backend by sharing types through some conversion tool.
What real mechanism does the Implement It Yourself example use to achieve dynamic property-based method calls while preserving compile-time types?
True or false: httpBatchLink can automatically combine multiple tRPC calls issued in the same tick into a single HTTP request.
When should a team choose gRPC over tRPC for a new internal service, per this topic's framing?
True or false: a tRPC compile error on a breaking API change should generally be treated as unwanted friction to work around.
A code review finds a project importing the server's full router implementation (not just its type) into client-side code. What's the risk?
True or false: tRPC requires each API endpoint to be manually documented in a separate specification file for the type safety to work.
Why is a monorepo (or equivalent type-sharing setup) typically required for tRPC to work in practice?
How does the BFF Token Handler pattern protect JWT access tokens from browser XSS attacks?
Which cookie parameter prevents the browser from transmitting cookies alongside cross-site requests, protecting against CSRF attacks?
What is the primary risk of using `Promise.all()` to aggregate data from multiple independent microservices?
Which JavaScript method should you use to run multiple API requests concurrently while catching errors individually for each query?
What is the primary purpose of the Circuit Breaker pattern in microservice gateways?
What does the 'Half-Open' state represent in a Circuit Breaker lifecycle?
What is the primary difference between a generic API Gateway and the Backend for Frontend (BFF) pattern?
Why does the BFF pattern improve performance for mobile users on cellular networks?
In BEM naming, what does `.card__title--large` represent?
What is the core organizing principle of ITCSS (Inverted Triangle CSS)?
In BEM, elements should be chained to reflect DOM nesting depth, e.g. `.card__header__title` for a title nested inside a header nested inside a card.
Why does every BEM-named class having the same specificity (a single class selector) matter architecturally?
What can traditional CSS-in-JS do that plain CSS Modules structurally cannot do as directly?
Traditional (non-zero-runtime) CSS-in-JS libraries like classic styled-components generate and inject CSS entirely at build time, with no work happening in the browser.
Why is traditional CSS-in-JS's runtime style injection model architecturally incompatible with React Server Components?
What does 'zero-runtime CSS-in-JS' (e.g. vanilla-extract) do differently from classic styled-components?
What is the fundamental difference between a CSS custom property and a Sass variable?
Why does `width: var(--base-width) + 10px;` not work as arithmetic, requiring calc() instead?
By default (without using @property), a custom property's value can be smoothly animated/transitioned by the browser, the same as a native property like opacity.
Which styling mechanism is specifically designed to cross the Shadow DOM encapsulation boundary, letting a host page theme a Web Component from outside?
What could CSS NOT do before `:has()` was introduced?
In CSS cascade layers, what determines which rule wins when two rules are in different layers?
`:where()` and `:is()` behave functionally identically for matching purposes, but `:where()` always contributes zero specificity while `:is()` takes the specificity of its most specific argument.
How does CSS cascade layers (@layer) relate to the ITCSS methodology?
What mechanism do CSS Modules use to guarantee class names never collide across different components?
CSS Modules have a runtime performance cost comparable to CSS-in-JS libraries, since both involve JavaScript processing of styles.
What happens when JSX references `styles.titel` (a typo) from a CSS Module import, without typed CSS Module tooling set up?
Which stage of the CSS rendering pipeline can `transform` and `opacity` changes skip entirely, making them cheap to animate?
A loop reads `element.offsetWidth` and immediately writes `element.style.width` for each of 100 elements, interleaved. How many synchronous layout recalculations does this typically force, and why?
Applying `will-change: transform` permanently to every animatable element in an application is a safe, cost-free way to improve performance broadly.
A page has many independent, self-contained widgets, and unrelated interactions elsewhere on the page feel sluggish whenever a widget updates. What CSS property is specifically designed to address this by limiting the 'blast radius' of each widget's internal changes?
Which of these Sass features has now been added natively to CSS, no longer requiring a preprocessor?
A Sass variable ($color) can be read or modified from JavaScript at runtime, the same way a CSS custom property can.
What is the main advantage of Sass's `@use` module system over the older, now-deprecated `@import`?
What Sass feature has no native CSS equivalent at all, remaining one of its clearest unique strengths?
What is the fundamental authoring-model difference between Tailwind's utility-first approach and traditional BEM-style semantic classes?
Why does `<div className={`bg-${color}-500`}>` cause a missing-style bug in a Tailwind production build?
In a component-based framework like React, the idiomatic way to avoid repeating a long Tailwind utility class list is to extract a reusable component, not necessarily to create a new @apply-based CSS class.
What is the purpose of Tailwind's constrained design token scale (e.g. only p-1 through p-96, a fixed color palette)?
What must be true for a `@container` query rule to have any effect?
An element with `container-type: inline-size` set on itself can use `@container` queries to respond to its own width.
A card component needs to lay out differently depending on whether it's placed in a wide page section or a narrow sidebar, at the SAME browser viewport width. What's the right tool?
What's the container query unit equivalent of `vw` (viewport width), scoped to the query container instead of the viewport?
With `flex-direction: column`, which property controls horizontal alignment of items?
Two flex items both have `flex: 1` inside a flex container. Item A contains one word, Item B contains three sentences of text. What are their relative widths?
The CSS `order` property changes an element's position in the DOM, which also updates keyboard tab order and screen reader reading order to match.
What's the difference between `justify-content: space-between` and `justify-content: space-evenly`?
What's the key functional difference between grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) and repeat(auto-fit, minmax(200px, 1fr))?
CSS Grid's `subgrid` value allows a nested grid item to inherit and align to its parent grid's actual track definitions, rather than creating independent tracks of its own.
An element has `position: absolute` with no ancestor that has a non-static position. What is it positioned relative to?
Raising a z-index value high enough (e.g. z-index: 999999) will always make an element render on top of everything else on the page.
Which CSS property on an ANCESTOR element can cause a descendant's `position: fixed` to unexpectedly scroll with the page instead of staying pinned to the viewport?
Without the viewport meta tag, what does a mobile browser typically do when rendering a page?
Why is mobile-first (min-width media queries) generally preferred over desktop-first (max-width)?
Using `px` units for font-size instead of `rem` has no meaningful accessibility impact, since both render at the same visual size by default.
A shared card-grid component looks correct on a full-width page but breaks when reused inside a narrow sidebar, even though the browser viewport is still desktop-wide. What's the root cause?
What specific capability does Framer Motion's `AnimatePresence` provide that pure CSS cannot replicate natively in a React app?
Animating the `width` property via a JavaScript animation library like GSAP avoids the layout-recalculation performance cost that animating width via plain CSS incurs.
For a simple 'fade in once when scrolled into view' effect with no scroll-scrubbing or complex sequencing, what's the most appropriate approach?
In a React component using GSAP to create an animation timeline inside a useEffect, why is a cleanup function (`return () => tl.kill()`) necessary?
An element animates from opacity:0 to opacity:1 via @keyframes, but reverts to invisible the instant the animation ends. What property fixes this?
What is the fundamental capability @keyframes animations have that CSS transitions lack?
JavaScript synchronously removes a CSS class that triggers an animation, then immediately re-adds the same class in the very next line. Does the animation restart?
animation-play-state: paused stops a running CSS animation and resets it to its starting keyframe.
What is the key difference between a CSS transition and a CSS @keyframes animation?
Which two CSS properties can be animated purely on the GPU compositor thread, without triggering a layout recalculation on every frame?
You can directly transition a property from a fixed value to `height: auto` and it will animate smoothly.
What's a real downside of using `transition: all` instead of listing specific properties?
Why do serverless environments (like AWS Lambda or Vercel Functions) frequently exhaust traditional SQL database connection limits?
What connection limit parameter (`connection_limit`) is recommended in connection strings for serverless Lambda functions?
What is a primary drawback of heavy ORM libraries like Prisma compared to SQL-like libraries like Drizzle or raw SQL?
Which of the following database queries is vulnerable to an SQL Injection attack?
What is the primary benefit of the 'Cache-Aside' pattern in database design?
What happens in Redis when memory limits are reached if the eviction policy is set to `noeviction`?
According to the CAP Theorem, what happens to a distributed database if a network partition (P) occurs?
When is a NoSQL Document database (like MongoDB) preferred over a Relational SQL database?
What happens in MongoDB if you perform an update without using an update operator like `$set`?
Which query operator would you use to append an item to an array field in a MongoDB document?
If you have a compound index on `{ companyId: 1, age: 1 }`, which of the following queries will NOT be able to utilize this index?
What does a `COLLSCAN` status in MongoDB explain stats represent?
What is the primary risk of using `ReadPreference.secondary` for application queries?
What happens if a monotonically increasing field (like a timestamp) is selected as the Shard Key in MongoDB?
What is the default isolation level of MongoDB transactions, and what does it prevent?
What is a primary risk of long-running transactions in MongoDB?
How does Mongoose's `.populate()` resolve linked references behind the scenes?
Which option must be enabled to enforce validation rules during update operations like `updateOne`?
What is the primary purpose of the 'Expand-and-Contract' pattern in database schema migrations?
Which SQL command should you use in production PostgreSQL to create an index without locking concurrent write queries?
How does Prisma achieve compile-time type safety for database queries?
What is the consequence of querying relationships by calling Prisma operations inside a `.map()` loop?
What does an `Index Only Scan` represent in an SQL explain plan?
Why does writing `WHERE YEAR(created_at) = 2026` fail to utilize a standard index built on `created_at`?
What is the difference between an `INNER JOIN` and a `LEFT JOIN` in SQL?
What design rule is violated if a non-key column in a table depends on another non-key column?
Which isolation anomaly occurs when a transaction reads the same row twice and gets different values because another transaction modified and committed the row in between?
How does PostgreSQL handle concurrent writes that conflict under `SERIALIZABLE` isolation?
How does GitHub Actions run separate Jobs declared in a workflow file by default?
Where should production API tokens be stored for use in GitHub Actions workflows?
What is the primary benefit of using Multi-Stage Builds in a Dockerfile?
Why should `COPY package.json ./` and `RUN npm install` be placed before `COPY . .` in a Dockerfile?
What happens in Next.js if you try to access an environment variable that does NOT have the `NEXT_PUBLIC_` prefix inside a browser Client Component?
Why should environment variables be validated using schemas like Zod at server startup?
What is the primary technical reason why Edge runtimes (like Cloudflare Workers) achieve near-zero cold start times compared to Serverless functions?
Why will writing files to the local disk fail to persist on platforms like Vercel or Netlify?
What is the difference between a Liveness probe and a Readiness probe in container monitoring?
Why is running heavy database calculations inside a health-check endpoint considered an anti-pattern?
How does Express differentiate a generic middleware function from an error-handling middleware function?
Why should raw error stack traces (`err.stack`) be stripped from API response payloads in production environments?
Which encoding format must be set on client forms to send binary files to an Express server?
What is the primary risk of using Multer's default Memory Storage for file uploads?
What happens if a middleware function neither calls `next()` nor sends a response via `res`?
How should middleware pass a runtime error to Express's global error-handling stack?
Which HTTP status code is the correct semantic response when a client submits a POST request that successfully creates a new resource?
What happens to the `req.body` parameter if `app.use(express.json())` is missing from the Express setup?
How does Express evaluate route matching when multiple routes match the same incoming request path?
What error occurs if code execution in a handler continues after `res.send()` and reaches another response statement?
What is the difference between Authentication and Authorization in web security?
Which HTTP status code is the correct semantic response when a user presents a valid token but lacks the roles needed to access the route?
What does a preflight request represent, and which HTTP method does it execute under?
Why will a browser block a cross-origin API call if the server responds with `Access-Control-Allow-Origin: *` and the fetch includes `{ credentials: 'include' }`?
What is the primary responsibility of a Controller in the MVC pattern?
Why is Path (URI) versioning (like `/v1/` and `/v2/`) preferred in public API design?
What header is stripped when you run `app.disable('x-powered-by')` or register Helmet?
Why must you configure `app.set('trust proxy', 1)` in Express when applying rate limiters behind a load balancer?
Why should `app.listen()` be kept in a separate file from the main Express routes export file when writing test suites?
Which Supertest method would you use to verify that a route accepts POST JSON payloads successfully?
What is the primary benefit of using Schema Validation libraries (like Zod or Joi) over manual controller checks?
Why do query parameters like `/api?limit=5` require type transformation inside schema validators?
In Vite's dev mode, how does it serve your application?
Why does Rollup produce smaller library bundles than Webpack?
What is the purpose of `[contenthash]` in Webpack/Vite output filenames?
In the Network waterfall, a request shows a large green TTFB segment. What does this indicate?
You want to find a JavaScript memory leak. What is the correct sequence using the Memory panel?
What is a 'Logpoint' in DevTools Sources panel?
What is the purpose of `eslint-config-prettier`?
What does lint-staged do that plain ESLint pre-commit hooks don't?
What happens when you run this Node.js code (package.json has no `type` field)?
Why can't CommonJS `require()` load an ES module synchronously?
What does `export default` vs named `export` mean for tree shaking?
What does `^18.2.0` mean in `package.json`?
What is a 'phantom dependency' in the context of npm?
What is the difference between `npm install` and `npm ci`?
What is the difference between `.match(/pattern/)` and `.match(/pattern/g)`?
What does `(?<=\$)\d+` match in the string '$100 and 200'?
A developer changes an element's `left` property via JS inside a `requestAnimationFrame` callback. What rendering steps does this trigger?
What does the following code cause, and why is it a performance problem?
Which CSS properties can be animated at 60fps without triggering layout or paint?
An element has `display: none`. Is it in the render tree?
A CNAME record for `api.example.com` points to `backend.myapp.io`. DNS TTL is 300s. You change the CNAME to point to `backend2.myapp.io`. How long at most before all users see the change?
TLS 1.3 achieves 1 RTT for the handshake. What is the key mechanism that allows this vs TLS 1.2's 2 RTTs?
What does `Strict-Transport-Security: max-age=31536000; includeSubDomains` mean?
What is the key difference between HTTP/2 multiplexing and HTTP/1.1 pipelining?
A user is authenticated but tries to access a resource they don't have permission to see. What status code should the server return?
An API response includes `Cache-Control: no-cache`. A browser makes the same request an hour later. What happens?
Which HTTP/3 feature specifically eliminates TCP head-of-line blocking?
In what order does the browser check caches before making a network request?
How many round trips does a brand-new HTTPS connection over TLS 1.3 require before the first byte of HTTP response?
A `<script src='app.js'>` tag (no async/defer) is placed in `<head>`. What happens?
You add `Cache-Control: private, max-age=3600` to an API response. What does this mean?
Which of the following is considered an Atom in Atomic Design?
What distinguishes a Template from a Page in this hierarchy?
How does the Dependency Inversion Principle apply to frontend API integration?
In Frontend Clean Architecture, where do Custom React Hooks typically fit?
What are design tokens in a design system?
What is a primary benefit of building components in Storybook?
What is the primary benefit of feature-based folder organization?
Why is a root-level `index.ts` (barrel file) important in a feature directory?
What is the primary benefit of Preview Deployments in frontend development pipelines?
Why should you build your application once and promote the same artifact, rather than rebuilding for production?
What is a primary benefit of using Feature Flags alongside trunk-based development?
What is the flash of layout shift called when a client-side feature flag evaluation resolves after initial render?
What is the purpose of CSS Logical Properties in internationalization?
Which native JS object should you use to format currencies internationally without third-party dependencies?
What is the primary role of the App Shell in a Micro Frontend architecture?
How should decoupled Micro Frontends communicate to prevent tight coupling?
What does a 'Remote' represent in Module Federation?
Why is setting `{ singleton: true }` important for libraries like React in shared configurations?
What is the role of workspaces in package managers like pnpm or Yarn?
How does Turborepo speed up builds via Caching?
Why should source maps be uploaded to error trackers like Sentry but deleted from public CDN directories?
What are 'breadcrumbs' in error tracking tools like Sentry?
Confirmed via the currently-installed web-vitals v5.3.0 library's own exports, what are the three CURRENT Core Web Vitals?
True or false: FCP (First Contentful Paint) is itself one of the Core Web Vitals.
Confirmed via LCPThresholds ([2500, 4000]), what rating does a 3200ms LCP receive?
True or false: CLS only accounts for layout shifts that happen during the initial page load.
Why did INP replace FID as the responsiveness Core Web Vital?
True or false: a page can have a fast FCP and a slow LCP simultaneously.
What does the 'rating' field on a web-vitals Metric object represent?
True or false: navigator.sendBeacon is preferred over a normal fetch() call for reporting vitals specifically because it reliably delivers even if the page is being unloaded right after the call.
What's the most common, most fixable cause of poor CLS?
True or false: real-user 'field' data (via the web-vitals library) and lab data (via Lighthouse) answer the exact same question and are redundant with each other.
Why does a page that's snappy on its first click but janky on a later interaction now get correctly penalized under INP, unlike under the old FID metric?
True or false: LCP improvements are primarily about raw download bandwidth, not resource discovery/priority timing.
A team reports 'Our Core Web Vitals are LCP: good, FID: good, CLS: good' in a status update. What should be flagged?
True or false: CLS is measured in milliseconds, the same unit as LCP and INP.
Why do LCP and CLS both trace back to the browser's paint/layout pipeline, per Under the Hood?
True or false: onLCP, onCLS, and onINP are the only vitals-related functions the web-vitals library exports.
What does the metric.id field on a reported Web Vitals metric protect against?
True or false: DevTools' Performance panel and the web-vitals library are measuring fundamentally different underlying browser events.
A hero image is the largest element on a page, but it's referenced only via a CSS background-image property, discoverable only after the CSS file finishes loading. What Core Web Vital is most directly affected?
True or false: Core Web Vitals are used only for internal team performance tracking and have no relationship to Google Search ranking.
What does Lighthouse actually do to produce its report?
True or false: the Lighthouse Performance score is a simple average of the Core Web Vitals.
In the Try It scenario, why does a page with 'good' LCP AND 'good' CLS still get a mediocre overall Lighthouse score?
True or false: Total Blocking Time (TBT) has a direct, equivalent field-measured Core Web Vital.
Why does Lighthouse apply simulated throttling by default, regardless of the actual machine running the audit?
True or false: the full performance trace Lighthouse records uses the same underlying Chrome tracing infrastructure as DevTools' own Performance panel.
What does a very poor Total Blocking Time typically indicate is happening during page load?
True or false: chasing a perfect 100 Lighthouse score as a goal disconnected from real-user field data is a recommended practice.
In the implement-it-yourself weighted score calculator, why does a TBT sub-score of 25 (out of 100) have such an outsized effect on the final composite score of ~74?
True or false: running Lighthouse in CI on every deploy is recommended specifically to catch performance regressions immediately when they're introduced.
Why should Lighthouse's specific optimization suggestions be treated as an investigation starting point rather than a literal checklist?
True or false: a disagreement between Lighthouse (lab) scores and real-user (field) Web Vitals data always means one of the two measurements is broken or wrong.
A team sees LCP: good, CLS: good in their field data dashboard but a Lighthouse CI check just failed a score threshold. What's the most likely next diagnostic step?
True or false: each individual metric in Lighthouse's composite score first gets converted to its own 0-100 sub-score via a scoring curve, before being combined by weight into the final number.
Why is running Lighthouse in CI on every single commit a real tradeoff, not a free choice?
What does a 'memory leak' actually mean in a garbage-collected language like JavaScript?
True or false: removing a DOM element from the document (el.remove()) automatically makes it and its associated data unreachable and eligible for garbage collection.
In the Try It scenario, why does hugeData remain reachable even though onClick only references summary?
True or false: a growing heap size observed while using an app is, by itself, sufficient proof of a memory leak.
What is the actual technique for confirming a suspected leak, per this topic?
True or false: an event listener registered on an element that's later removed from the DOM will always be automatically cleaned up.
Why is a detached DOM node still held in a JS array (like the `detachedNodes` pattern) a genuine leak risk?
True or false: this topic's reachability-based leak model is a separate concept from normal garbage collection mechanics, requiring its own distinct mental model.
Why does the topic recommend scoping large data OUT of long-lived closures when only a derived value is needed later?
True or false: a small per-operation memory leak matters more for a long-running single-page app than for a page that reloads frequently.
A code review finds a WebSocket message handler that pushes every received message into a module-level array with no size limit or clearing logic, in an app users leave open for hours. What's the risk?
True or false: forcing garbage collection manually is something that should be done routinely in production code to prevent leaks.
What's the fundamental shared mechanism across all three leak patterns covered in this topic (event listeners, detached DOM references, over-capturing closures)?
True or false: DevTools' heap snapshot comparison feature (in the Memory panel) is specifically built for the before/after leak-confirmation technique described in this topic.
In the Implement It Yourself example, why does simulateFixedOperation() NOT contribute to heap growth the way simulateLeakyOperation() does?
Confirmed via this app's own bundled Next.js 16 docs, what happened to Turbopack starting in Next.js 16?
True or false: @next/bundle-analyzer works identically whether a project uses webpack or Turbopack.
What is next experimental-analyze, confirmed by actually running it this session?
True or false: a raw chunk file size number alone tells you exactly which specific dependency or module to fix.
In the Try It scenario, what could cause formatCurrency and debounce to remain in the final bundle even though only formatDate is imported?
True or false: tree-shaking generally applies the same way to CommonJS require() as it does to ES module import statements.
Why should bundle analysis be re-run after adding a significant new dependency, per this topic?
True or false: in the implement-it-yourself example, the analyzeChunkSizes function attributes bytes to specific SOURCE MODULES within a chunk, the same way a real interactive analyzer UI does.
Confirmed against this app's own real .next/static/chunks output, what was the largest single observed chunk size?
True or false: bundle analysis has a meaningful runtime performance cost in production.
A team runs ANALYZE=true npm run build on their Next.js 16 project (using default Turbopack) expecting @next/bundle-analyzer's report, but gets no analyzer output. What's the most likely explanation?
True or false: next experimental-analyze can filter its module inspection by route, environment (client/server), and file type.
Why does the topic connect bundle analysis directly to the memoization topic's recommended workflow?
True or false: a namespace import (import * as utils from './utils.js') is generally at LEAST as tree-shakeable as specific named imports.
What's the actual value of bundle analysis tooling's byte-attribution capability, per this topic's Performance Tips?
Confirmed by running this app's own production build, what splitting happens automatically with zero manual dynamic() calls?
True or false: automatic route-based splitting also handles splitting a heavy, rarely-used component WITHIN a single page (e.g., only needed after a specific button click).
What's the real tradeoff introduced by wrapping a component in dynamic()?
True or false: in the Try It scenario, splitting out a Modal that nearly every user opens immediately is likely to make the EXPERIENCED latency worse, not better.
What does the `loading` option on dynamic() actually improve?
True or false: ssr: false should be used as the default setting on every dynamic() call, regardless of the component.
In the Implement It Yourself example, why does calling heavyModule.load() twice concurrently NOT trigger two separate network requests?
True or false: manually wrapping a component in dynamic() when it's only ever rendered on its own separate route provides a real, additional benefit beyond what automatic route-based splitting already does.
Why should bundle analysis (measurement) generally precede a decision to split out a specific component?
True or false: the real, confirmed chunk sizes from this app's build ranged up to 228KB for a single chunk file.
A code review finds a heavy date-picker library wrapped in dynamic() with no loading fallback, used in a form field most users interact with within the first few seconds of landing on the page. What should be flagged?
True or false: this app's build confirmed that Next.js automatically separates framework/vendor code from application-specific code into different chunks.
What determines whether splitting out a specific component is a net win, per this topic's framing?
True or false: the actual network/parse cost of a dynamically-imported module, once resolved, is paid again on every subsequent call to load it.
Why is 'should we code-split this app' framed as usually the wrong question in this topic?
Confirmed against this app's own bundled Next.js 16 docs, what happened to the `priority` prop on next/image?
True or false: the current documentation recommends using `preload` as the default choice for any image that needs to load quickly.
Why does next/image require width/height (or a sized fill container)?
True or false: in the Try It scenario, setting preload on the small logo instead of the hero banner is likely correct if the hero banner is actually the LCP element on most viewports.
What underlying browser mechanism does next/image's preload prop actually generate?
True or false: the srcset/sizes mechanism lets the BROWSER decide which image size to download, based on the actual device, rather than requiring JavaScript-side device detection.
Why does the documentation specifically warn against preload when multiple images could be the LCP element depending on viewport?
True or false: next/image lazy-loads images by default using native browser lazy loading.
A developer follows an older tutorial and writes `<Image src="/hero.jpg" priority />` on this app's actual installed Next.js version. What's the accurate assessment?
True or false: remotePatterns configuration is required before next/image will serve images from an external (non-local) domain, as a deliberate security boundary.
Why is automatic format conversion to WebP (where supported) described as a 'close-to-free win'?
True or false: this topic's verification approach for next/image claims used the SAME method (checking this app's own bundled documentation) as the standing verification method for the rest of the Next.js domain.
What happens if a next/image component uses `fill` without a properly sized parent container?
True or false: setting fetchPriority="high" is explicitly mentioned in the current documentation as a preferred alternative to preload in most cases.
Why does verifying prop names/behavior against the actual installed framework version matter specifically for image-optimization code, per this topic?
Confirmed against this app's own bundled Next.js 16 docs, what is the current status of the React Compiler?
True or false: useMemo and useCallback solve the exact same problem and are interchangeable.
In the Try It scenario, why does ExpensiveChild still re-render despite being wrapped in React.memo?
True or false: useMemo's dependency comparison uses deep equality, correctly detecting when two different object references have identical contents.
Why is memoizing a trivially cheap calculation (like x * 2) often counterproductive?
True or false: React.memo and useCallback are usually most effective when used TOGETHER, since one alone frequently accomplishes nothing.
Why does this topic explicitly warn against assuming React Compiler is 'already handling this automatically'?
True or false: memoization is a pure performance win with no real tradeoff or cost.
What specifically does the memoize() function in Implement It Yourself use to decide whether to recompute?
True or false: profiling to confirm a re-render or recalculation is genuinely expensive is recommended as a step BEFORE reaching for memoization.
A code review finds `<Child data={{ id: props.id }} />` passed to a React.memo-wrapped Child on every render of the parent. What's the issue?
True or false: the React Compiler, once enabled, aims to make manual useMemo/useCallback/React.memo largely unnecessary by inserting equivalent optimizations automatically at build time.
Why does this topic explicitly avoid framing manual memoization as 'obsolete' despite React Compiler being stable?
True or false: useMemo still executes on every render — it just skips running the expensive callback function if dependencies are unchanged.
What real, current path exists for reducing how much MANUAL memoization a team needs to hand-write, per this topic?
Confirmed via this topic's exact walkthrough, what real LCP improvement did adding a preload hint produce?
True or false: preload, prefetch, and preconnect are essentially interchangeable ways of saying 'load this faster.'
What happens, confirmed as real browser behavior, if a preloaded resource isn't actually used within a few seconds?
True or false: prefetch guarantees a resource will be fully downloaded before a likely future navigation actually happens.
What does preconnect actually do, mechanically?
True or false: dns-prefetch performs the same full connection setup as preconnect, just with a different name.
In the Try It scenario, why is prefetch the wrong hint for the checkout-bundle scenario specifically?
True or false: preconnect has zero cost even if the connection ultimately goes unused.
How do resource hints (preload/prefetch/preconnect) relate to HTTP caching (Cache-Control/ETag), per Under the Hood?
True or false: preconnect's latency-saving benefit is most pronounced on higher-latency (e.g. slower mobile) connections.
A page includes <link rel="preload" as="font" href="/rare-font.woff2"> for a font only used on a settings page most users never visit from the current page. What's the likely observable consequence?
True or false: resource hints are extremely cheap to ADD (a single link tag) but 'cheap to add' does not mean 'free of consequence if misapplied.'
Why does the hero-image-via-CSS-background scenario in the WaterfallVisualizer walkthrough delay LCP without preload?
True or false: a framework's own navigation-level prefetching (e.g. covered in the Next.js Performance topic) is necessarily identical in behavior to the raw HTML prefetch resource hint.
What's the fundamental difference in what preload/prefetch DO versus what preconnect DOES?
Confirmed against this app's own bundled Next.js 16 docs, what does enabling cacheComponents do to the App Router's data-fetching default?
True or false: this app's own actual configuration has cacheComponents enabled.
What does Partial Prerendering (PPR), as implemented by cacheComponents, actually do?
True or false: confirmed via the bundled docs, navigating away from a route under cacheComponents always fully unmounts that route's components.
In the Try It scenario, why does the ExpandableSection remain expanded after navigating away and back?
True or false: a component's mount-only initialization logic (empty-deps useEffect) is guaranteed to re-run every time a user 'returns' to that route under cacheComponents's navigation model.
What is the granularity of caching decisions under the confirmed cacheComponents model, via the 'use cache' directive?
True or false: Next.js keeps an unlimited number of previously-visited routes hidden via Activity, with no limit.
How does a static-shell-first pattern (PPR) directly benefit LCP specifically, per this topic?
True or false: verifying whether cacheComponents is actually enabled in a specific project is necessary before reasoning about its behavior, per this topic's recommended practice.
A team assumes 'we're on Next.js 16, so our forms reset automatically every time a user navigates back to this page.' What's the risk in this assumption?
True or false: the static-shell-plus-streaming pattern requires blocking the entire response until the slowest dynamic data resolves, the same as the older all-or-nothing model.
What happens to a component's EFFECTS (not its state) when its route is set to Activity 'hidden' mode?
True or false: granular, function-level 'use cache' decisions allow caching the reusable/shared portions of a page's data while keeping genuinely personalized portions dynamic, within the same route.
Why does this topic explicitly distinguish itself from the shipped nextjs.performance topic in the general Next.js domain?
Demonstrated live in the stale-closure preset, what happens with an effect that has an empty dependency array but reads a state variable inside a setInterval callback?
True or false: confirmed against this app's own bundled Next.js 16 docs, useEffectEvent is a genuinely new React 19.2 hook, not a training-data hallucination or a third-party library.
What specifically does useEffectEvent solve, per its confirmed purpose?
True or false: in the Try It scenario, keeping `query` in the effect's dependency array alongside using useEffectEvent for the search callback is a mistake.
What is the key distinguishing question for deciding whether a value belongs in a dependency array versus inside a useEffectEvent-wrapped function?
True or false: a manual useRef-based 'latest value' workaround for the stale-closure problem stopped working once useEffectEvent shipped.
What does list virtualization fundamentally do?
True or false: virtualization should be applied to every list component regardless of size, as a general best practice.
In the implement-it-yourself getVisibleRange function, what is 'overscan' for?
True or false: virtualization and memoization (React.memo etc.) solve the exact same problem and are redundant with each other.
Why is adding a value to a dependency array 'just to silence a lint warning,' without considering whether it should genuinely be reactive, flagged as a mistake?
True or false: there's a real crossover point where virtualization's own overhead can exceed its benefit for small enough lists.
A code review finds useEffectEvent used to wrap an ENTIRE effect body, with the surrounding useEffect having an empty dependency array despite the effect's timing genuinely needing to restart on a specific prop change. What's the issue?
True or false: this topic's stale-closure demonstration and its confirmed fix both come from real, verified sources — a live shipped component (HookTimeline) and this app's own bundled Next.js 16 documentation, respectively.
What real DOM/reconciliation cost does virtualization avoid for a 10,000-item list?
Demonstrated live in the parent-cascade demo, what is React's DEFAULT behavior when a component's state changes?
True or false: in the memo-boundary demo, a memoized component that receives a genuinely changing prop re-rendering every time is a memoization FAILURE.
Demonstrated live in context-blast, why does a React.memo-wrapped component still re-render when a context value it subscribes to changes?
True or false: per the Try It scenario, a memoized component that does NOT call useContext for the changed context still correctly stays frozen when that context value changes.
What is the actual fix for the context-bypass-memo problem, since React.memo itself cannot address it?
True or false: combining several unrelated pieces of state into one large context object is generally a GOOD practice for simplifying provider setup.
Why does this topic emphasize that all its demonstrations come from the ALREADY-SHIPPED RenderVisualizer component?
True or false: a re-render is always wasteful and should always be the target of an optimization effort.
Why can a memoized component still cascade re-renders despite React.memo, even without any context involvement?
True or false: splitting contexts has no real tradeoff and should be applied to every context in an application by default.
A code review finds a large AppContext holding { theme, user, cartItems }, with a component that only reads `theme` wrapped in React.memo. The cartItems update frequently. What's the actual re-render behavior of that theme-only component?
True or false: this topic's rendering-optimization coverage and the React Performance Patterns topic build on the exact same underlying React.memo/context mechanics, just at a broader applied-patterns level in the latter.
Why is understanding the context-bypass gotcha described as 'genuinely high-leverage' in Performance Tips?
True or false: React DevTools' Profiler is mentioned as a way to verify whether a suspected rendering optimization actually worked, rather than just assuming it did.
What's the precise, narrow, actionable version of the context-bypass gotcha, per the Try It solution?
For a query returning a list of N users, each with a nested posts field resolved via a separate database call per user, how many total queries fire?
True or false: DataLoader's batch function is confirmed to receive DEDUPLICATED keys — a duplicate key requested via .load() twice only appears once in the batch.
Two .load() calls issued synchronously back-to-back, and a third issued inside a setTimeout callback — how many total batch calls fire, confirmed by execution?
True or false: DataLoader's batching window is a fixed time duration (like 10ms), rather than being tied to the event loop's tick structure.
Why is sharing a single DataLoader instance across multiple requests a serious bug, not just a minor inefficiency?
True or false: the correct pattern is creating one DataLoader instance at server startup and reusing it for the lifetime of the server process.
What's the most reliable diagnostic signature of an N+1 problem, as opposed to other causes of slow responses?
True or false: the N+1 problem is typically invisible during local development with small datasets and only becomes apparent at production scale.
What underlying JavaScript mechanism does DataLoader's batching rely on for its collect-then-flush behavior?
True or false: DataLoader's resolver code change from the naive N+1 version to the batched version is minimal — largely just swapping a direct fetch call for a loader.load() call.
What's the key structural difference between a typical REST API and a GraphQL API?
True or false: multiple top-level mutation fields in a single operation are guaranteed by the GraphQL spec to execute serially, one completing before the next starts.
Are top-level QUERY fields guaranteed to execute in the order they're written, the same way mutation fields are?
True or false: variables should be avoided in favor of directly interpolating values into the query string, for simplicity.
True or false: a fragment is a named, reusable set of fields for a given type that can be spread into multiple queries.
Why does GraphQL guarantee serial execution specifically for mutations but not queries?
True or false: fragments have a measurable runtime performance cost during query execution.
A client needs to fetch the same 'greeting' field twice in one query, once for name 'A' and once for name 'B'. What's required to do this correctly?
True or false: the response shape of a GraphQL query always exactly mirrors the shape of the query itself.
What does declaring a variable as $who: String! (with the exclamation mark) mean?
True or false: because query field ordering is unspecified, a well-implemented server can resolve independent sibling query fields concurrently, a real performance opportunity mutations don't have.
True or false: when a non-null field's resolver throws, only that specific field becomes null in the response, leaving sibling fields unaffected.
Given `type Query { user: User }` (nullable) and a failing non-null `name` field inside User, where does the null bubbling stop?
True or false: if EVERY field from the failing one up to the root is non-null, the null bubbling can wipe out the entire response, making `data` itself null.
True or false: a client selects type-specific fields from a union using inline fragments, like `... on Book { title }`.
True or false: marking every field non-null by default, reflexively, is a recommended schema-design practice.
What's a genuine tradeoff of code-first schema frameworks (like Pothos/Nexus) compared to schema-first (writing SDL directly)?
True or false: poor nullability choices can indirectly hurt performance/UX by forcing a client to re-fetch an entire response when only one deeply-nested field actually failed.
What's the fundamental difference between a subscription and a query/mutation?
True or false: subscriptions-transport-ws is confirmed deprecated, with its own published notice recommending graphql-ws as the replacement.
On the current version of graphql-subscriptions (v3), which PubSub method is confirmed to actually exist for creating a subscribable async iterable?
True or false: calling the older asyncIterator() method name from an outdated tutorial against the current graphql-subscriptions package will silently work with slightly different behavior.
When multiple clients are subscribed to the same event, and pubsub.publish() is called once, how many of them receive the pushed payload?
True or false: a subscription resolver's subscribe function must return (or resolve to) an async iterable.
When should pubsub.publish() be called relative to a mutation's actual database write?
True or false: an open subscription connection consumes server resources only briefly, similar to a typical query's request/response cycle.
Why can't code written for subscriptions-transport-ws simply be pointed at a graphql-ws server without changes?
True or false: variables, aliases, and fragments (covered in Queries & Mutations) still work inside a subscription operation's selection set.
Confirmed directly: in the currently installed Apollo Client version, where do useQuery and useMutation live?
True or false: ApolloClient and InMemoryCache, the core client/cache classes, are still importable from the root @apollo/client package in v4.
What does Apollo Client's normalized cache do when two DIFFERENT queries both return an object with the same __typename and id?
True or false: updating one entity's data in the cache (e.g. via a mutation response) automatically updates every OTHER query result that references that same entity, with no manual sync code needed.
Why is including __typename and id in a mutation's response selection important?
True or false: useQuery and useMutation are built on entirely custom React internals, unrelated to standard React hooks rules.
A developer upgrades from Apollo Client 3 to 4 and their app fails with 'useQuery is not a function.' What's the most likely cause?
True or false: normalization means storing every fetched object as a completely flat, deeply-copied entry with no shared references, to keep queries independent of each other.
What's a practical performance benefit normalization provides, beyond just avoiding duplicate storage?
True or false: cache.identify() is recommended over manually constructing cache-entry ID strings by hand.
Confirmed directly: what happens when attempting to resolve the `apollo-server` package in this project's dependency tree?
True or false: ApolloServer instances in the current major version have a .listen() method, the same as older versions.
What does startStandaloneServer confirmed to do, based on real execution?
True or false: mounting Apollo Server into an existing Express app requires a separate, dedicated integration package rather than something bundled directly into @apollo/server.
How often is the context function called, confirmed by direct testing?
True or false: the context function's per-request execution is the actual mechanism that makes the DataLoader-per-request best practice implementable.
What's a common mistake when migrating from startStandaloneServer to an Express integration?
True or false: Apollo Server's standalone and Express integration modes run on top of Node's own http module underneath, rather than replacing it with something else.
Why does creating a DataLoader at module scope (outside the context function) defeat its purpose?
True or false: verifying Apollo Server code/tutorials against the actually-installed major version is unnecessary, since the API has been stable across all versions.
What does Apollo Client's default fetchPolicy, 'cache-first', actually do?
True or false: cache.readQuery() throws an error when nothing has been cached for the given query yet.
What's the key difference between network-only and no-cache fetchPolicy values?
True or false: server-side/CDN caching (via @cacheControl) and Apollo Client's normalized cache solve the same problem for the same audience.
Why are GraphQL requests normally NOT cacheable by standard HTTP/CDN caching, unlike a typical REST GET endpoint?
True or false: Automatic Persisted Queries are confirmed to be built into Apollo Server's core package, not a separate required plugin dependency.
What does a persisted query send on repeat requests, instead of the full query text?
True or false: cache-and-network returns cached data immediately (if available) AND fires a network request anyway, updating the UI again once it resolves.
Once data IS written to the cache under any fetchPolicy (including network-only), what still applies?
True or false: server-side response caching reduces backend compute/database load across all clients, a benefit client-side caching alone cannot provide.
What does the @key directive on a type declare in a federated subgraph?
True or false: __resolveReference is confirmed to be the resolver called when another subgraph has only an entity's key fields and needs the rest of the entity filled in.
Confirmed via Apollo's own current guidance: what is now recommended for the production federation gateway/router layer, instead of the older @apollo/gateway Node.js package?
True or false: individual subgraphs also need to be rewritten in Rust to work with the modern Apollo Router.
Is @apollo/gateway (the older Node.js gateway) still usable at all?
True or false: buildSubgraphSchema is required (instead of a plain schema-building function) specifically because federation needs additional machinery wired up beyond a standalone GraphQL schema.
In the _entities query mechanism confirmed via real execution, what does the router send to a subgraph to resolve an entity reference?
True or false: a type marked @key without a corresponding __resolveReference resolver is a complete, correctly functioning federated entity.
What's the key structural difference between federation's entity model and older schema-stitching approaches?
True or false: entity reference resolution should ideally be batched (multiple references resolved in one call) rather than resolved one at a time, for the same reasons covered in the N+1 Problem topic.
Confirmed via execution: at what stage does query depth limiting reject an overly deep query?
True or false: a query that's shallow (low nesting depth) but requests very large lists via pagination arguments (like first: 10000) is guaranteed to be caught by depth limiting alone.
What does query complexity analysis add beyond what depth limiting alone provides?
True or false: confirmed by execution, setting introspection: false on Apollo Server genuinely blocks __schema/__type queries with a real error, rather than just hiding a UI toggle.
What's the genuine tradeoff of leaving introspection enabled on a public production GraphQL endpoint?
True or false: persisted queries in strict mode (rejecting any non-registered query) close off the entire class of 'attacker crafts a novel expensive query' attacks, since only pre-approved query shapes can execute at all.
Why does rejecting an expensive query at the validation stage (before execution) matter for performance, not just security?
True or false: rate limiting alone (capping request volume) is sufficient protection without also needing query-level depth/complexity controls.
What general security principle from Node.js security does query depth/complexity limiting directly apply to the GraphQL context?
True or false: it's recommended to configure both depth limiting AND complexity limiting together for a production API, rather than choosing just one.
Why does setting a canvas's size via CSS (e.g. `canvas { width: 800px }`) instead of the width/height HTML attributes cause blurry rendering?
By default, content drawn to a <canvas> element is part of the accessibility tree and announced by screen readers.
Why is requestAnimationFrame preferred over setInterval for Canvas animation?
Why is IntersectionObserver preferred over a scroll event listener + getBoundingClientRect() for detecting when an element enters the viewport?
What is the fundamental limitation of a Web Worker compared to main-thread JavaScript?
Calling e.preventDefault() inside a 'dragover' event handler is required for the corresponding 'drop' event to fire at all.
Why can't you use CSS `fill: blue` from the host page to change the color of an SVG embedded via `<img src="icon.svg">`?
SVG is fundamentally an 'immediate-mode' format, like Canvas — shapes are pixels with no retained DOM representation.
What is the standard pattern for reusing the same icon dozens of times across a page without duplicating its path data?
Why must every custom element name contain a hyphen (e.g. `user-card`, not `usercard`)?
A component's global page CSS rule `user-card .title { color: red }` has no effect on markup inside that component's shadow DOM. Why?
Content placed inside a <template> element is immediately rendered and visible in the page, just like a <div>.
Which custom element lifecycle callback is the correct place to do initial setup like fetching data or attaching event listeners?
Which client-side storage mechanism is automatically sent to the server with every matching HTTP request?
Why is an HttpOnly cookie safer than localStorage for storing an auth token, specifically with respect to XSS?
The 'storage' event fires in the same tab/window that made the localStorage change, allowing you to react to your own writes.
You need to store thousands of structured records with the ability to query by an indexed field, entirely offline. Which storage mechanism fits best?
What WCAG conformance level is the practical baseline referenced by most legal accessibility requirements (ADA case law, EN 301 549, AODA)?
What's wrong with assigning tabindex="1", tabindex="2", tabindex="3" to manually control tab order?
A Lighthouse accessibility score of 100 is a reliable guarantee that a product is fully usable by screen reader users.
When a modal dialog closes, where should keyboard focus go?
What is the key difference between aria-live="polite" and aria-live="assertive"?
Setting aria-expanded="false" in the initial HTML markup is sufficient — screen readers will detect the actual open/closed state automatically once JavaScript toggles a CSS class.
aria-hidden="true" is applied to a <button> that remains visually visible and clickable. What's the resulting bug?
What is the primary accessibility problem with using `placeholder` instead of `<label>`?
Which HTML input attribute lets you inspect exactly *why* validation failed (e.g. tooShort vs. typeMismatch vs. valueMissing) via JavaScript?
Client-side HTML form validation (required, pattern, type constraints) is sufficient security and doesn't need to be duplicated on the server.
A radio button group is missing a <fieldset>/<legend> wrapper. What's the concrete accessibility impact?
Which pair of elements is functionally equivalent to `<div class="btn" onclick="...">` in terms of built-in keyboard accessibility?
What is the correct distinguishing factor between <article> and <section>?
It's valid HTML5 to use multiple <h1> elements on a single page, one per <section>, because of the outline algorithm.
A screen reader user presses their landmark-navigation shortcut on a page built entirely from semantic <header>, <nav>, <main>, <aside>, and <footer> elements with no ARIA attributes added. What regions will they be able to jump between?
Which of these is a direct search ranking factor, versus one that mainly affects click-through rate on the results page?
robots.txt is a security mechanism that prevents unauthorized users from accessing disallowed pages.
Why might a fully client-side-rendered React SPA (no SSR/SSG) underperform in organic search compared to an equivalent server-rendered page?
What format does Google explicitly recommend for structured data, over Microdata/RDFa inline attributes?
A site permanently renames a product URL and uses a 302 redirect from the old URL to the new one. What's the SEO consequence?
A sitemap.xml guarantees that every URL listed in it will be indexed by search engines.
What is a 'soft 404' and why is it harmful for SEO?
What does the STAR method stand for?
Which section of a STAR answer should generally be the longest and most detailed?
True or false: a good behavioral answer to a 'failure' prompt should describe something that wasn't really a significant failure, to avoid looking bad.
What's the main problem with the weak sample answer analyzed in the Try It section?
True or false: a strong leadership story for an individual contributor requires having had formal management authority over other people.
Why is building a story bank before the interview recommended over improvising stories on the spot?
True or false: memorizing a behavioral answer word-for-word is generally the most robust way to deliver it under interview conditions.
If asked specifically about a disagreement with a teammate, what's the mistake in answering with a strong story about a disagreement with an external vendor instead?
True or false: a single real story from a candidate's work history can typically only be used to answer one specific behavioral theme.
In the strengthened version of the disagreement story in the Try It section, what specific action moved the disagreement toward resolution?
Which of these Result statements is strongest, per this topic's framing?
True or false: the Situation and Task sections of a STAR answer should generally be brief, to leave more time for the Action section.
What's the risk of over-rehearsing a behavioral story to the point of reciting it verbatim?
According to this topic, what two prompt types do candidates most often try to weakly improvise in the moment, and should specifically prepare in advance?
True or false: STAR should be applied as a rigid, identical script regardless of what specific behavioral prompt is being asked.
What makes a story a poor fit specifically for a 'leadership without authority' prompt?
True or false: the story bank template's 'Themes this could answer' tagging step is meant to identify a single, exclusive theme per story.
Why does behavioral interviewing rely on past-behavior questions rather than purely hypothetical ones?
True or false: a 2-3 minute spoken answer is a reasonable general target length for a STAR response, per this topic's performance tips.
What's the recommended self-check for whether a drafted STAR story's Action section is strong enough?
What three components make up the Action + Context + Result bullet formula?
Why is 'Responsible for the checkout flow' considered a weak bullet?
True or false: every strong resume bullet must include a precise percentage or numeric metric.
According to this topic, what does a hiring manager typically try to determine from a portfolio in the first few minutes of skimming it?
True or false: a portfolio with ten small, similarly-polished demo projects generally gives a hiring manager more useful signal than one or two projects with a detailed account of real technical decisions.
What's the specific problem with a portfolio project whose live demo link is broken?
True or false: including every role and task from an entire career, regardless of relevance to the role being applied for, is generally good practice because it shows the full breadth of experience.
Which fallback approaches does this topic recommend for quantifying impact when a precise metric isn't available? (Select all that apply conceptually — pick the option listing valid fallbacks)
True or false: for most candidates with several years of relevant experience, a one-page resume is generally recommended over a longer, more exhaustive one.
A candidate writes: 'Worked on the company's React codebase, fixing bugs and adding features as needed.' What is this bullet missing, per the Try It analysis?
True or false: a strong portfolio project entry should ideally explain what problem the project solves, not just describe what the project technically is.
Why does the topic recommend front-loading the strongest, most specific part of a bullet at its beginning?
True or false: when tailoring a resume for a specific role, every bullet from every past role should always be included regardless of relevance, to be thorough.
In the strengthened bullet example from the Try It section ('Fixed a memory leak... cutting the dashboard's reported crash rate by roughly 90%...'), what specifically establishes the CONTEXT part of the formula?
True or false: describing something a candidate's TEAM did in general, without clarifying the candidate's own specific contribution, is generally as strong as describing the candidate's own specific action.
What is the main practical risk of a resume that reads as trying to include everything the candidate has ever done?
True or false: a resume's job, per this topic's framing, is to fully document a candidate's entire career history.
Which portfolio placement practice does this topic recommend?
True or false: a resume bullet without a precise numeric metric is automatically as weak as one using only vague adjectives like 'significantly'.
What's the recommended fix when a candidate has a bullet describing an ongoing responsibility with no clear accomplishment attached?
Why does volunteering your current salary early in a process risk hurting your negotiation?
When responding to an early 'what are your salary expectations' question, what does this topic recommend over stating a single specific number?
True or false: if pushed for a single number rather than a range, giving the middle of your researched range is generally better than giving the top.
What's the main risk of relying on just one compensation-data aggregator's number without cross-checking it?
True or false: once a company has extended a real written offer, a well-reasoned counter is generally considered a normal, expected part of the process rather than a confrontational move.
What four elements make up the core offer-counter script described in this topic?
True or false: without a competing offer, there is no legitimate basis for countering a written offer.
Why is base salary often the least flexible part of an offer, per this topic?
True or false: if a candidate hits a genuine hard ceiling on base salary, the negotiation is generally considered fully over with no other productive options.
What's the specific problem with fabricating a competing offer as negotiation leverage?
True or false: the weak sample response analyzed in the Try It section ('whatever you think is fair') is problematic mainly because it sounds impolite.
In the strengthened version of the early-salary-question response from Try It, what did the candidate keep from the original weak response?
True or false: it's advisable to get final negotiated compensation terms in writing before resigning from a current role.
What does this topic identify as often the single biggest practical barrier to negotiating well, separate from knowing the right facts or scripts?
True or false: a company extending a formal written offer has generally already invested meaningful time and made an internal decision to hire, which shifts leverage toward the candidate compared to earlier in the process.
Which is a better source for market salary research, per this topic's guidance, compared to a single generic 'software engineer' average?
True or false: closing a counter-offer script with an ultimatum ('I need $Y or I'm walking') is the approach this topic recommends.
Why does the topic recommend expressing genuine enthusiasm FIRST in a counter-offer script, before stating the ask?
True or false: giving a stated single number as your salary expectation typically becomes a hard ceiling in practice, since recruiters rarely offer meaningfully above an explicitly stated expectation.
What should a candidate do if their base-salary counter is met with 'there's no room on base given our bands,' per this topic's recommended approach?
Which data structure gives O(1) average lookup time when checking 'have I seen this id before' across a large list?
What does this function return for input ['a','b','a','c']?
Why does an O(n²) list-processing function matter more in frontend code than in a one-off backend script?
True or false: DFS and BFS traversal of the same tree are both O(n), so an interviewer asking you to choose between them has no real signal to extract.
What real frontend mechanism does topological sort most directly correspond to?
Given graph = { app: ['utils'], utils: [] }, what does topoSort(graph) (as defined in the Concept section) return?
True or false: cycle detection in a dependency graph requires tracking only which nodes have been visited overall, with no distinction from nodes currently being explored.
A nested-comments API can return arbitrarily deep reply chains from user content. What's the main risk of a naive recursive DFS renderer here?
What's the complexity of the sliding-window 'longest substring without repeating characters' solution shown in the Concept section?
True or false: normalizing an API response into { byId, allIds } is purely a stylistic preference with no performance implication.
For rendering 100,000 rows in the DOM, what does a strong frontend DSA answer mention alongside any algorithmic complexity discussion?
True or false: full graph algorithms like Dijkstra's shortest path commonly appear in frontend interview rounds.
Why is memoizing a derived hashmap built from props/state important in a frontend context specifically?
What is the output of flattenComments (from Implement It Yourself) for a single top-level comment with one nested reply, in terms of the 'depth' field values produced?
True or false: BFS naturally gives you level-by-level / shortest-unweighted-path information that a plain DFS does not.
In the topoSort implementation from the Concept section, why is a node pushed onto 'order' AFTER visiting its dependencies, followed by a final .reverse()?
What's the complexity of building a byId/allIds normalized structure from a flat array of n items?
True or false: producing a textbook-correct O(n log n) sort as an answer is generally sufficient on its own in a frontend DSA round, without connecting it back to actual UI cost.
Which of these is the LEAST likely to appear in a typical frontend DSA interview round, per this topic's framing?
What's the fixed complexity of the hasCommonId function from Common Mistakes #1, and what's the fix's complexity?
What's the core behavioral difference between debounce and throttle?
Given the leading-edge throttle implementation from this topic with interval=100, calling log(1) at t=0, log(2) at t=50, and log(3) at t=120 — which calls actually fire?
True or false: calls dropped during a throttle's cooldown window are queued and fire later once the window ends.
Why must an event emitter's `emit` method iterate over a COPY of the handler array rather than the live array?
What goes wrong with `{ ...someDate }` as an attempt to clone a Date object?
True or false: a correct Promise polyfill's .then() callback should be allowed to run synchronously if the promise is already settled at call time.
Which Forge challenge id corresponds to the debounce implementation challenge referenced in this topic?
Why are debounce and throttle described as testing closures specifically?
True or false: a naive deepClone using only Array.isArray checks and generic object recursion, with no cycle handling, will infinitely recurse (eventually crashing) on an object that contains a reference to itself.
For a continuously-firing event source like scroll or mousemove where you want the handler to update continuously but at a bounded rate, which pattern is the better default?
What is this topic's stated relationship to the full runnable implementations of these patterns?
True or false: implementing Promise.all using only native Promises is a lighter-weight version of the Promise-polyfill ask than writing a full custom Promise class from scratch.
In the condensed event emitter implementation, what does `(events[event] ??= []).push(handler)` do?
Which of these is the single most common, most quickly-noticed mistake across this whole machine-coding rotation, per this topic?
True or false: debounce and throttle are a genuinely free performance optimization with no trade-off.
Which underlying JS mechanism does the event-loop cross-link in this topic's Under the Hood section connect to debounce/throttle and Promise polyfills?
Using the condensed debounce implementation with delay=200, if fn is called at t=0, t=50, and t=100 and nothing else calls it after, at approximately what time does the wrapped fn actually fire (assuming the original fn callback itself is instant)?
What does deepClone's use of Object.keys(value) combined with recursive calls per key correctly handle for plain nested objects?
True or false: this topic recommends practicing debounce/throttle/event-emitter primarily by reading finished implementations rather than writing and running your own against a grader.
What confirmed Forge challenge id corresponds to the event-emitter challenge linked in this topic?
What can be a Map key that CANNOT be a plain object property key?
What does this log?
Why can't you iterate over a WeakMap's entries?
True or false: a WeakMap prevents its key objects from ever being garbage collected, just like a regular Map does.
What does this log?
Why is a class-based Singleton usually unnecessary in JavaScript?
The Module pattern (an IIFE returning an object with private state) achieves privacy through which mechanism?
True or false: an Observer/pub-sub subscription needs the same 'remember to clean up' discipline as a setInterval or addEventListener.
What is a Decorator, in the JavaScript higher-order-function sense used in this topic?
True or false: throwing a plain string instead of an Error object is functionally identical, with no downsides.
Why don't React Error Boundaries catch an error thrown inside a fetch().catch()-less onClick handler?
Does this shallow-copy update correctly leave the original untouched?
True or false: a pure function can always be safely memoized (cached by its input).
Why must React components behave as pure functions of props and state?
Why does simple reference counting fail for circular references?
Why does V8 split the heap into a young and old generation?
True or false: setting a variable to null in JavaScript immediately and synchronously frees the memory of the object it referenced.
What determines whether an object is eligible for garbage collection?
Does this code leak memory, assuming the interval is never cleared?
True or false: removing a DOM element with .remove() automatically frees any JavaScript variables still referencing it.
What's the most common cause of a React component leaking memory after unmount?
What makes ES Modules statically analyzable, unlike CommonJS?
Given ESM live bindings, what does main.js log?
True or false: import() (dynamic import) is a static declaration, just like the regular import statement.
Why does tree-shaking generally NOT work well on CommonJS code?
Why is array.unshift() considered expensive for large arrays?
True or false: you should always optimize code you suspect might be slow, even without measuring first.
What makes a property-access call site 'megamorphic,' and why does it matter?
True or false: an async function always returns a Promise, even if you write `return 5;` inside it.
Why can't a useEffect callback be an async function directly?
True or false: async/await replaced promises — they are two separate, unrelated mechanisms.
What is the main advantage of promise chaining over nested callbacks?
True or false: fetch('/api/users/999') will reject its promise if the server responds with a 404 status.
True or false: a `while (true)` loop inside a generator will hang the program, just like in a regular function.
What relationship does async/await have to generators?
Which of the three promise states can a promise return to, once left?
You need to run 3 independent uploads and report on each one's success/failure without any single failure hiding the others. Which combinator?
True or false: a Web Worker can directly access and modify the DOM.
What fundamentally distinguishes a Web Worker from setTimeout or a Promise?
True or false: once the function that created a closure has returned, its local variables are immediately garbage collected.
Which best describes why closures give you 'privacy' for module-pattern state?
What internal operation does `==` use to convert an object to a primitive before comparing?
True or false: NaN === NaN evaluates to true.
True or false: if a microtask schedules ANOTHER microtask while the queue is being drained, the new one is still run before the event loop moves to the macrotask queue.
How many execution contexts exist at the moment a deeply nested function call is executing?
True or false: two separate calls to the same function share the same execution context.
True or false: `const obj = {}; obj.a = 1;` throws an error.
Which of these is NOT hoisted at all — no binding exists until the line executes?
True or false: typeof is always safe to use on a variable that hasn't been declared yet, anywhere in your code.
True or false: `class Dog {}` creates something fundamentally different from a constructor function — a new kind of object the prototype chain doesn't apply to.
Why is modifying Array.prototype directly considered risky in shared/production code?
True or false: a nested function can always modify variables in its parent scope, as long as it has access to them.
Which binding rule has the HIGHEST precedence?
True or false: once a function is created with .bind(obj), calling it with .call(otherObj) can override the bound `this`.
What are the three distinct concerns authentication breaks into?
What's the key difference between a stateless session and a database session?
True or false: an optimistic authorization check verifies against the database, while a secure check only reads the session cookie.
Why should Proxy's authorization checks be cookie-only, never database-backed?
A user's account is suspended in the database, but their session cookie (issued before the suspension) is still validly signed. A route relies ONLY on Proxy's optimistic check. Can they still access protected content?
True or false: wrapping a session-verification function in React.cache means it only executes once per request, no matter how many components call it.
What does the documentation recommend regarding session cryptography (signing/verifying tokens)?
True or false: validating form fields on the server before calling the database/auth provider is purely a UX nicety with no other benefit.
What's a Data Transfer Object (DTO) used for in this context?
True or false: a Server Action handling a login form is a secure place for authentication logic because it always executes server-side.
Why is 'Proxy uses the Node.js runtime — check compatibility with your auth library' a relevant consideration?
True or false: it's recommended that Proxy run on ALL routes for authentication purposes, despite the matcher option allowing narrower scoping.
What should happen if verifySession() (in a DAL) finds no valid session?
True or false: this application (eLearn) itself uses a fully custom, hand-rolled authentication implementation rather than an established library.
Which deployment option has meaningfully LIMITED feature support compared to the others?
True or false: Server Actions work correctly in a fully static export deployment.
What does output: "standalone" produce in a Docker deployment?
True or false: Docker's output: "export" mode supports the full Next.js feature set, same as standalone.
What does a 'verified adapter' mean, as opposed to a platform's own independent integration?
True or false: as of this documentation, Vercel and Bun are the currently listed verified adapters.
Why does "use cache" not work under static export?
True or false: a Node.js server deployment (next build + next start) supports every Next.js feature.
What kind of site is genuinely well-suited to static export?
True or false: it's possible to eject to a fully custom server when deploying via a Node.js server target.
Why might a team discover late in a project that static export was the wrong deployment choice?
True or false: Docker deployments support the full Next.js feature set identically to a Node.js server, when using standalone output.
What's a genuine performance advantage of Docker's standalone output over a naive, unpruned container image?
True or false: reading cookies() at request time works reliably in a fully static export deployment.
What should primarily drive the choice of deployment target for a Next.js app?
What does next/image do that a plain <img> tag doesn't, by default?
True or false: next/font sends a request to Google's servers every time a page using a Google Font loads.
What is the DEFAULT loading strategy for next/script?
True or false: the 'worker' strategy for next/script is fully stable and works in the App Router today.
Which strategy should a critical, consent-management script use, needing to run before the page becomes interactive?
True or false: a <Script> placed in a layout re-fetches every time the user navigates to a different nested route within that layout.
Why does a statically-imported local image not need explicit width/height props?
True or false: next/font fonts automatically apply to the entire application regardless of where the font function is called.
What underlying Core Web Vital does next/image's layout-shift prevention directly improve?
True or false: lazyOnload is an appropriate strategy for a script the page's core functionality depends on immediately.
What experimental technology does next/script's worker strategy rely on?
True or false: next/image supports on-demand resizing even for images hosted on a remote server, not just local files.
Where should local static assets like custom fonts or images typically be placed if served from the site's root URL path?
True or false: variable fonts are recommended over fixed-weight fonts when using next/font/google for best performance and flexibility.
A chat widget script is non-critical and shouldn't compete with the page's main content for resources. Which next/script strategy fits best?
True or false: Server Components need next/dynamic to be code-split, the same way Client Components do.
What does the ssr: false option do when applied to a dynamically-imported Server Component?
True or false: dynamically importing a Server Component defers that Server Component's own code from the client bundle.
What's a documented benefit of dynamically importing a Server Component, even though it doesn't lazy-load the Server Component's own code?
True or false: when a Server Component dynamically imports a Client Component, automatic code splitting for that Client Component is currently guaranteed to work.
What tool is used to visualize what's contributing to a Next.js app's JavaScript bundle size?
True or false: instrumentation.ts's register() function can run at any point after the server has started handling requests.
What is onRequestError (exported from instrumentation.ts) used for?
True or false: the error instance passed to onRequestError is always the exact original error that was thrown.
next/dynamic behaves the same way in both the App Router and Pages Router. Why is this useful?
True or false: component-level performance techniques (React.memo, useMemo, profiling) become irrelevant once you're using Next.js's app-level performance features.
What's the most direct fix for an unexpectedly large client bundle traced back to one specific component?
True or false: fetch call logging can be enabled during development for better visibility into data-fetching/caching behavior.
A large modal component is only needed after a user clicks a button. What's the appropriate optimization?
What single directive is Cache Components built around?
True or false: the 'four cache layers' model (Request Memoization, Data Cache, Full Route Cache, Router Cache) is the CURRENT recommended Next.js caching model.
What four things compose a "use cache" entry's cache key?
A cached function reads a closed-over `userId` variable from its enclosing component AND takes a `filter` argument. Do different userId values produce separate cache entries, even though userId isn't a formal argument?
What's the difference between updateTag and revalidateTag?
True or false: calling cookies() directly inside a "use cache" function causes a 50-second build timeout.
What causes the 'Filling a cache during prerender timed out' build error?
True or false: a value stored via React.cache OUTSIDE a "use cache" function is visible when read INSIDE that cached function.
In the static-shell rendering model, what happens to a component that reads a runtime API and is wrapped in <Suspense>?
True or false: Math.random() and Date.now() can be used directly inside a component with no special handling under Cache Components.
What's the CURRENT equivalent of the legacy fetch(url, { cache: 'force-cache' })?
True or false: cacheLife's default profile (when you call "use cache" with no explicit cacheLife call) never expires by time.
What does placing "use cache" at the TOP of a file (rather than inside one specific function) do?
True or false: setting a cache entry's revalidate window to a positive number lower than a parent layout's revalidate value is possible in the legacy route segment config model.
Why might in-memory "use cache" entries behave differently in a serverless environment versus a self-hosted server?
True or false: "use cache" is fully supported when deploying via Next.js's static export output.
A cached function accepts a `children` prop and simply passes it through in its returned JSX without reading its contents. What effect does this have on the cache entry?
True or false: Draft Mode causes all cached functions/components to re-execute on every request, bypassing the cache entirely.
Why is tag-based invalidation (cacheTag + updateTag/revalidateTag) generally preferred over path-based (revalidatePath)?
True or false: 'use cache: remote' requires a network round-trip to check the cache and typically incurs platform costs, unlike the default in-memory cache.
Why can a Server Component's function body directly await a fetch call?
Two independent 300ms requests are awaited one after another (const a = await x(); const b = await y();) instead of via Promise.all. Roughly how long does rendering take?
What actually determines whether two data requests run in parallel?
True or false: identical fetch() calls made by multiple different components in the same render pass automatically result in only one actual network request.
What does passing an UNRESOLVED promise (not awaited) from a Server Component to a Client Component enable?
True or false: plain fetch() calls are cached by default in Next.js.
Why is directly querying a database from a Server Component considered safe?
True or false: use() is a React hook subject to the Rules of Hooks in exactly the same way as useState.
What does React.cache provide when wrapping a data-fetching function used by BOTH a Server Component and a Client Component (via context)?
True or false: awaiting a promise in a Server Component before passing the (now-resolved) value to a Client Component still allows that Client Component to stream/suspend on it via use().
Two Server Components both need the same user data. What's the recommended way to avoid fetching it twice, WITHOUT prop-drilling?
True or false: Server Functions (Server Actions) currently dispatch and await sequentially on the client, one at a time, when called from client code.
Why might you deliberately wrap an ENTIRE page in loading.tsx rather than trying to make a critical data request non-blocking?
True or false: Promise.all rejects entirely if even one of the passed promises rejects, potentially losing the results of the others that succeeded.
What is the ONLY structural difference between the slow (sequential) and fast (parallel) versions of fetching two independent pieces of data?
What determines whether an App Router Server Component is statically prerendered (SSG/ISR) or dynamically rendered (SSR)?
True or false: streaming is itself a rendering strategy, distinct from SSR/SSG/CSR.
What's the App Router mechanism most closely corresponding to classic ISR (Incremental Static Regeneration)?
True or false: CSR is no longer available in the App Router — it has been fully replaced by Server Components.
A page reads searchParams to filter a database query. What does this typically do to the rendering strategy for the WHOLE route?
True or false: SSG content can be served directly from a CDN with zero per-request server computation.
Which scenario is the best fit for CSR (Client-Side Rendering)?
True or false: hydration works differently depending on whether the HTML was generated via SSG or SSR.
What does streaming actually change about a dynamic route's rendering?
True or false: in the Pages Router, the choice between SSG/ISR/SSR was made explicit by which named function (getStaticProps, getServerSideProps) you exported.
Why is SSG generally the fastest of these options?
True or false: a route that's mostly static but has one slow, genuinely dynamic widget must render the ENTIRE page dynamically.
What are the TWO independent axes these five terms collapse onto?
True or false: every route in an App Router application uses Server Components by default, regardless of whether it ends up statically or dynamically rendered.
A live chat widget needs to update instantly as new messages arrive, entirely driven by client-side WebSocket events. Which rendering approach fits best?
What HTTP methods can a route.ts file export handlers for?
True or false: a route segment can have both a page.tsx and a route.ts file simultaneously.
What happens if you don't define an OPTIONS handler in a route.ts file?
True or false: context.params in a Route Handler is a plain synchronous object, unlike in a page component.
When should you reach for a Route Handler INSTEAD of a Server Action?
True or false: under Cache Components, GET Route Handlers can be prerendered/cached the same way pages can.
True or false: generateStaticParams only works with page.tsx dynamic routes, not with Route Handlers.
A team builds a webhook receiver for a third-party payment provider. Should this be a Route Handler or a Server Action?
True or false: RouteContext<'/route'> is auto-generated the same way PageProps/LayoutProps are.
What advantage does a Server Action have over a Route Handler for a form tied to your own app's UI?
True or false: a Route Handler's response must always be JSON.
In app/dashboard/[team]/route.ts, how do you correctly access the team param?
True or false: a HEAD handler is automatically derivable from a defined GET handler, similar to how OPTIONS is auto-implemented.
Why might caching matter differently for a Route Handler than for a typical page?
What's the precise difference between a Server Function and a Server Action?
True or false: a Server Action can be safely assumed to only ever be invoked through your application's own form UI.
A Server Action calls redirect(url) BEFORE revalidateTag('posts'). Does the tag get revalidated?
True or false: a form invoking a Server Action will still submit correctly even if JavaScript hasn't loaded yet.
How does Next.js recommend modeling EXPECTED errors (like failed form validation) in a Server Action?
True or false: setting a cookie inside a Server Action automatically re-renders the current page and its layouts.
True or false: Server Functions currently execute in parallel when multiple are dispatched from client-side code.
What does useActionState's third returned value (often called `pending`) represent?
True or false: a Server Function can be defined directly inside a Client Component file.
Why must every Server Function independently verify authentication, even if it's only ever called from an authenticated page in your app's UI?
True or false: refresh() (from next/cache) revalidates tagged cache data the same way updateTag/revalidateTag do.
Can a Server Action be passed to a Client Component as a prop?
True or false: forms invoking Server Actions in a Client Component queue submissions if JavaScript hasn't finished loading yet, rather than failing.
True or false: a Server Component passed as children to a Client Component becomes part of that Client Component's client-side bundle.
A Layout renders a static Logo (Server Component) and an interactive Search (Client Component) as siblings. Should Layout itself be marked "use client"?
True or false: React Context (createContext/Context.Provider) works directly inside a Server Component without any special handling.
Where is it recommended to render a Context Provider in the tree?
True or false: a Client Component can directly import and statically render a Server Component's module.
A third-party component uses useState internally but has no "use client" directive of its own. What's the standard fix to use it safely from a Server Component?
True or false: any JavaScript value can be passed as a prop from a Server Component to a Client Component.
What does the server-only package do when its module is imported into a Client Component?
True or false: environment variables not prefixed with NEXT_PUBLIC_ are still included in the client bundle, just hidden from view.
What's the key benefit of the children-as-slot pattern (e.g., <Modal><Cart /></Modal>)?
True or false: marking a component "use client" has no effect on the application's overall JavaScript bundle size.
Library authors building a component library are advised to do what regarding "use client"?
True or false: some bundlers might strip out "use client" directives, requiring explicit configuration to preserve them for library authors.
A Server Component needs to share fetched data with several Client Components deep in the tree without prop-drilling. What's a documented pattern for this?
What determines a Next.js App Router application's URL structure?
True or false: navigating between two pages that share a layout causes that layout to unmount and remount.
What is required of the root layout (app/layout.tsx) that isn't required of nested layouts?
By default, what kind of component is every page.tsx and layout.tsx?
True or false: a folder containing only a layout.tsx (no page.tsx) is itself a reachable URL route.
Why can a Server Component page.tsx directly `await` a database call in its function body?
True or false: adding "use client" to a page.tsx file is required before you can fetch any data in it.
Which special file provides an automatic Suspense fallback for a route segment?
What replaces the concept of a central route configuration file in the App Router?
Given app/shop/layout.tsx and app/shop/page.tsx, does visiting /shop/anything-else render shop/layout.tsx?
True or false: a nested layout automatically has access to its grandchild segment's dynamic route params without any extra work.
Which statement best describes the relationship between page.tsx and layout.tsx?
What type is `params` in a modern Next.js Server Component page?
What's the difference between app/shop/[...slug]/page.js and app/shop/[[...slug]]/page.js?
For app/shop/[...slug]/page.js, what is params for a request to /shop/a/b?
True or false: providing generateStaticParams guarantees every possible param value for that route is validated at build time.
Without generateStaticParams, why does accessing params under Cache Components require a Suspense boundary?
True or false: in a Client Component page, you should await params directly the same way a Server Component does.
A [locale] segment should only ever be 'en', 'fr', or 'de'. What's the recommended way to enforce this?
Why are fetch() calls inside generateStaticParams automatically deduplicated?
True or false: params values are always typed as string, string[], or undefined because their real values aren't known until runtime.
For app/[categoryId]/[itemId]/page.js, what is the params type?
What happens to a runtime param value NOT listed in generateStaticParams, on its first real request (assuming its code path doesn't hit an unvalidated runtime-API branch)?
True or false: RouteContext<'/route'> is used specifically for typing Route Handler (route.ts) params, distinct from PageProps/LayoutProps.
For app/shop/[[...slug]]/page.js, what is params.slug for a request to bare /shop?
app/dashboard/layout.tsx throws during render. Does app/dashboard/error.tsx (in the SAME folder) catch it?
What's the key difference between unstable_retry() and reset() in error.tsx (as of Next 16.2.0)?
Why must global-error.tsx define its own <html> and <body> tags?
True or false: error.tsx will catch an error thrown inside a button's onClick handler.
What does unstable_catchError (from next/error) provide that route-segment error.tsx files don't?
A page calls notFound() when a requested post doesn't exist. What does this do?
True or false: a layout that reads cookies() or headers() directly will always fall back to that same segment's loading.tsx while it renders.
Which files does error.tsx wrap, according to the component hierarchy?
True or false: an unhandled error thrown inside useTransition's startTransition callback will bubble up to the nearest error boundary.
In development, what's different about how error.tsx behaves compared to production?
True or false: you can make an error bubble up past the current error.tsx to a parent boundary by throwing again inside the error.tsx component itself.
Why can't metadata/generateMetadata exports be used in global-error.tsx?
True or false: React DevTools lets you manually toggle/test error boundary states during development.
When should you reach for generateMetadata instead of a static metadata export?
True or false: the metadata object and generateMetadata function can both be used in Client Components.
Why is streaming metadata disabled for known bots and crawlers?
True or false: a fully prerendered (static) page still streams its metadata separately at request time.
What problem does wrapping a data-fetching function in React's cache() solve when used by both generateMetadata and the page?
True or false: two default meta tags (charset and viewport) are always added, even for a route defining no metadata at all.
A route defines app/opengraph-image.jpg AND app/blog/opengraph-image.jpg. Which one is used for /blog/hello-world?
True or false: generateMetadata receives params and searchParams as plain synchronous objects, unlike a page component.
What tool does ImageResponse use under the hood to convert JSX/CSS into an image?
True or false: htmlLimitedBots lets you customize or disable streaming metadata's bot-detection behavior.
What is ResolvingMetadata, the second argument to generateMetadata, used for?
True or false: file-based metadata files (like opengraph-image.jpg) can only be static — they can never be programmatically generated.
Why does fetching the same post data separately in BOTH generateMetadata and the page component (without React.cache) hurt performance?
True or false: the size and contentType exports in an opengraph-image.tsx file configure the generated image's dimensions and MIME type.
What was Middleware renamed to in Next.js 16, and did its functionality change?
True or false: Proxy runs AFTER a route has been matched and its layout has started rendering.
What does the docs explicitly warn Proxy should NOT be used for?
True or false: an optimistic permission check in Proxy means you no longer need to verify authorization in the Server Component or Route Handler that serves the actual protected data.
What is the purpose of the matcher config exported alongside a Proxy function?
For a simple, unconditional redirect from /old-page to /new-page, what does Next.js recommend BEFORE reaching for Proxy?
True or false: NextRequest and NextResponse are entirely custom Next.js types, unrelated to standard web APIs.
Why does doing slow work (e.g. an external API call) inside a Proxy function hurt performance broadly?
True or false: without a matcher config, a Proxy function runs on literally every request the application receives, with no scoping at all.
Which of these is a documented, appropriate use case for Proxy?
True or false: Proxy can access cookies and an extended, parsed URL object more conveniently than the raw standard Request API.
In the request lifecycle, where does Proxy sit relative to layout and page rendering?
True or false: a redirect issued from Proxy and a redirect configured in next.config.ts's redirects option are functionally interchangeable for every use case.
What should happen if a Proxy-based optimistic auth check passes, but the underlying session turns out to be invalid when the actual protected Server Component runs?
True or false: 'Proxy' and 'Middleware' can both still be seen in use — the rename doesn't retroactively break existing knowledge of how it works.
True or false: getServerSideProps runs once at build time, like getStaticProps.
True or false: the App Router requires migrating away from any Pages Router project — the two cannot coexist.
True or false: getStaticProps and getServerSideProps can both be exported from the same page file simultaneously.
What is the conceptual App Router equivalent of getStaticProps?
True or false: getInitialProps runs only on the server, never on the client.
Why is Pages Router knowledge still commonly tested in interviews?
True or false: the exact function signatures of getStaticProps/getServerSideProps have a direct one-to-one syntactic equivalent in the App Router.
A page needs fresh data on every single request, with no caching at all. In the Pages Router, which function would you use?
True or false: fallback: false in getStaticPaths means any path not returned by getStaticPaths results in a 404.
True or false: client-side data fetching with a library like SWR or React Query works the same conceptual way in both the Pages Router and the App Router.
True or false: the children prop in a layout is functionally the same kind of thing as a named @slot.
What renders in an unmatched parallel route slot after a hard navigation (full page refresh)?
True or false: on a SOFT (client-side) navigation, a parallel route slot that doesn't match the new URL keeps showing its previously active subpage.
What does the (..) convention mean in an intercepting route folder name?
True or false: intercepting route level conventions like (..) count @slot folders as a filesystem level.
Why does the shareable-modal pattern combine BOTH parallel routes and intercepting routes?
True or false: all parallel route slots at the same segment level must share the same static-vs-dynamic rendering mode.
What does useSelectedLayoutSegment('parallelRoutesKey') let you read?
True or false: a modal implemented via parallel + intercepting routes will still show the full standalone page if the user navigates to it directly via a shared link.
Why is a catch-all route (e.g. app/@auth/[...catchAll]/page.tsx returning null) sometimes used to close a modal?
True or false: parallel route slots can each have independent loading.tsx and error.tsx files.
What's the recommended way to close a modal implemented with intercepting routes?
True or false: parallel routes are useful only for modals — they have no other common use case.
In a role-based dashboard using parallel routes, a Layout receives { user, admin } slots and returns `role === 'admin' ? admin : user`. What kind of routing pattern is this?
What's the key difference between a soft navigation and a hard navigation?
True or false: <Link> automatically prefetches every route it points to, regardless of whether the route is static or dynamic.
What does adding loading.tsx to a dynamic route segment specifically enable?
True or false: wrapping a folder name in parentheses, like (marketing), changes the resulting URL to include "marketing".
Why does using a plain <a> tag instead of <Link> for internal navigation hurt performance?
A user hovers over a <Link> to a STATIC route for 2 seconds, then clicks. How much of the route was already prefetched before the click?
True or false: disabling prefetch with prefetch={false} is generally recommended for every <Link> to reduce server load.
Why might <Link>'s prefetching not have started by the time a user clicks, even on a static route?
What's the primary purpose of a route group like app/(shop)/?
True or false: a hard navigation is sometimes unavoidable, such as navigating to a genuinely external URL.
Streaming, as described in this topic, relies on which underlying mechanism?
True or false: on a soft navigation, shared layouts are destroyed and recreated with fresh state each time.
A page with many links (e.g. an infinite-scroll product list) may want to set prefetch={false} on most of them. Why?
What's the modern, native way to load variables from a .env file, without installing a package?
True or false: SIGTERM is typically sent by process managers and orchestrators as a routine, polite 'please stop' signal, not just during crashes.
What does server.close() do to requests that are already in progress when it's called?
True or false: calling process.exit() immediately inside a SIGTERM handler, before server.close()'s callback fires, achieves the same graceful result.
What is process in Node.js, in terms of its underlying mechanism for signal handling?
True or false: without any SIGTERM handler registered, the default behavior is for the process to wait for all requests to finish before exiting.
What does --env-file-if-exists do differently from --env-file?
True or false: it's good practice to include a hard timeout fallback that force-exits if graceful shutdown takes too long.
Why does the absence of graceful shutdown handling matter in production specifically?
True or false: reading process.env has a significant, measurable performance cost that should be avoided in hot code paths.
Which signal is typically sent when a user presses Ctrl+C in a terminal running a Node.js process?
True or false: --env-file being a native flag means the dotenv package is now entirely useless in all cases.
In the shutdown coordinator pattern shown in this topic, what determines when it's actually safe to call process.exit()?
True or false: process.env values are always strings, even for values that look numeric or boolean in the .env file.
A team's deploy process routinely sends SIGTERM to scale down old instances, and they notice a small spike in failed requests during every deploy. What's the most likely root cause, based on this topic?
What happens to a synchronous throw inside a try/catch block?
True or false: an async function that throws produces a normal synchronous throw that a surrounding try/catch (outside the async function, with no await) will catch.
What triggers Node's 'unhandledRejection' event?
True or false: the recommended response inside an uncaughtException handler is to log the error and continue running normally.
Why is 'log and exit' safer than 'log and continue' after an uncaughtException?
True or false: error-first callbacks are the recommended, modern convention for new Node.js code.
Which of these is a PROGRAMMER error, as distinct from an operational error?
True or false: operational errors should generally be handled (retried, returned as a clean error response), while programmer errors should generally result in a controlled crash and restart.
True or false: a process-level unhandledRejection handler can send a proper HTTP error response to the specific client whose request caused the rejection.
What does wrapping an async request handler in try/catch primarily accomplish?
True or false: AsyncLocalStorage's context set via .run() remains accessible via .getStore() even after an await inside that callback.
A team registers only an unhandledRejection handler and assumes their error handling is complete, but users still occasionally see hung requests with no response. What's the most likely gap?
True or false: it's good practice to register both uncaughtException and unhandledRejection handlers in production, even if they only log and exit.
What's the tradeoff of using AsyncLocalStorage instead of parameter drilling for request context?
What happens when .emit() is called on an EventEmitter?
True or false: emitting an 'error' event with no listener attached is treated exactly the same as emitting any other event with no listener — a silent no-op.
What is the default maximum number of listeners per event name, per EventEmitter instance, before a warning is logged?
True or false: hitting the MaxListenersExceededWarning always means the code has a genuine bug that must be fixed.
Which built-in Node.js constructs are built on top of EventEmitter?
True or false: an event emitted before any listener is attached for that event name will still be delivered once a listener is later registered.
What's the most common REAL cause of hitting the MaxListenersExceededWarning in practice?
True or false: if a listener throws an uncaught exception during emit(), that exception propagates synchronously out of the emit() call itself.
What's the recommended fix for code that accidentally attaches a new listener on every incoming request?
True or false: .once() registers a listener that automatically removes itself after firing a single time.
Why does an unhandled 'error' event crash the process, when other unhandled events don't?
True or false: multiple listeners registered for the same event all run in parallel, independent of each other.
What's a legitimate reason to call setMaxListeners() with a higher value?
True or false: the max-listeners limit of 10 is a hard cap that prevents the 11th listener from being attached at all.
A service crashes intermittently with 'Unhandled error event', and the crash correlates with occasional upstream network failures. What's the most direct fix?
How many distinct phases does libuv's event loop cycle through per iteration?
Which queue has the HIGHEST priority in Node.js — draining completely before anything else, between every phase transition?
True or false: process.nextTick drains only once per full event loop iteration, not between every phase.
A setImmediate call is scheduled from INSIDE an fs.readFile callback (already executing in the poll phase). A setTimeout(fn, 0) is scheduled at the exact same moment. Which runs first?
True or false: at the top level of a script (not inside any I/O callback), the order between setImmediate and setTimeout(fn, 0) is guaranteed.
True or false: a process.nextTick callback that schedules another process.nextTick callback during its own execution will have that new callback run in the SAME draining pass, not a later one.
Which libuv phase can the event loop actually BLOCK in, waiting for new I/O events, if nothing else is scheduled?
True or false: setImmediate callbacks run during the 'check' phase, specifically designed to run right after poll.
What real production symptom can excessive process.nextTick recursion cause?
True or false: the browser's 'macrotask vs. microtask' mental model maps directly and completely onto Node.js's event loop with no additions needed.
In what order do these run: console.log('a'), process.nextTick(() => console.log('b')), Promise.resolve().then(() => console.log('c')), console.log('d')?
True or false: long synchronous work inside a single phase's callback still blocks the entire event loop for that duration.
What's an appropriate use case for process.nextTick, given its loop-starvation risk?
True or false: the 'pending callbacks' phase is the phase most commonly relevant to typical application code.
Why is setImmediate described as safer than recursive process.nextTick for 'run this after I/O, but don't starve the loop' use cases?
True or false: EventEmitter's callback-based pattern is unrelated to the event loop — they are two entirely separate systems.
What determines whether setImmediate or setTimeout(fn, 0) logs first at the TOP LEVEL of a script?
True or false: the six libuv phases replace the need to understand microtasks/macrotasks from the JavaScript event loop topic entirely.
A developer notices their Node.js server stops responding to any new requests, but CPU usage is low and no errors are thrown. They find a process.nextTick call that schedules itself recursively somewhere in an error-handling path. What's the most likely explanation?
What are req and res, in terms of their underlying type?
True or false: Node.js provides req.body natively, with no parsing required.
True or false: forgetting to call res.end() causes the client's request to appear to hang indefinitely.
What does a framework like Express fundamentally add on top of Node's raw http module?
True or false: a request body arrives as a sequence of 'data' events carrying Buffer chunks, terminated by an 'end' event.
Why is buffering an entire large upload into a single string/array before processing it a mistake?
True or false: res.write() calls must all happen before any bytes are sent to the client — Node buffers the full response internally first.
In the request lifecycle, when does the request handler callback actually run?
True or false: req.pipe(destination) handles pause/resume backpressure automatically, exactly as it does for any other stream pair.
True or false: request handler execution is scheduled and run as part of the event loop's phases, typically surfacing through the poll phase.
A hand-rolled router matches requests by comparing req.method and req.url exactly. What's a limitation of this approach compared to a framework's routing?
True or false: without keep-alive, each HTTP request from the same client would require a fresh TCP handshake.
A team's Node HTTP server intermittently runs out of memory when handling large file uploads. Code review shows the handler accumulates the entire body into a single string via 'data' events before writing it to disk. What's the fix?
True or false: calling res.writeHead() a second time with different headers after the response has already started sending will silently update the already-sent headers.
Which event on req signals that the entire request body has been received?
True or false: understanding req/res as streams is essential background for later understanding how frameworks like Express implement body-parsing middleware.
Why does streaming a response (writing chunks as they become available) improve time-to-first-byte compared to buffering the full response first?
True or false: Express fundamentally replaces Node's http.createServer with a different underlying server mechanism.
What determines whether a .js file is interpreted as CommonJS or ESM?
True or false: CommonJS's require() can never synchronously load an ES Module, in any current Node.js version.
Why can't a module using top-level await be require()'d synchronously, even with require(esm) support?
True or false: fs.readFileSync blocks only the specific request handler it's called in, not the rest of the server.
What's the recommended fs API style for new asynchronous code using async/await?
True or false: ESM's static import/export structure (known ahead of time, not computed at runtime) is what enables tree-shaking.
True or false: a module's state (e.g. a variable declared at the top level) is re-initialized every time it's require()'d or imported.
Which of these correctly forces a file to be treated as CommonJS regardless of the package.json "type" field?
True or false: fs.readFile (callback-based) and fs/promises's readFile both ultimately rely on the same underlying non-blocking mechanism, differing only in how the result is delivered to your code.
What's the main practical difference between CommonJS's require() and ESM's import in terms of resolution timing?
True or false: mixing CommonJS and ESM files within the same Node.js project is impossible.
Why does blocking the main thread with a synchronous fs call have a bigger blast radius than it might first appear?
True or false: ESM modules can import CommonJS modules, with the CommonJS module's module.exports typically becoming the default export.
A team assumes 'you can never require() an ES Module' while working on a modern Node.js codebase. What's the accurate, current correction?
What are the three core pieces that make up the Node.js runtime?
True or false: every asynchronous operation in Node.js uses libuv's background thread pool.
A CPU-bound loop (no I/O, no await) runs inside an HTTP request handler. What happens to OTHER concurrent requests while it runs?
True or false: as of this app's installed Node version, running a .ts file directly with `node file.ts` requires a separate build step.
Which of these operations typically uses libuv's thread pool rather than OS-native async I/O?
True or false: Node.js ships a stable, built-in test runner that doesn't require installing a third-party testing library.
True or false: wrapping a CPU-heavy computation in a Promise or setTimeout makes it run concurrently with other work.
What does native TypeScript execution in Node (type-stripping) actually do?
True or false: fetch() and structuredClone() require importing a package in current Node.js versions.
Why can a Node server handle a very large number of concurrent, mostly-idle network connections efficiently?
True or false: the Permission Model (--permission) is a fully stable, non-experimental feature as of this app's installed Node version.
What is the recommended fix for a genuinely CPU-bound task that's blocking a Node server's main thread?
True or false: --watch mode requires an experimental flag in current Node.js versions.
Which best describes libuv's role in the Node.js runtime?
What does writable.write(chunk) return when the internal buffer has reached highWaterMark?
True or false: the 'drain' event signals that it's now safe to resume writing after write() previously returned false.
Which of the four stream types is BOTH readable and writable, with output derived from the input (like gzip compression)?
True or false: a Duplex stream's readable and writable sides are necessarily related to each other, like Transform.
What's the key advantage of .pipe() over manually handling 'data' events and calling write()?
True or false: in object-mode streams, highWaterMark counts the total byte size of all buffered objects.
True or false: ignoring write()'s return value and never waiting for 'drain' can cause unbounded memory growth.
What's the main practical advantage of streaming a large file instead of using fs.readFileSync to load it entirely into memory first?
True or false: streams are built directly on top of EventEmitter, using the same .on()/.emit() mechanism for events like 'data', 'end', and 'drain'.
Why does stream.pipeline() get recommended over a raw chain of .pipe() calls for multi-stage pipelines?
True or false: when a writable at the end of a piped chain fills up, .pipe() only pauses the immediately upstream stage, not the original source further back.
What's the default highWaterMark for a standard (non-object-mode) byte stream?
True or false: setting highWaterMark extremely large defeats much of the memory-efficiency purpose of using a stream in the first place.
A service reads from a fast database cursor and writes each row to a slow external API, using raw writable.write() calls in a loop with no backpressure handling. What's the most likely symptom under sustained load?
True or false: an unhandled 'error' event on a stream behaves the same special way it does on any EventEmitter — crashing the process if no listener is attached.
True or false: it's safe to put a user's plaintext password directly in a JWT payload, since the token is signed.
With HMAC-based (HS256) JWT signing, what's true about the relationship between signing and verifying?
True or false: with RSA-based (RS256) signing, the public key can sign new tokens just as well as the private key.
Why is SHA-256 a poor choice for hashing passwords, despite being a legitimate, secure hash function generally?
True or false: bcrypt and argon2 include a tunable cost factor that can be increased over time as hardware gets faster.
What's the purpose of pairing a short-lived access token with a longer-lived refresh token?
True or false: a JWT with no expiration set remains valid forever, with no built-in way to revoke it.
In the three-segment structure header.payload.signature, what does the signature actually prove?
True or false: refresh tokens are typically stored and handled the same way as access tokens, with no additional precautions.
Where should JWT signing secrets/keys be stored in a Node.js application?
True or false: verifying a JWT's signature is generally a fast, cheap operation, which is part of why JWTs suit stateless per-request auth checks.
A team stores an internal API signing key directly inside a JWT payload issued to end users, reasoning that since the JWT is signed, its contents are protected. What's the flaw in this reasoning?
True or false: with RS256, a downstream microservice that only needs to verify tokens (not issue them) should be given the private key.
What's the main advantage of structured (JSON) logs over plain text logs in production?
What does a LIVENESS check answer, as distinct from a readiness check?
True or false: using the same check/endpoint for both liveness and readiness can cause unnecessary restarts during a temporary downstream outage.
What does perf_hooks.monitorEventLoopDelay actually measure?
True or false: monitorEventLoopDelay is confirmed stable and functioning in this app's installed Node version.
What does diagnostics_channel let application code do?
True or false: a readiness check failing should typically trigger an orchestrator to restart the instance immediately.
How does AsyncLocalStorage tie together logging, diagnostics events, and error reports for a single request?
True or false: monitorEventLoopDelay's overhead is intentionally small, since it's sampling rather than intercepting every operation.
A team only investigates event-loop responsiveness after users report slowness. What's the gap in this approach?
True or false: pino and similar structured-logging libraries build on the same JSON-log concept, adding performance optimizations and log-level filtering on top.
A service's /healthz/live check queries a downstream payment API as part of determining liveness. During a brief payment API outage, what happens?
True or false: structured JSON logging has zero performance cost compared to plain string logging.
What's the relationship between event-loop-delay monitoring and CPU profiling (from Performance & Profiling)?
What's the difference between --prof and --cpu-prof?
True or false: the most common real-world cause of memory leaks in Node.js applications is typically something exotic, like a V8 engine bug.
What does comparing two heap snapshots taken at different points in time reveal, that a single snapshot doesn't?
True or false: node:test and the --test CLI flag are confirmed stable in this app's installed Node version, requiring no external test framework for the basic case.
Why might a WebSocket server's memory grow steadily even if the number of CONCURRENTLY connected clients stays constant?
True or false: node --watch is now a stable, built-in alternative to nodemon for restarting a server on file changes.
In a CPU flame graph, what should draw your attention as an optimization priority?
True or false: it's generally a good practice to optimize code based on intuition about where the bottleneck likely is, without profiling first.
What's a valid eviction strategy to pair with a growing cache, to prevent unbounded memory growth?
True or false: a memory leak that seems negligible during a short local test run can become catastrophic in a long-running production process.
Why does CPU profiling matter specifically because Node.js runs JS on a single main thread?
True or false: the MaxListenersExceededWarning mechanism exists partly as an early-detection signal for the same class of leak covered by unbounded caches.
A team notices their long-running Node.js process's memory usage climbs steadily over days and eventually crashes with an out-of-memory error, but CPU usage stays normal throughout. What's the appropriate first diagnostic step?
True or false: reaching for node --watch and node --test instead of nodemon and a third-party test framework is now a reasonable default for simple cases, given both are stable built-ins.
How many CPU cores does a single Node.js process use by default?
True or false: cluster workers automatically share in-memory variables with each other.
Which mechanism is specifically best suited for offloading a heavy, CPU-bound synchronous computation without blocking the main thread?
True or false: worker_threads can share memory directly via SharedArrayBuffer, unlike cluster workers.
What's child_process primarily used for, as distinct from cluster and worker_threads?
True or false: forking more cluster workers than the machine has CPU cores continues to provide proportional additional real parallelism.
A team notices their cluster-based server reports wildly inconsistent request counts from an in-memory counter variable when hit repeatedly by the same client. What's the most likely explanation?
True or false: cluster's load balancing alone is sufficient for scaling a production system across multiple physical machines.
What's the correct fix for state (like a session store) that needs to be consistent across cluster workers?
True or false: worker_threads has zero overhead, making it always strictly better than running the computation on the main thread, regardless of the work's size.
Why is reaching for cluster to parallelize ONE heavy synchronous computation a mistake?
True or false: cluster's primary process typically distributes incoming connections across workers using a round-robin-like scheme on most platforms.
What makes prototype pollution a distinctly JavaScript-flavored vulnerability?
True or false: path.join() alone is sufficient to prevent path traversal attacks.
Why can a ReDoS-vulnerable regex affect the entire server, not just the single request that triggers it?
True or false: Node's Permission Model is confirmed stable in current Node versions and should be relied on as a primary production defense.
Which keys should a safe recursive merge function explicitly guard against when processing untrusted JSON?
True or false: using Object.keys() instead of a for...in loop when iterating an untrusted object is a meaningful, if smaller, hardening step.
Why does every dependency in a Node.js project (including transitive dependencies) matter for security?
True or false: npm audit and committed lockfiles help catch and manage known dependency vulnerabilities.
What's the recommended fix for a path-traversal-vulnerable file-serving endpoint?
True or false: input validation has zero performance cost and should always be maximized without any tradeoff consideration.
What's the underlying mechanism that makes ReDoS possible on certain regex patterns?
True or false: the Permission Model, once stable, would only restrict file system access, not network or child process access.
A code review finds a deep-merge utility applied directly to req.body with no key filtering, feeding into an internal config object. What's the most direct risk?
True or false: because signing secrets are covered in the Authentication & JWT topic, they are unrelated to the broader security concerns in this topic.
What's the recommended stance toward the Permission Model given its current experimental status?
What does the ^ (caret) prefix in a semver range like ^4.18.2 allow?
True or false: npm ci and npm install behave identically and can be used interchangeably.
Why is npm ci the recommended command for CI pipelines specifically?
True or false: package-lock.json pins exact versions only for the packages listed directly in package.json's dependencies, not transitive dependencies.
What does the 'exports' field in package.json provide, beyond what 'main' alone offers?
True or false: not committing package-lock.json to version control defeats a core purpose of having a lockfile at all.
What does the 'engines' field in package.json do?
True or false: a package author using ^ ranges for their own dependency guarantees no breaking changes will ever be introduced by an update.
What does the 'workspaces' field enable in a monorepo?
True or false: ~4.18.2 (tilde) allows minor version updates, while ^4.18.2 (caret) only allows patch updates.
A CI pipeline uses npm install, and a build unexpectedly starts failing after a teammate manually edited package.json's version range without running npm install locally first. What would using npm ci instead have done differently?
True or false: npm audit scans the dependency tree information tracked in the lockfile to find known vulnerabilities.
Why might npm ci be faster than npm install for a clean install?
True or false: the 'bin' field in package.json makes a package usable as a command-line tool once installed.
True or false: node:test's mocking API (mock.fn, mock.method) requires installing a separate package like sinon.
True or false: coverage reporting in node:test is confirmed stable in this app's installed Node version, requiring no experimental flag.
What's the key difference between using the global mock import vs. the per-test t.mock context for mocking a method?
True or false: node:test's describe/it syntax is intentionally designed to feel familiar to developers coming from Jest or Mocha.
Which of these is NOT something node:test provides out of the box?
True or false: for a frontend-heavy project already using component snapshot testing, switching purely to node:test to save a dependency is an obviously worthwhile tradeoff.
True or false: mock.fn() call tracking (like .mock.calls.length) lets you assert how many times a mocked function was invoked.
A team wants to default to node:test for a new Node.js backend service with straightforward unit/integration testing needs. What's the recommended stance from this topic?
True or false: node:assert is the underlying assertion library that node:test integrates with.
Why might a Jest-style expect(x).toBe(y) helper built on top of node:assert be considered 'not magic'?
What does Node's type stripping actually do to a .ts file's type annotations?
True or false: a .ts file with a genuine type error will still run without complaint under `node file.ts`, since stripping doesn't check types.
Why do TypeScript enums throw ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX under plain type-stripping, while interfaces don't?
True or false: node file.ts running successfully is equivalent to a passing tsc --noEmit type-check.
What's the recommended workaround for using enums in a file meant to run under plain native type-stripping?
True or false: type stripping is confirmed stable (no experimental flag or warning) in this app's installed Node version.
What should a CI pipeline for a TypeScript project rely on for actual type safety, given that node file.ts doesn't check types?
True or false: namespace declarations are purely erasable, like interfaces, and work fine under plain type-stripping.
What does --experimental-transform-types provide beyond the default plain type-stripping mode?
True or false: native .ts execution in Node eliminates the need for a build step in ALL TypeScript contexts, including browser-targeted code.
A developer runs node app.ts, sees no errors, and concludes the code is fully type-safe. What's the flaw in this reasoning?
True or false: the recommended workflow is to use native .ts execution for fast local iteration, while still running tsc --noEmit separately as the real type-safety check.
What is the primary role of VAPID keys in PWA Push Notifications?
What does the Background Sync API execute when a client registers a sync event while offline?
Which caching strategy is the optimal choice for rendering user profiles, providing instant loads while updating files in the background?
Why should the Network-First strategy be used for dynamic feed endpoints rather than Cache-First?
Which `display` configuration value removes the browser address bar and navigation controls, making the app look like a native device application?
What does a `maskable` icon represent in a Web App Manifest?
What does 'Optimistic UI' represent in user experience design?
What is the role of Conflict-Free Replicated Data Types (CRDTs) in offline-first applications?
Why are Service Workers restricted to running exclusively over HTTPS (or localhost)?
Which storage API should you use inside a Service Worker for structured database assets since `localStorage` is unavailable?
What's the main advantage of a feature-based folder structure over a type-based one (components/, hooks/, utils/)?
True or false: a barrel file (index.ts re-exporting a module's contents) always guarantees perfect tree-shaking, regardless of bundler.
A widely-shared utility function needs a change for one specific feature's requirement. What's the recommended approach?
True or false: a feature-based folder structure makes it easier to lazy-load an entire feature as a single code-split unit.
What does wrapping a state update in startTransition actually do?
True or false: useDeferredValue works like debouncing — it waits a fixed delay before updating.
Why must the input's own displayed value update stay OUTSIDE a startTransition call?
True or false: concurrent rendering being able to pause, interrupt, or discard a render is precisely why the render phase must be a pure calculation with no side effects.
Two components on the same page call useQuery with the identical query key at nearly the same time. What happens?
Why must a query key include every value the query's result actually depends on?
True or false: a mutation's result should typically be cached the same way a query's result is.
What specific problem from Effects does a query library's caching solve that a plain useEffect+fetch does not, by default?
What mechanism do compound components (like Tabs/Tab) typically use to coordinate implicitly?
True or false: custom hooks have largely superseded render props and HOCs for sharing stateful logic across components.
What's the main readability/debugging cost of stacking multiple HOCs?
True or false: a reusable component that supports both controlled and uncontrolled modes should treat a `null` prop value the same as `undefined` — both meaning "uncontrolled."
What is the ONE thing error boundaries currently require that most modern React code otherwise avoids?
True or false: an error boundary catches errors thrown inside a button's onClick handler.
Why does componentDidCatch (not getDerivedStateFromError) hold the error-logging side effect?
An ErrorBoundary wraps <Header/>, <Broken/>, and <Footer/>. Broken throws during render. What remains visible?
What should be the FIRST step before applying any React performance optimization?
True or false: wrapping a very cheap, trivial component in React.memo is always a performance improvement.
A list of 10,000 items renders every row as a real DOM node, and scrolling is janky. What's the highest-impact fix?
What does React.memo's optional second argument (a custom comparator) let you do?
When a component is rendered via createPortal into a different DOM node, what happens to its position in the REACT tree?
True or false: a click inside a portaled modal will still trigger an onClick handler on a React-tree ancestor, even though that ancestor isn't a DOM ancestor of the modal's content.
Why doesn't React attach a separate native event listener to every element with an onClick prop?
True or false: CSS class-based styling from a portal's logical JSX ancestors automatically applies to the portaled content, since it's still their React-tree child.
What does useActionState primarily give you, compared to hand-wiring useState for a form submission?
True or false: if the async action behind useOptimistic ultimately fails, the optimistic UI update stays in place permanently.
What does the React Compiler actually automate?
True or false: useActionState alone is sufficient to fully handle a form's user experience, with no additional UI design needed.
What are the TWO pieces of information React's reconciliation uses to decide update-vs-replace at a given tree position?
A list renders with index-based keys. An item is prepended to the front. What happens to the DOM node and any local state that belonged to the OLD first item?
True or false: if a component's type doesn't change at a given position, but its parent element's type DOES change, the component still preserves its state.
Why is `key` never accessible as `props.key` inside a component?
True or false: a Client Component can directly import and render a Server Component.
Why can a Server Component's function body directly await a database call, when an ordinary component's render cannot be async?
Where should `"use client"` generally be placed in a component tree?
What does hydration actually do to the DOM nodes the server already sent?
A component renders new Date().getTime() directly in its JSX. What happens during hydration?
True or false: checking `typeof window !== "undefined"` before using a browser-only value is enough to prevent a hydration mismatch.
Why does invalid HTML nesting (like a <div> inside a <p>) cause a hydration mismatch even with perfectly deterministic data?
What should determine whether a piece of state is lifted to a common ancestor versus kept local?
True or false: a selector-based store (like Zustand) re-renders a subscribing component even if the specific slice it selected didn't change.
What specific limitation of Context does a selector-based external store fix?
True or false: splitting one large Context into several smaller ones and switching to a selector-based store solve the exact same underlying problem, just with different mechanisms.
How does a component signal to Suspense that it isn't ready to render yet?
True or false: if two independent components suspend inside the SAME Suspense boundary, the fallback disappears as soon as the FIRST one resolves.
A Suspense-compatible resource's read() function throws the real Error object once a fetch has failed. What catches that?
True or false: a custom hook can be tested by calling it directly as a plain function in a test file, without any special wrapper.
Why is mocking at the network boundary (e.g. with MSW) generally preferred over mocking your own data-fetching hook directly?
True or false: a test that queries an element by its CSS class name will typically survive a purely cosmetic class-renaming refactor.
True or false: defining a component function inside another component's body is safe as long as you don't use any hooks inside it.
Why does composition (small components nesting other components) scale better than one large component?
What does `<h1 className="title">Hi</h1>` compile to (modern automatic JSX runtime)?
True or false: you can write a for-loop directly inside JSX curly braces to render a list.
True or false: content nested between a component's opening and closing JSX tags is automatically available as the `children` prop.
Why does passing `style={{ color: 'red' }}` inline as a prop potentially hurt performance?
True or false: React Strict Mode's double-invoking of component functions also happens in production builds.
How many times does "rendered" log when the button is clicked 3 times?
Why does React.memo fail to prevent re-renders when a parent passes `style={{ color: 'red' }}` inline?
Why does mutating a state array in place (items.push(x)) often fail to trigger a re-render?
True or false: in React 18+, calling multiple state setters inside the same event handler always triggers one re-render per setter call.
True or false: wrapping a component in React.memo prevents it from re-rendering when a context it consumes via useContext changes.
A component destructures only `{ theme }` from a large context value that also contains `user` and `setUser`. What happens when only `user` changes?
True or false: nested Providers of the same context work like a stack, where the nearest (innermost) Provider's value wins for its own subtree.
True or false: calling the same custom hook twice in one component (e.g. useToggle(false) then useToggle(true)) causes their internal state to conflict.
True or false: two different components that both call the same custom hook (e.g. useWindowWidth) share the exact same state value.
What is useEffect fundamentally for?
In what order do these logs appear when roomId changes from "a" to "b", then the component unmounts?
True or false: an effect with an empty dependency array ([]) will always see the very latest state on every interval tick inside it.
Why does passing an inline object literal in the dependency array cause an effect to re-run every render?
A component fetches data in an effect keyed to userId. What bug can occur if userId changes again before the first fetch resolves?
In a controlled input, what determines the value displayed on screen?
True or false: typing into an uncontrolled input triggers a React re-render on every keystroke, just like a controlled one.
Why does React warn "component is changing an uncontrolled input to be controlled"?
Why do libraries like React Hook Form default to registering inputs as uncontrolled?
How does React know which stored value a given useState() call should return on re-render?
True or false: it's safe to call a hook inside an if-statement as long as the condition never actually changes at runtime.
A component calls useState, then conditionally calls a second useState only when a prop is true, then calls useEffect. What happens on a render where the prop flips from true to false?
True or false: useRef(0) returns a brand-new object on every render, just initialized with the same starting value.
Why is mutating ref.current during the render body itself a mistake?
True or false: as of React 19, forwardRef is required for every function component that wants to receive a ref from its parent.
Confirmed by dispatching the identical action against both a vanilla and RTK-built store: what happens to the resulting state?
True or false: after migrating a reducer to createSlice, OLD code dispatching hand-written plain action objects with matching type strings stops working.
Which single RTK capability has NO equivalent in vanilla Redux without substantial hand-built infrastructure?
True or false: configureStore requires every reducer to first be rewritten using createSlice before it can be used.
How should 'Redux vs Zustand vs MobX vs Jotai' be framed, given this topic's synthesis?
True or false: RTK's dev-only mutation-detection and serializability-check middlewares add measurable overhead to PRODUCTION builds.
What does createSlice's generated reducer actually consist of, underneath the 'mutating' syntax?
True or false: Redux Toolkit is Redux's own officially-recommended way to write Redux, not a third-party alternative.
What is the recommended migration path for an existing large vanilla-Redux codebase adopting RTK?
True or false: every capability RTK provides, except RTK Query, was already achievable in vanilla Redux, just requiring more hand-written code.
Confirmed across react.context-api and Selectors & Reselect: how does Context's re-render behavior differ from Redux's useSelector when an UNRELATED piece of shared state changes?
True or false: a hand-rolled useContextSelector wrapper around useContext can fully replicate useSelector's render-SKIPPING behavior, not just avoid using a stale value.
What is the ONLY built-in way to approximate selector-like granularity using plain Context?
True or false: 'Redux is just Context with extra boilerplate' is an accurate characterization of the two systems.
For which kind of state is Context generally the better, simpler choice over Redux?
True or false: Context and Redux are mutually exclusive choices — a well-architected app should use only one or the other, never both.
What Redux capabilities does plain Context provide NONE of, regardless of how carefully it's used?
True or false: for a small app with few components and infrequently-changing shared state, Context's all-consumers-re-render behavior is likely to be a noticeable performance problem.
As an app's number of independent, frequently-changing state pieces grows, what happens to the manual-context-splitting mitigation's maintenance cost, compared to Redux's useSelector approach?
True or false: Zustand achieves selector-based re-render granularity through the same mechanism as Redux's useSelector — subscribing via React Context.
What do Redux, Zustand, Jotai, and MobX's confirmed re-render-skipping mechanisms have in COMMON, despite using different underlying approaches?
True or false: Jotai requires an explicit selector function, similar to Zustand's useStore(s => s.field) pattern.
What confirmed capability does Redux provide as a first-class, built-in feature that Zustand, Jotai, and MobX do NOT provide by default?
True or false: MobX's automatic dependency tracking means a component's data dependencies are directly visible by reading its own source code, the same way an explicit useSelector call is.
For a real-time collaborative editor requiring exact reconstruction of 'what changed and in what order' for undo/redo and conflict resolution, which library's confirmed characteristic makes it the strongest mechanical fit?
True or false: 'less boilerplate' should generally be treated as an unconditional improvement when choosing between these four libraries.
Do all four libraries achieve equivalent ASYMPTOTIC re-render-skipping performance, per this topic's synthesis?
True or false: MobX's Proxy-based automatic tracking has zero performance overhead compared to explicit-selector approaches like Redux or Zustand.
Why does this topic present a comparison table rather than declaring a single 'winner' among the four libraries?
True or false: this topic's comparisons introduce new confirmed behavioral claims not already established in the individual library topics (Zustand, Jotai, MobX, and the redux-core/toolkit topics).
When an action is dispatched to a store built with combineReducers({ a: reducerA, b: reducerB }), which reducer(s) receive the action?
True or false: a slice reducer that doesn't recognize a dispatched action's type returns a newly-constructed but equal-looking state object.
Why does the reference-stability of an unchanged slice (returning the same object, not a new equal one) actually matter?
True or false: an action creator is a special Redux API that must be imported from the redux package.
What does Array.prototype.push() return, and why is `items: state.items.push(x)` a bug in a reducer?
True or false: if every slice reducer in a combineReducers root returns its unchanged reference for a given action, the real combineReducers implementation returns the exact same TOP-LEVEL state object too, not just unchanged slices.
Why is namespacing action types as 'feature/event' (e.g. 'counter/incremented') a recommended convention?
True or false: a reducer without a default parameter for state will still work correctly, since the store always provides an initial state explicitly.
A reducer omits its `default` case entirely (only has case statements for actions it cares about, no default). What happens when an unrecognized action (including Redux's internal init action) is dispatched?
True or false: typo'd action type strings (e.g. dispatching 'INCREMENT' when the reducer checks for 'increment') typically throw a runtime error.
What is the fundamental contract a Redux reducer function must uphold?
Which tier does 'never mutate state directly' belong to in the Redux style guide's priority system, as covered in this topic?
True or false: spreading the top-level state object ({ ...state }) is always sufficient to guarantee full immutability of a reducer's update.
Why must reducers avoid calling Date.now() or making API calls directly inside themselves?
True or false: Redux Toolkit's configureStore includes mutation-detection and serializability-check middleware by default in development.
A reducer stores `createdAt: new Date()` directly in state. What's the concrete problem with this, beyond 'style'?
True or false: normalizing relational state (covered in the previous topic) is categorized as an Essential rule, on the same tier as immutability.
A reducer needs to timestamp a logged action. Given the Essential 'no side effects in reducers' rule, where should Date.now() actually be called?
True or false: RTK's development-mode mutation-detection and serializability-check middleware also run in production builds, adding runtime overhead there.
Why is 'use selectors, not direct state.x.y.z access, throughout components' categorized as Recommended rather than Essential?
True or false: this Best Practices topic introduces entirely new mechanics not covered in prior redux-core topics.
Why does state.log.push(...) followed by { ...state } still count as a mutation bug, even though the top-level object is new?
Given applyMiddleware(logger, audit), which middleware is confirmed to be the OUTERMOST layer?
True or false: given applyMiddleware(logger, audit), the confirmed execution order is before-logger, before-audit, [reducer], after-audit, after-logger.
True or false: the order middleware is listed in applyMiddleware has no effect on behavior, only on code style.
In the minimal applyMiddleware implementation, why does chain.reduceRight(...) (rather than a plain left-to-right reduce) produce the confirmed 'first-listed is outermost' behavior?
True or false: middleware has access to store.dispatch, allowing it to dispatch additional actions from within itself.
What is the fixed function signature every Redux middleware must follow?
True or false: forgetting to return next(action)'s result inside a middleware has no observable effect, since the reducer still runs correctly.
Why would you deliberately list a logging middleware FIRST (outermost) rather than last?
True or false: middleware runs only for actions relevant to it — Redux automatically filters which middleware sees which dispatched actions.
What is the core structure of a normalized entity slice in Redux state?
True or false: in an un-normalized (nested) state shape, two posts by the same author each store their OWN separate copy of that author's data.
In a normalized shape, why does updating one author's name automatically reflect across every post that references them?
True or false: looking up state.posts.entities[42] is O(1), while state.posts.find(p => p.id === 42) against an un-normalized array is O(n).
What is the main tradeoff normalization introduces?
True or false: the `ids` array in a normalized slice exists primarily to enable fast lookup of a specific item by ID.
A reducer adds a new entity to `entities` but forgets to also push its ID into the `ids` array. What's the observable bug?
True or false: normalization should be applied to every piece of state in a Redux store, regardless of size or update pattern, as a general best practice.
Why is updating one entity in a normalized store cheaper than updating a nested tree, in terms of what must be cloned?
True or false: createEntityAdapter (covered in the next topic) generates essentially the same { ids, entities } shape and reducer bookkeeping shown here, rather than a fundamentally different approach.
What does createSelector's memoization actually compare to decide whether to recompute?
True or false: in the confirmed 3-call test (initial, unrelated field changed, tracked field changed), exactly 2 real recomputations occurred.
Why does useSelector((state) => state.items.filter(i => i.active)) re-render its component on every dispatched action, even unrelated ones?
True or false: creating a createSelector-wrapped selector fresh inside a component's render body still provides working memoization, since React re-runs the whole component anyway.
How does useSelector's default change-detection differ from the store's raw subscribe(listener) from the Store topic?
True or false: createSelector's default memoization remembers results from many different past calls, not just the most recent one.
Why does createSelector deliberately ignore the top-level state object reference, given that state IS a new reference on every dispatch?
True or false: wrapping a derived computation in createSelector and using it with useSelector provides two independent layers of avoided work — skipped recomputation AND skipped re-render.
In the minimal createSelector implementation, what does `currentInputs.some((value, i) => value !== lastInputs[i])` check?
True or false: selectors used with createSelector should generally be defined at module scope, not inside component bodies.
True or false: dispatch(action) is the only way to change a Redux store's state.
In the mini createStore implementation, calling reducer(undefined, { type: '@@INIT' }) once at store creation accomplishes what?
True or false: createStore has been removed from the redux package and is no longer usable.
A store.subscribe(listener) callback fires after dispatching an action whose reducer case doesn't exist (falls to default, returns the same state reference unchanged). Does the listener fire?
True or false: mutating state directly inside a reducer and returning the same object reference still allows Redux DevTools' time-travel and React-Redux's re-render detection to work correctly.
What does store.subscribe's listener function receive as an argument describing what changed?
True or false: creating two separate createStore() calls for two different features is the correct way to keep their state independent in Redux.
Why does keeping individual reducer functions cheap matter for performance, given how dispatch works?
True or false: a Redux store's replaceReducer method is commonly called directly in everyday app feature code.
What is the practical benefit of Redux's single-store, single-object state model, as opposed to many independent stores?
True or false: in the store's four-method surface (getState, dispatch, subscribe, replaceReducer), dispatch is the only one capable of changing state.
What's the key difference between call() and fork() in terms of blocking behavior?
True or false: confirmed by execution, cancelling a forked task mid-delay() triggers its finally block, with yield cancelled() correctly returning true inside it.
Confirmed by execution: race({ fast: ..., slow: ... }), where fast resolves first — what does the result object look like?
True or false: cancelled() correctly distinguishes cancellation from normal completion because it's checked inside a finally block, which runs in BOTH cases, but only reports true in the cancellation case.
What happens when cancel(task) is called on a task that has already completed normally?
True or false: checking cancelled() in ordinary sequential code AFTER a yield (not inside a finally block) reliably detects cancellation.
If race()'s losing effect is a plain, non-cancellable Promise-returning function (not built with AbortController support), what actually happens to it?
True or false: race() is the recommended tool for coordinating a timeout against a real async operation, checking afterward which key of the result object is populated.
Why does the minimal cancellable-task implementation rely on the generator's built-in .return() method for cancellation?
True or false: a saga using fork()/cancel()/cancelled() around a genuinely AbortController-backed fetch can achieve TRUE request cancellation, unlike takeLatest alone.
What does eventChannel let a saga do that plain take(actionType) cannot?
True or false: confirmed by wiring a real EventEmitter through eventChannel, three sequential take(channel) calls received three emitted values in the exact order they were emitted.
What must eventChannel's subscriber function return, and why?
True or false: confirmed in the Try It exercise, a take(channel) call made AFTER the channel has been closed hangs indefinitely, waiting for a value that will never arrive.
Why might a team prefer eventChannel over manually dispatching a Redux action from inside a WebSocket's callback and take()-ing that action?
True or false: a single channel can only ever be consumed by exactly one saga via take().
In the minimal eventChannel implementation, what happens when emit(value) is called while NO take() is currently waiting?
True or false: real eventChannel supports configurable buffering strategies for high-frequency event sources.
How does channel.close() relate to cancellation, covered in the next topic?
True or false: channels are the recommended approach even for events that already exist as dispatched Redux actions.
What does yield call(fakeApi, 42) actually produce, confirmed by manually stepping the generator with .next()?
True or false: a saga yielding call(add, 1, 2), where `add` is completely undefined, throws a ReferenceError as soon as .next() is called.
What is the role of the saga MIDDLEWARE, as distinct from the saga generator function itself?
True or false: put(action) directly calls store.dispatch(action) from inside the generator function itself.
What does select(selectorFn) do inside a saga?
True or false: bypassing call() and directly invoking an API function inside a saga removes the ability to test that saga without real network calls.
Why might `call(api.getUser, id)` behave incorrectly if getUser relies on `this` internally?
True or false: take(actionType) pauses the saga until an action of that specific type is dispatched anywhere in the app.
In the minimal runSaga implementation, what determines when the real fn(...args) is actually invoked?
True or false: a saga generator function receives the Redux store directly as an argument, allowing it to call store.dispatch and store.getState freely.
Confirmed by execution: after dispatching three rapid actions against a takeEvery watcher, how many worker results end up in the store?
True or false: confirmed by execution, takeLatest's cancellation of earlier saga instances also prevents the underlying async function from actually being invoked for those earlier dispatches.
What DOES takeLatest guarantee, given it doesn't prevent earlier async calls from actually running?
True or false: confirmed by execution, debounce(300, ...) causes the underlying async function to run once per dispatched action, same as takeEvery.
Which watcher effect is the correct choice for a search-as-you-type feature where intermediate keystrokes' requests should ideally never even fire?
True or false: redux-saga provides a dedicated built-in 'retry' effect, separate from call/delay.
In the minimal takeLatest implementation sketch, why does the watcher use fork() rather than call() to start the worker saga?
True or false: if truly preventing redundant network calls (not just ignoring stale results) is required, takeLatest alone is sufficient.
Why is a dedicated retry library generally unnecessary for straightforward retry-with-backoff logic in redux-saga?
True or false: takeEvery is the safest default choice for ALL repeated-dispatch scenarios, since it never cancels anything.
What makes it possible to test a saga's success path via gen.next(value), confirmed by direct execution?
True or false: confirmed by execution, gen.throw(error) injects an error at the generator's CURRENTLY PAUSED position, correctly routing into the saga's own try/catch block.
Why is testing a saga generally simpler than testing an equivalent async/await function that calls a real dependency?
True or false: the FIRST gen.next() call's argument becomes the result of the saga's first yielded effect.
Given that takeEvery/takeLatest/debounce are themselves built from the effect-description system, how are WATCHER sagas tested, compared to worker sagas?
True or false: mocking the real dependency function (e.g. with jest.mock) is necessary for testing a saga's call() effect, the same way it would be for testing equivalent async/await code.
What category of test coverage is 'just as cheap' to write for a saga as the success path, per this topic, but is commonly skipped anyway?
True or false: saga tests written via manual generator stepping are typically synchronous, requiring no await, fake timers, or real/mocked I/O.
In the minimal testSaga() helper, what does expectEffect(expected) actually compare?
True or false: a cancellation-aware saga using cancelled() (from the previous topic) can be tested the same manual-stepping way, by controlling what cancelled() 'returns' during the test.
What does configureStore's mutation-detection middleware do when it detects an actual reducer mutation, confirmed by direct testing?
True or false: configureStore's serializability check throws an error, exactly like the mutation-detection middleware.
Does configureStore's reducer option accept a plain object of slice reducers, or does it require a pre-combined single reducer function?
True or false: configureStore's dev-only mutation and serializability checks continue running in production builds for extra safety.
A reducer built with createSlice uses `state.value += 1` inside its reducer function. Does this trigger configureStore's mutation-detection error?
True or false: configureStore includes redux-thunk middleware by default, with no manual setup required.
What is the correct way to ADD custom middleware to configureStore without losing the built-in defaults (thunk, dev checks)?
True or false: the store object returned by configureStore has a different method surface (getState/dispatch/subscribe) than one returned by createStore.
Why does a mutation bug caught by configureStore's dev-only middleware NOT guarantee the same reducer is safe in production?
True or false: configureStore automatically wires up Redux DevTools Extension integration in development, with no manual composeWithDevTools call needed.
How many distinct real action types does ONE createAsyncThunk('user/fetch', ...) call generate?
True or false: confirmed by execution, the pending action dispatches synchronously, before the thunk's async function body has resolved.
What is extraReducers on createSlice specifically for?
True or false: calling thunkAPI.rejectWithValue(data) and an unhandled thrown error inside the thunk both dispatch the SAME rejected action shape.
A rejected case's reducer only updates status and error, never touching a `data` field. What happens to `data` after a failed request that follows a previously successful one?
True or false: createAsyncThunk's generated thunk function, when dispatched, is recognized and executed by redux-thunk middleware — the same middleware included by default in configureStore.
Why is rejectWithValue recommended for EXPECTED failures (like a 404 or validation error) rather than just throwing?
True or false: dispatching a createAsyncThunk thunk always returns a value you can await to inspect the eventual outcome at the call site.
In the minimal createAsyncThunk implementation, why does the generated thunk function need to match the shape (dispatch, getState) => {...} rather than a plain action object?
True or false: createAsyncThunk and redux-saga solve fundamentally different problems, not the same underlying problem with different tradeoffs.
When a createSlice reducer writes `state.value += 1`, what actually happens to the ORIGINAL state object?
True or false: confirmed by direct testing, an UNTOUCHED nested branch (like state.user.settings, two levels deep) keeps its EXACT original reference after a dispatch that only modifies a sibling field.
Why does calling state.items.push(newItem) inside a createSlice reducer NOT violate the 'never mutate' rule, unlike the identical call inside a hand-written reducer?
True or false: createSlice automatically generates both a reducer function and matching action creator functions from the same 'reducers' object.
What is the purpose of the { reducer, prepare } form for a reducer case?
True or false: mixing draft mutation and a `return` statement in the same createSlice reducer case is safe and commonly done.
A reducer does `state = initialState;` intending to reset the slice. What actually happens?
True or false: Immer's structural sharing means an untouched reducer CASE is skipped entirely and never runs when a different action is dispatched.
Why does Immer's confirmed structural sharing matter for useSelector and createSelector from the Selectors & Reselect topic?
True or false: createSlice's auto-generated action type strings are prefixed by the slice's `name` field.
What shape does createEntityAdapter().getInitialState() produce, confirmed by direct execution?
True or false: dispatching addOne twice with the SAME id overwrites the existing entity with the second call's data.
Given the confirmed addOne behavior (no-op on collision), which adapter method should be used for 'insert if new, update if it already exists'?
True or false: confirmed by execution, providing a sortComparer causes `ids` to automatically re-sort not just on initial load, but also after an updateOne call changes a field that affects sort order.
Why must a locator function like (state) => state.posts usually be passed to getSelectors()?
True or false: createEntityAdapter's generated reducer functions (addOne, removeOne, etc.) can be used directly as values in createSlice's reducers object.
What does getSelectors() return, in terms of memoization?
True or false: manually pushing to state.ids alongside using an adapter-generated reducer function is a safe way to add extra bookkeeping.
What extra fields can getInitialState() accept, and why?
True or false: createEntityAdapter is a fundamentally different concept from the manual { ids, entities } normalization pattern, requiring different mental models.
Dispatching getUser.initiate(1) twice in a row with the SAME argument — what does execution confirm happens the second time?
True or false: RTK Query builds cache keys based on the reference identity of the argument object passed to a query, not its serialized contents.
What does dispatching a mutation whose invalidatesTags matches an active query's providesTags actually trigger, confirmed by execution?
True or false: useGetUserQuery is confirmed to be auto-generated by createApi using a fixed use${EndpointName}Query naming convention.
Two different components both call useGetUserQuery(5). One unmounts. What happens to the other component's data, per the confirmed reference-counted subscription behavior?
True or false: providesTags and invalidatesTags callbacks both receive the same (result, error, arg) argument signature.
What is RTK Query built on top of internally, according to this topic?
True or false: it's a recommended best practice to manually track isLoading state in a component alongside using useGetUserQuery's own isLoading field.
What does a mutation endpoint's generated hook (e.g. useRenameUserMutation) return, as opposed to a query hook?
True or false: dispatching getUser.initiate(2) after getUser.initiate(1) reuses the SAME cache entry as getUser(1), since it's the same endpoint.
Why does RTK Query's tag-based invalidation approach reduce bugs compared to manually tracking 'what needs to refetch after this mutation'?
True or false: RTK Query is generally recommended over hand-rolling createAsyncThunk plus createEntityAdapter combinations for standard REST/GraphQL data fetching needs.
What is the shared root cause across clickjacking, injection, and SSRF, as framed in this topic?
True or false: clickjacking requires the attacker's page to read content across the iframe boundary, which the same-origin policy normally blocks.
In the SQL injection example, what does the injected `--` sequence do?
True or false: parameterized queries reduce the LIKELIHOOD of SQL injection but don't fully eliminate the vulnerability class.
What makes SSRF distinct from most other attacks covered in this course?
True or false: cloud metadata endpoints like 169.254.169.254 are a classic SSRF target because they can return temporary cloud credentials to anything querying them from inside the cloud network.
Even without extracting any actual data, how can SSRF still be dangerous, per the Try It scenario?
True or false: X-Frame-Options can express 'allow framing by exactly these three trusted partner domains.'
Why is manually escaping quote characters an unreliable fix for SQL injection compared to parameterized queries?
True or false: in the 2025 OWASP Top 10, SSRF was consolidated into the Broken Access Control category rather than remaining a standalone entry.
What's the same underlying principle shared between XSS escaping and SQL parameterization?
True or false: applying least-privilege to outbound server requests (restricting which external hosts a server can reach) reduces SSRF's impact even if an SSRF bug still exists in the code.
A code review finds an image-proxy endpoint that calls fetch() directly on a client-supplied URL with no validation. What should be flagged?
True or false: command injection (unescaped input reaching child_process/exec) and SQL injection are considered entirely separate vulnerability classes with unrelated root causes.
Why does a nearly-transparent, precisely-positioned iframe make clickjacking effective even though the victim IS technically interacting with the real victim.com page?
True or false: marking a session cookie httpOnly is sufficient, by itself, to prevent CSRF.
Confirmed against this app's own next-auth v5 defaults, what SameSite value does the session cookie ship with?
True or false: SameSite=Lax withholds the cookie on top-level navigation, such as clicking a real link to the site from an email.
Why is exposing a state-changing operation (e.g. account deletion) via a GET endpoint especially dangerous for CSRF?
True or false: a CSRF token works because the attacker's cross-origin page cannot read the legitimate page's HTML to extract the correct token value.
Why use crypto.timingSafeEqual instead of === when comparing a submitted CSRF token to the expected value?
True or false: configuring CORS correctly on an API, by itself, provides CSRF protection.
What does SameSite=None require, and what CSRF protection does it provide on its own?
True or false: if an attacker already has working XSS on the target site, they generally don't need a separate CSRF attack.
Why does the topic recommend layering a CSRF token even when SameSite=Lax is already set on the session cookie?
True or false: in the CSRF attack pattern, the attacker's page and the victim's targeted site must be the same origin for the attack to work.
A code review finds a password-change endpoint that only checks for a valid session cookie, with no CSRF token and no SameSite attribute set on that cookie. What's the risk?
True or false: SameSite=Strict blocks the cookie on cross-site subrequests AND on top-level cross-site navigation, making it stronger but potentially breaking some legitimate flows (like clicking a link from an external email while staying logged in).
True or false: as of this course's verification, the OWASP Top 10:2021 is still the current official edition.
What happened to SSRF in the 2025 edition compared to 2021?
True or false: Software Supply Chain Failures is an entirely new category in the 2025 edition, expanding on 2021's 'Vulnerable and Outdated Components.'
In the Try It scenario, why is an admin panel deployed with auth deliberately deferred (and then forgotten) classified as Security Misconfiguration rather than Broken Access Control?
True or false: Cryptographic Failures moved UP in ranking from 2021 (#2) to 2025.
What is A10:2025 Mishandling of Exceptional Conditions, as a new category?
True or false: citing the Top 10 as your ENTIRE security program, with no application-specific threat modeling, is a recommended best practice per this topic.
Why does the topic frame the SSRF-into-A01 consolidation as a maturing of understanding rather than an arbitrary reshuffle?
True or false: the 2025 OWASP Top 10 was built from analysis of real CVE and CWE data, not purely from expert opinion.
A security-header audit script checks a live response for Content-Security-Policy and X-Frame-Options. Which OWASP categories does this most directly help catch regressions in?
True or false: Injection dropped in ranking from #3 (2021) to #5 (2025), but remains a persistent top-5 category rather than disappearing.
What's the practical significance of a category being 'newly promoted' (like Software Supply Chain Failures) rather than just present in the list?
True or false: Authentication Failures and Software/Data Integrity Failures both kept the same rank position between the 2021 and 2025 editions.
Why does this topic explicitly flag its own OWASP-edition verification as an example, beyond just teaching the current list?
What is the fundamental mechanic that makes XSS possible?
What distinguishes stored XSS from reflected XSS?
True or false: DOM-based XSS payloads may never be visible in server logs, because the untrusted data never leaves the browser.
Why does marking a session cookie httpOnly help against XSS specifically?
True or false: a JWT's cryptographic signature prevents an XSS-injected script from reading it out of document.cookie.
In React, which pattern reintroduces the raw innerHTML-style XSS risk that JSX's default escaping otherwise prevents?
True or false: HTML-entity escaping a value is sufficient protection no matter which context (HTML text, URL attribute, inline JS) it's rendered into.
Why is denylisting patterns like <script> tags an unreliable XSS defense?
True or false: textContent assigns a string as literal text and never triggers HTML parsing, structurally eliminating XSS risk for that specific assignment.
What's the main reason to use a maintained library like DOMPurify instead of hand-rolled sanitization when you genuinely need to allow SOME user HTML (e.g. a rich-text comment)?
True or false: once an attacker has working XSS script execution, CSRF often becomes a redundant concern, since the injected script can already perform any action the user's own JavaScript could.
A search page reads a `q` query parameter and writes `Results for: ${q}` into innerHTML with no escaping. Which XSS variant is this?
True or false: a Content Security Policy can block an XSS payload from executing even if an escaping mistake made it into production.
What makes DOM-based XSS distinct enough to require its own hunting strategy, separate from server-side output auditing?
True or false: escaping user input once at the point it's received (e.g. at form submission) is sufficient, regardless of where it's later rendered.
Why is stored XSS generally considered more severe than reflected XSS?
True or false: escapeHtml-style entity replacement of < > & " ' characters is, by itself, a complete solution for safely rendering arbitrary user HTML with formatting preserved.
A code review finds `el.innerHTML = location.hash.slice(1)` with no server round-trip involved. What should the reviewer flag?
True or false: all three XSS variants (stored, reflected, DOM-based) share the same underlying mechanic of untrusted data reaching a dangerous sink, differing only in the data's origin and path.
Why does the `<img src=x onerror=...>` payload execute even though there's no <script> tag anywhere in it?
True or false: confirmed directly in a real browser, a fetch() call blocked by CORS throws a descriptive error explaining exactly why it was blocked.
Which of these triggers a CORS preflight OPTIONS request?
True or false: for a preflighted request, if the preflight response doesn't authorize it, the browser still sends the actual request but just refuses to expose the response to JavaScript.
Why can't a server respond with Access-Control-Allow-Origin: * together with Access-Control-Allow-Credentials: true?
True or false: in the Try It scenario, the DELETE request is blocked specifically because it's a preflighted request, not because CORS generally prevents unauthorized cross-origin requests from being sent.
What's the purpose of the Vary: Origin response header when a server dynamically echoes back the requesting Origin?
True or false: a successful CORS preflight response guarantees the following actual request is properly authenticated and authorized at the application level.
Why does CORS not protect against the classic form-based CSRF attack (an auto-submitting <form method="POST">)?
True or false: Access-Control-Max-Age lets a browser cache a preflight result, avoiding a repeated OPTIONS round-trip on subsequent matching requests.
What's a subtle risk of hand-rolling origin-matching logic instead of using a maintained CORS library?
True or false: GET requests with only CORS-safelisted headers are classified as 'simple' requests and do not trigger a preflight.
A code review finds an Express API that reflects any incoming Origin header back as Access-Control-Allow-Origin, unconditionally, for every request. What's the risk?
True or false: the preflight OPTIONS request adds zero additional network latency compared to a simple request.
Confirmed via this topic's real browser test, what's true about the generic nature of a CORS-blocked fetch() error?
What does a Content Security Policy fundamentally provide?
True or false: CSP prevents malicious markup from reaching the DOM in the first place, the same way escaping does.
Which directives are explicitly ignored when CSP is set via a <meta http-equiv> tag instead of a real HTTP header?
True or false: any directive not explicitly listed in a CSP policy falls back to the browser's fully permissive default, ignoring default-src entirely.
In the Try It scenario, why does script-src 'self' 'unsafe-inline' fail to block an injected inline <script> tag?
True or false: a nonce-based CSP policy lets specific developer-written inline scripts execute while still blocking an attacker's injected inline script, unlike 'unsafe-inline' which allows all of them.
Why should a nonce be freshly generated per response rather than reused across requests?
True or false: deploying a CSP means output escaping is no longer necessary, since CSP fully replaces that defense.
What's the purpose of deploying Content-Security-Policy-Report-Only before switching to full enforcement?
True or false: setting object-src 'none' is a low-cost, broadly recommended default in nearly every CSP policy.
A team relies solely on a <meta http-equiv="Content-Security-Policy" content="frame-ancestors 'self'"> tag to prevent clickjacking. What's the actual state of their protection?
True or false: CSP is evaluated and enforced by the browser, independent of whatever server-side output-escaping logic did or didn't do.
Why does the CSP header apply from the very first byte of a response, while a meta-tag version has a coverage gap?
True or false: frame-ancestors set via the real CSP header serves the same underlying clickjacking-prevention purpose as X-Frame-Options, but is more expressive.
What kind of attack can succeed even under a well-configured CSP, illustrating why it's not a complete replacement for escaping?
Confirmed against this app's own bundled Next.js docs, which environment variables get inlined into the browser-shipped JavaScript bundle?
True or false: a secret accidentally prefixed with NEXT_PUBLIC_ and shipped in a build can be fully remediated by simply changing the server's environment variable configuration afterward.
Confirmed by running npm audit directly against this app's dependency tree, what was found?
True or false: a vulnerability in a transitive dependency (one the team never directly chose) runs with reduced privileges compared to a direct dependency.
What is dependency confusion, as a distinct attack pattern?
True or false: OWASP Top 10:2025 introduced Software Supply Chain Failures as a new, dedicated top-3 category, expanding on 2021's Vulnerable and Outdated Components.
Why is a one-time, manual npm audit check insufficient as an ongoing security practice?
True or false: a package's high download count, on its own, is always a reliable signal that it's safe to add as a dependency.
Why does the topic recommend npm ci over npm install specifically in CI environments?
True or false: committing package-lock.json is mainly a reproducibility nicety with no real security relevance.
In the Implement It Yourself secret scanner, why does it specifically check for NEXT_PUBLIC_-prefixed secret-shaped variable names, beyond generic key-pattern matching?
True or false: package.json overrides can be used to pin a specific transitive dependency's version even when a direct dependency hasn't yet released a fix several levels down its own tree.
A code review finds a Stripe secret key hardcoded directly in a client component file, assigned to a variable named NEXT_PUBLIC_STRIPE_SECRET. What are the TWO distinct problems here?
True or false: install scripts running as part of npm install are a real mechanism attackers can exploit via a dependency-confusion attack, without needing any bug in the app's own code.
Why does this topic go broader than the dependency-auditing content already covered in nodejs.security?
What determines which components re-render when an atom's value changes in Jotai?
True or false: updating a base atom that a derived atom depends on also notifies the derived atom's own subscribers.
What does atom(read, write) — a two-argument atom — let you do?
True or false: a derived atom that reads from TWO base atoms only needs ONE of them to change to trigger a recomputation.
What's the benefit of useAtomValue over useAtom when a component only reads an atom's value?
True or false: Jotai's dependency tracking is based on which get() calls ACTUALLY EXECUTE during a computation, meaning conditionally-read atoms are only dependencies on runs where that branch executes.
How is Jotai's core architecture different from Zustand's, at a conceptual level?
True or false: a writable derived atom's write function must manually translate the incoming value into an update on the underlying atom(s) — nothing does this automatically.
Does a component reading a completely independent atom (with no dependency relationship) re-render when an unrelated atom updates?
True or false: a Jotai app's per-atom update cost grows proportionally with the total number of atoms in the app, similar to diffing a large single store.
How does MobX determine which components should re-render when an observable property changes?
True or false: makeAutoObservable(this) requires decorators or manually calling observable()/action() on individual class fields.
What happens when you directly mutate an observable property from outside the class, like store.count = 5, under MobX's default strict mode?
True or false: a plain JavaScript getter on a makeAutoObservable-wrapped class automatically becomes a reactive computed value.
Reading an observable property inside a setTimeout callback, rather than during a component's render or an autorun — what happens?
True or false: a component NOT wrapped in observer() will still re-render reactively when the observable state it reads changes.
Is MobX's automatic tracking less granular than Zustand's explicit selectors or Jotai's explicit atoms, since no selector is written by hand?
True or false: three different state libraries covered in this domain (Zustand, Jotai, MobX) all achieve the same granular re-rendering goal, but via three genuinely different mechanisms.
Confirmed via direct npm registry lookup, when was Recoil's most recent published version released?
True or false: Recoil is formally marked as deprecated on npm.
True or false: every Recoil atom and selector requires an explicit, app-wide-unique string key.
What is Recoil's selector conceptually the direct ancestor of, in Jotai?
True or false: two atoms/selectors sharing the same key string is a harmless coincidence in Recoil.
What's the recommended approach for a brand-new project with no existing Recoil investment, given the confirmed maintenance-status gap?
True or false: Recoil's dependency-graph update propagation performs meaningfully worse than Jotai's due to its maintenance status.
Does Zustand's default create() pattern require a Provider component wrapping the app, like Context does?
True or false: a component using useStore(s => s.count) re-renders when an unrelated field like s.user changes elsewhere in the same store.
Why does `useStore((s) => ({ count: s.count, user: s.user }))` re-render on every store update, defeating the point of selecting?
True or false: useShallow is confirmed to exist in the current Zustand package, specifically to fix the multi-field-selector re-render issue.
How does Zustand's default re-render behavior compare to Context's, when a component only reads part of the shared state?
True or false: calling useStore() with no selector argument at all subscribes only to the fields the component happens to destructure afterward.
What does the confirmed reference-equality check in the mini-store implementation actually compare?
True or false: actions like incrementCount are conventionally defined inside the store itself, alongside the state they modify.
A selector `(s) => s.items.filter(i => i.active)` re-renders its component on every store update, even when `items` hasn't changed. Why?
True or false: Zustand's selective re-rendering scales better than a single large Context value as the amount of independent state in an app grows.
What does the CAP theorem actually constrain, precisely?
True or false: 'CA' (consistent and available, but not partition tolerant) is a realistic, viable design choice for a real distributed system.
What does a CP system do when a partition occurs?
True or false: an AP system, during a partition, may serve data that's stale rather than refusing to respond.
Why is 'Consistency' in CAP a different concept than 'Consistency' in ACID?
True or false: a real application should make one single CP-or-AP choice that applies uniformly to its entire backend.
A ride-sharing app's live driver-location feature and its payment-processing pipeline should most plausibly be designed as:
Given this ReplicatedStore in CP mode, what happens when readFromReplica() is called during a simulated partition?
What frontend pattern is most directly relevant when consuming data from an AP backend?
True or false: a frontend that silently renders potentially-stale AP data with the same visual confidence as guaranteed-fresh data is making a deliberate, well-considered design choice.
Why does a CP system's write path typically have higher latency than an AP system's?
True or false: network partitions are typically frequent and long-lasting in most real production deployments.
What's the right frontend response for a request that fails specifically because a CP backend is refusing to serve during a partition?
Why is 'the whole application is either CP or AP' considered a design mistake?
True or false: during normal operation with no active partition, a well-designed system can typically be both consistent and available at once.
What is the primary benefit a CDN provides for static assets?
True or false: Cache-Control: no-cache means the response will never be cached.
What does Cache-Control: public, max-age=31536000, immutable communicate?
True or false: cache-busting via content-hashed filenames sidesteps cache invalidation rather than solving it directly.
A live sports score API is cached with Cache-Control: public, max-age=86400. What's the problem?
True or false: an explicit CDN purge and a short max-age both solve the same problem equally well in all cases.
Given this LRUCache with capacity 2, what does the final sequence of gets return?
In the cache hierarchy (browser → CDN → application cache → database), what does each layer that serves a hit save?
True or false: TTL-based cache expiration requires the write path to actively notify the cache when data changes.
Why is cache invalidation considered one of the 'hard problems' in computing?
True or false: a JS Map's insertion-order guarantee is what makes the LRUCache example's O(1)-ish 'move to most-recently-used' trick work.
True or false: modern CDNs can only cache static files like images and JS/CSS, never full HTML pages.
A news site caches an article at the CDN with max-age=300 and an editor fixes a typo. Without an explicit purge, how long could readers see the old version?
True or false: cache hit rate is generally a more meaningful metric to optimize than raw cache size.
Which directive should be used for genuinely sensitive, per-user data like an auth token response?
Why can't a database simply be scaled horizontally the same way a stateless application server can?
True or false: read replicas help scale write throughput.
True or false: a client that writes to the primary and immediately reads from a replica is guaranteed to see its own write.
When is sharding the right tool, as opposed to read replication?
True or false: a query needing data from multiple shards can typically still be executed as a single simple query, the same as on an unsharded database.
What does a database index fundamentally change about how a query executes?
True or false: adding an index to every column is a safe default with no real downside.
Given this ShardRouter with numShards=3, what's true about repeated calls to shardFor with the SAME key?
What real problem does plain modulo-based sharding (hash(key) % numShards) have when numShards changes?
True or false: choosing a shard key that matches common query patterns (e.g. sharding by userId when most queries are scoped to one user) reduces the need for cross-shard fan-out.
A team's reads are slow on a database with no index on a frequently-filtered column. What's the highest-leverage first fix?
True or false: replication lag tends to grow specifically under heavy write load on the primary.
Why do mature systems often combine sharding AND read replication rather than choosing only one?
True or false: a poorly chosen shard key can force queries to fan out across many shards far more often than a well-chosen one would.
True or false: in a point-to-point queue, a single message is typically delivered to every consumer in the pool.
Three independent services (inventory, email, analytics) each need to react to every 'order placed' event. What pattern fits?
True or false: at-least-once delivery means a message might be delivered and processed more than once.
What does it mean for a consumer operation to be 'idempotent'?
Given this PubSub implementation, what does running the publish call print?
Why is exactly-once delivery described as genuinely hard to guarantee end-to-end in a distributed system?
True or false: a dead-letter queue (DLQ) is used to store messages that have repeatedly failed processing, rather than retrying them forever.
In the idempotent processPayment example, what does the idempotencyKey check accomplish?
True or false: most message queues are designed to be a durable, long-term system of record, similar to a database.
Why is monitoring queue depth (backlog size) important, separate from consumer error rate?
True or false: scaling consumers horizontally works cleanly mainly because queue consumers are naturally stateless with respect to each other.
A signup API synchronously sends a welcome email before responding to the client, and the email provider is briefly down. What's the effect, and what's the queue-based fix?
True or false: at-most-once delivery guarantees a message is never lost, only possibly duplicated.
Why does batching message consumption (processing N messages per cycle) often improve throughput?
True or false: a queue is useful specifically because it can absorb a traffic spike as growing backlog, letting consumer capacity be provisioned for average load rather than peak load.
What real flaw does fixed-window rate limiting have?
True or false: token bucket rate limiting allows bursts up to the bucket's capacity while still enforcing a steady-state average rate over time.
What does leaky bucket rate limiting do differently from token bucket?
True or false: a rate limiter using per-server in-memory counters works correctly once a service is scaled to multiple instances behind a load balancer.
A rate limiter is deployed across 3 load-balanced servers using per-process in-memory counters with a stated limit of 100/minute. What is the ACTUAL effective limit a client experiences?
True or false: the fix for the shared-state rate-limiting problem is the same underlying principle as fixing in-memory session storage for horizontally scaled services.
What HTTP status code should a rate-limited response use?
True or false: the Retry-After header is purely optional and has no real effect on client behavior.
Given a TokenBucket with capacity 5 and refillRatePerSecond 0 (no refill), what happens after 5 successful tryConsume() calls followed by a 6th?
Why is it a race condition to read a rate-limit counter from Redis, check it in application code, then write back an incremented value as three separate steps?
True or false: enforcing rate limits at the edge/CDN layer, before requests reach origin servers, is strictly cheaper than enforcing them deeper in the application stack.
Why might an API rate-limit per-IP, per-API-key, AND per-endpoint simultaneously, rather than picking just one granularity?
True or false: sliding window rate limiting requires tracking more state than fixed window, in exchange for closing the boundary-burst gap.
Why does token bucket tend to be preferred for client-facing APIs specifically?
True or false: rate limiting only protects against malicious clients, never against legitimate but buggy ones.
Why do WebSocket connections break the 'any server can handle any request' assumption from earlier scalability topics?
True or false: if User A and User B are connected to different WebSocket server instances with no shared coordination layer, a message from A meant for B can simply fail to be delivered.
What role does pub/sub play in a horizontally-scaled WebSocket architecture?
True or false: a point-to-point queue would work just as well as pub/sub for this cross-server WebSocket delivery problem.
What changes, and what stays the same, when horizontally scaling a WebSocket server tier compared to a stateless HTTP tier?
True or false: least-connections is often a more appropriate load-balancing strategy than plain round robin for distributing new WebSocket connections.
True or false: short polling has lower latency for new data than long polling.
Why do real-time systems implement a fallback ladder (WebSocket → long polling → short polling) instead of only supporting WebSocket?
Given this simplified pub/sub simulation, does Server1 or Server2 print the 'delivering' message when userA (on Server1) messages userB (on Server2)?
True or false: a WebSocket handshake begins as a plain HTTP request that gets 'upgraded' into a persistent connection.
What genuinely different capacity-planning question does a WebSocket tier raise compared to a typical stateless HTTP API?
True or false: at very large fleet sizes, broadcasting every message to every server instance via pub/sub has a real, growing overhead that some systems optimize away with instance-aware routing.
A production real-time chat feature only works reliably in local development (single process) but intermittently fails to deliver messages in production (multiple instances). What's the most likely root cause?
True or false: Socket.IO and similar libraries can automatically negotiate the WebSocket-to-long-polling-to-short-polling fallback ladder without application code needing to handle each transport explicitly.
What is the core difference between vertical and horizontal scaling?
True or false: vertical scaling removes the single-point-of-failure risk that horizontal scaling addresses.
What new problem does horizontal scaling introduce that a single server never had?
A fleet has one underpowered server mixed in with two normal ones, using plain round robin. What happens?
True or false: least-connections routing tends to naturally send less traffic to a slower server, even without manual weighting.
Given this RoundRobinBalancer over servers ["A","B","C"], what does calling .next() five times in a row produce?
What is a health check, in the load-balancing sense?
True or false: a load balancer with a static server list and no health checks will still keep sending traffic to a crashed server.
True or false: externalizing session state to a shared store like Redis is generally preferred over sticky sessions in modern architectures.
What makes a service 'stateless' in the horizontal-scaling sense?
True or false: stateful services like databases require more careful design to scale horizontally than stateless application servers.
In the LeastConnectionsBalancer implementation, what happens when .release(server) is called?
What is 'connection draining' during a deploy?
True or false: setting health check intervals is a pure win the more frequent they are, with no real tradeoff.
Why is a homogeneous fleet (identical instance types) generally recommended?
True or false: a well-tuned single server's ability to handle concurrent connections has nothing to do with how the runtime's event loop works.
Which is the most durable long-term scaling strategy for a growing service?
What is the most common way frontend system design answers reliably read as under-prepared to interviewers?
True or false: the five-step framework should be applied in order, starting with clarifying requirements before designing the API contract.
Why is asking about dataset size before designing an autocomplete search box a high-leverage clarifying question?
True or false: presenting a design with zero acknowledged trade-offs is generally a positive signal in a system design interview.
In the worked live-comments example, why is a WebSocket chosen over polling for live updates?
True or false: cursor-based pagination is generally preferred over offset-based pagination for a news feed where new items are inserted at the top.
In this debounced autocomplete fetcher, if a slow request for 'a' and a fast request for 'ab' are both fired, and 'ab' resolves FIRST, what happens when 'a' resolves LATER?
Why does virtualizing a long list matter for a live comments feature specifically?
True or false: a purely query-driven (non-personalized) autocomplete response can generally be cached more aggressively than a personalized one.
What does 'optimistic UI' mean in the context of a user posting their own comment?
True or false: explicitly stating what was deliberately scoped out of a design (e.g. 'not supporting real-time comment edits in v1') is a weaker answer than one that claims to handle every possible feature.
Why should a performance budget (e.g. 'time to first meaningful render under 200ms') be established as part of the design, rather than just saying 'make it fast'?
True or false: asking clarifying questions out loud is preferable to silently assuming reasonable defaults during a frontend system design interview.
Why does the framework place 'frontend-specific concerns' as its own explicit step, separate from API contract design?
True or false: grounding a technology choice (REST vs GraphQL vs WebSocket) in the data's actual access pattern is preferred over picking one by default or habit.
What do machine coding rounds primarily evaluate, according to the topic?
True or false: the recommended approach is to build the most complete, polished version of a component first, then simplify if time runs short.
Why is negotiating scope explicitly, out loud, recommended at the start of a machine coding round?
True or false: a mid-round requirement addition (e.g. 'now add sorting') is typically an unfair surprise rather than an intentional part of the evaluation.
In the worked SearchBox example, why is the loading/error state layer (step 2) added BEFORE debouncing and cancellation (step 3)?
Given this paginateAndSort function, what does calling it with sortKey 'age' and sortDirection 'desc' on this data produce for page 1, pageSize 2?
True or false: coding silently for the entire round, then presenting a finished result, is the recommended approach.
What does the `cancelled` flag inside the SearchBox's useEffect cleanup function protect against?
True or false: extracting logic like sorting and pagination into standalone, non-rendering functions makes it easier to quickly test correctness during a timed round.
45 minutes into a 75-minute round, the interviewer adds a new requirement. What's the recommended immediate move, before writing any code?
True or false: skipping debounce/cancellation logic in a frequently-re-triggered search input is purely a minor performance nicety, not a correctness issue.
Given genuinely short remaining time in a round, what should be prioritized?
True or false: machine coding rounds are best prepared for using the same strategies as LeetCode-style algorithm interviews.
Why is catching a bug immediately after introducing a new feature cheaper than discovering it much later in the round?
True or false: extracting non-rendering logic like sort/filter/pagination into standalone functions is recommended partly because it's easier to extend when new requirements are added mid-round.
Why does the news feed case study use cursor-based pagination rather than offset-based pagination?
True or false: in the collaborative document editor case study, both document content and permission checking are designed with the same CAP choice (AP).
For the 'new posts available' count indicator, why is a lightweight count-only mechanism preferred over full live-streaming of new post content?
True or false: in the notification system case study, using pub/sub for the initial event fan-out combined with point-to-point queues per channel is a genuinely combined architecture, not a contradiction.
Why does each notification delivery channel need its own idempotency handling?
True or false: rate limiting notifications per user is described as purely a backend implementation detail with no real design significance.
Given this NotificationRouter, what happens when the SAME event id is published twice to the same subscribed channels?
Why does the notification system's in-app unread badge count need to be a durable database value rather than purely derived from live WebSocket events?
True or false: a strong case-study answer typically reaches for just one flashy mechanism (e.g. 'we'll use WebSockets') and treats that as sufficient.
Why is choosing read replicas (rather than sharding) the natural first move for the news feed's read-heavy load, per the Database Design topic's reasoning applied here?
True or false: naming an explicit scaling trigger (e.g. 'this works until X, then Y needs to change') for at least part of a case study design is recommended as a best practice.
What does the collaborative editor's 'presence indicator' (who else is viewing) illustrate about choosing AP without much deliberation?
True or false: the news feed case study explicitly flags moving feed generation from request-time computation to an async, queue-driven, precomputed-and-cached approach as a scaling path rather than a day-one requirement.
Why is choosing NOT to guarantee strict delivery order across different notification channels (e.g. push vs. email) described as an acceptable trade-off?
True or false: a strong case-study answer should run through all five framework steps (clarify, data model, API/data flow, frontend-specific concerns, trade-offs), even under interview time pressure.
What does a Statement Coverage metric represent?
Why can chasing a strict 100% test coverage target be counterproductive for development teams?
What does 'Retry-ability' represent in Cypress commands and assertions?
Why is using `cy.wait(time)` in milliseconds considered an anti-pattern in Cypress?
How does Playwright manage test isolation between separate test files?
Which type of assertions should you write in Playwright to enable automatic waiting during assertions?
Why do visual regression tests frequently fail on CI servers (like GitHub Actions) if baseline images were captured locally on a Mac or Windows laptop?
What is the primary benefit of using the Storybook Test Runner?
What is the difference between `vi.clearAllMocks()` and `vi.resetAllMocks()` in Vitest?
Why should mock timers (`vi.useFakeTimers()`) be used to test timeout operations like `setTimeout`?
How does Mock Service Worker (MSW) intercept network requests compared to standard library mocks?
Why should you call `server.resetHandlers()` in setup configuration files?
Which query method in React Testing Library automatically awaits elements asynchronously until they appear in the DOM?
Why is `screen.getByRole` preferred over `screen.getByTestId` or class queries?
What is the main drawback of having an inverted Testing Pyramid (often called a Ice Cream Cone)?
Why does the 'Testing Trophy' model prioritize Integration tests over Unit tests for web apps?
What is the primary architectural difference between Jest and Vitest?
Which test hook should you use to clear a mocked client state before every individual test block runs?
What happens when a conditional type with a bare type parameter (T extends U ? X : Y) is given a union as its input?
True or false: wrapping both sides of a conditional type's extends check in a single-element tuple ([T] extends [U]) prevents distribution over a union.
What does a mapped type like `{ [K in keyof T]: T[K] }` do?
True or false: remapping a key to `never` in a mapped type's `as` clause produces a property with the type never, rather than removing it.
What does interpolating a union inside a template literal type produce, e.g. `on${"click" | "hover"}`?
True or false: the `as` clause in a mapped type can only transform the VALUE type of each property, not rename the property key itself.
A developer writes `type Wrap<T> = T extends any ? T[] : never;` intending Wrap<string | number> to produce (string | number)[], but instead gets string[] | number[]. What's the cause?
True or false: Exclude<T, U> and Extract<T, U> are special compiler primitives distinct from ordinary conditional type distribution.
What's a practical, real-world use case for combining mapped types with template literal types (as in the Getters<T> example)?
True or false: distribution only matters when the type being checked against `extends` is itself a bare, directly-passed-in union — not when a conditional type merely PRODUCES a union internally.
Why can heavily distributive/deeply nested conditional types slow down tsc's type-checking on large codebases?
With `interface Config { mode: string | number }`, what type does config.mode have after `{ mode: "dark" } satisfies Config`?
True or false: satisfies always preserves every value as its exact literal type, the same way as const does.
What's the key difference between a plain type annotation and satisfies, for an object being checked against an interface?
True or false: a type assertion (as SomeType) performs the same structural validation that satisfies does.
Why is unknown recommended over any for genuinely untrusted data, like a parsed API response?
True or false: when a declared type's property is itself a union of string LITERALS (like "light" | "dark"), satisfies can preserve the specific literal member assigned, unlike the plain-string-property case.
What's the recommended default for a long list of positional function parameters that configure optional behavior?
True or false: extremely large union types or deeply nested conditional types in widely-used public type signatures can have a measurable compile-time (not runtime) performance cost.
What does over-annotating obviously-inferred local variables (like `const isLoading: boolean = false`) actually cost?
True or false: none of satisfies, unknown, or careful type-based API design has any effect on the runtime behavior of the compiled JavaScript.
True or false: without noImplicitAny enabled, an untyped function parameter silently becomes `any` with no compile error.
What does strictNullChecks change about how null/undefined are treated?
True or false: project references require the REFERENCED project to have composite: true set in its own tsconfig.json.
What does tsc -b (build mode) do differently from a plain tsc invocation, for a project using references?
True or false: ${configDir} is confirmed stable since TypeScript 5.5.
What problem does ${configDir} solve in a shared, extended base tsconfig?
True or false: moduleResolution: 'bundler' is recommended specifically for projects that run directly under Node without a bundling step.
What's a concrete, practical benefit of project references with composite: true in a large monorepo?
True or false: retrofitting strict: true onto a large, already-existing non-strict codebase is generally considered EASIER than starting a new project with it enabled from the beginning.
True or false: declare module "package-name" lets you provide type information for an entirely untyped npm package, without modifying that package's own source.
What is @types/lodash, and what does installing it provide?
True or false: declaration merging (covered for same-file interfaces) also works across module/package boundaries, letting you add properties to an ALREADY-TYPED third-party module.
What is the practical purpose of augmenting a third-party module's types (like adding req.userId to Express's Request), rather than forking the library?
True or false: declare global augmentations require the containing file to have export {} if the file otherwise has no top-level exports of its own.
What does isolatedDeclarations (stable since TypeScript 5.5) require?
True or false: isolatedDeclarations's explicit-return-type requirement is a deliberate exception to TypeScript's usual inference-first philosophy, justified by a build-performance benefit.
Before hand-writing a declaration file for a third-party JavaScript dependency, what should you check first?
True or false: declaration files, like all TypeScript type information, have zero runtime cost and contribute nothing to the shipped JavaScript.
A .d.ts file contains only a `declare module` block augmenting an existing module's types, with no top-level import/export statements of its own. How does TypeScript typically pick this up?
True or false: isolatedDeclarations primarily benefits runtime performance of the compiled application.
What signature do standard TC39 decorators (the TypeScript 5.0+ default) use?
True or false: as of TypeScript 5.0, standard TC39 decorators require no special compiler flag to use.
What happens when a decorator function is written with the legacy 3-argument (target, propertyKey, descriptor) signature under DEFAULT TypeScript settings (no experimentalDecorators)?
True or false: the experimentalDecorators compiler flag is required to use ANY decorators in modern TypeScript.
True or false: a class decorator's own logic runs once per INSTANCE created, not once at class definition.
What does context.addInitializer let a field or method decorator do?
True or false: every TC39 decorator's context object has a consistent shape, including a .name and a .kind property, regardless of what's being decorated.
What's the relationship between the decorator DESIGN PATTERN and decorator SYNTAX in TypeScript/JavaScript?
True or false: a large amount of existing decorator tutorials and documentation still teach the legacy 3-argument signature, making version-currency awareness genuinely important here.
A decorated method's wrapping logic (like a timing decorator) executes on every call to that method. What's the performance implication?
What's the fundamental difference between a generic type parameter <T> and `any`?
True or false: without a constraint, a type parameter T could be absolutely any type, meaning the function body can't safely assume it has any particular property.
What does `<const T extends readonly unknown[]>` do differently from a plain `<T extends readonly unknown[]>`, confirmed since TypeScript 5.0?
True or false: before TypeScript 5.0's const type parameters, achieving the same literal-preserving behavior required callers to manually add `as const` at each call site.
In `function pair<T, U>(first: T, second: U): [T, U]`, how are T and U determined when calling pair("hello", 42)?
True or false: an explicit type argument overrides inference, but the actual arguments still need to be assignable to that explicitly specified type.
What does `K extends keyof T` accomplish in `function pluck<T, K extends keyof T>(obj: T, key: K): T[K]`?
True or false: generic type parameters add measurable runtime overhead compared to a non-generic equivalent function.
Why is adding an unnecessary constraint like `<T extends object>` to a genuinely type-agnostic identity function considered a mistake?
True or false: <const T> makes the resulting value deeply immutable at runtime, preventing any mutation of nested objects.
How does the generic-parameter mechanism extend to React components, as covered further in TypeScript with React?
True or false: extremely complex generic constraints can slow down tsc's type-checking, but this only affects build time, never runtime performance.
A function is written as `function firstElement(arr: any[]): any`. What type information does a caller lose compared to a properly generic version?
True or false: T extends { length: number } as a constraint allows the function body to safely access .length on a value of type T.
What's the recommended default approach for supplying type arguments to a generic function call?
True or false: <const T> is a completely new keyword unrelated to the `const` used for variable declarations.
Which built-in TypeScript utility types are themselves built using the same generic type parameter mechanism covered in this topic?
True or false: a constraint on a type parameter uses a fundamentally different compatibility-checking mechanism than the structural typing covered in TypeScript Basics.
Calling `tuple("a", 1, true)` where tuple has a plain (non-const) generic signature `<T extends readonly unknown[]>(...args: T): T` infers T as which type?
True or false: a state-machine or routing library that needs to know the EXACT string values passed to it (not just that they're strings) is a good practical use case for const type parameters.
What does the `infer` keyword do inside a conditional type?
True or false: when infer R appears multiple times in COVARIANT (output/return-type) positions, TypeScript combines the candidates into a union.
When infer P appears multiple times in CONTRAVARIANT (input/parameter-type) positions, how are the candidates combined?
True or false: the union-vs-intersection difference between covariant and contravariant infer positions is an inconsistency/bug in TypeScript's type system.
What does marking a generic type parameter `out T` declare?
True or false: explicit in/out variance annotations change what's valid at the type level, rather than just documenting behavior TypeScript would infer anyway.
Confirmed by compilation: a function and a namespace sharing the same name can merge, allowing what?
True or false: function+namespace declaration merging is recommended for new TypeScript code.
What practical benefit can explicit variance annotations provide for large, complex generic library types?
True or false: infer's position-dependent combination behavior is unrelated to the distribution mechanics covered for conditional types generally.
In `type FirstArg<T> = T extends (arg: infer A, ...rest: any[]) => any ? A : never`, applied to `(name: string, age: number) => void`, what does A resolve to?
What does `import type { Config } from "./types"` produce in the compiled JavaScript output?
True or false: with verbatimModuleSyntax enabled, importing a type without an explicit `type` modifier (in a mixed import with runtime values) produces a compile error.
What problem does verbatimModuleSyntax primarily solve?
True or false: under moduleResolution 'bundler', relative imports require an explicit file extension.
Under moduleResolution 'nodenext' with an ESM package, what extension does a relative import of a .ts source file need?
True or false: namespace is the recommended, modern way to organize new TypeScript code into logical groups.
Why should moduleResolution be matched to the actual build target (bundler-based tooling vs. Node's own resolution)?
True or false: import type erasure can have a genuine practical benefit for bundle size, by avoiding pulling in a module at runtime purely for an unused-at-runtime type.
A namespace and a same-named function can merge, as covered in a previous topic. What category of TypeScript capability does this connect to?
True or false: choosing between moduleResolution settings has a measurable effect on the runtime performance of the compiled application.
What are TypeScript's built-in utility types (Partial, Pick, Omit, etc.) actually implemented as?
True or false: Partial<T> recursively makes ALL nested object properties optional, not just T's own top-level properties.
How is Omit<T, K> conceptually implemented in terms of other utility types?
True or false: NoInfer<T> is confirmed stable since TypeScript 5.4.
What does wrapping a generic function parameter's type in NoInfer<T> do?
True or false: without NoInfer, a generic function with T appearing in multiple parameter positions infers T by combining candidates from ALL of those positions.
In `function setDefault<T>(value: T, fallback: NoInfer<T>): T`, calling setDefault(5, "not a number") produces what result?
True or false: using a built-in utility type like Partial<User> has different runtime behavior than manually writing the equivalent optional-property type by hand.
True or false: a very deeply recursive custom utility type applied to a large, complex type can noticeably slow down tsc's build-time type-checking.
MyReturnType<F> is implemented as `F extends (...args: any[]) => infer R ? R : never`. What mechanism does this rely on?
True or false: it's generally recommended to hand-roll a custom equivalent of Partial/Pick/Omit for everyday use rather than using the built-in versions.
What's the standard, broad type for a component's children prop, covering strings, arrays, elements, null, and more?
True or false: a generic arrow-function component written as `const List = <T>(props) => ...` compiles cleanly in a .tsx file with no special syntax needed.
What does the trailing comma in `const List = <T,>(...) => ...` actually do semantically?
True or false: a regular `function List<T>(...)` component declaration has the same JSX-ambiguity parsing problem as an arrow function.
As of React 19, confirmed by compiling a working example, how can a function component accept a ref?
True or false: forwardRef no longer works at all in React 19.
Why parameterize React.ChangeEvent<HTMLInputElement> with the specific element type, rather than using a bare React.ChangeEvent?
True or false: typing children as React.ReactElement instead of React.ReactNode is generally MORE permissive, accepting more valid children types.
When is an explicit type argument needed for useState, rather than relying on inference from the initial value?
True or false: React+TypeScript integration introduces a genuinely separate type system distinct from ordinary TypeScript.
What's an alternative to the <T,> trailing-comma syntax for a generic component that some teams prefer for clarity?
True or false: a variable with extra properties beyond what an interface requires can still satisfy that interface, as long as it has all the required properties.
What happens to TypeScript's type annotations when code is compiled?
True or false: function parameters can rely on inference the same way local variables can, requiring no explicit type annotation.
What's the recommended inference-first philosophy regarding explicit type annotations?
True or false: TypeScript types can validate the actual shape of data at runtime, such as JSON parsed from an API response.
In a nominally-typed language like Java, what would be required for a class to satisfy an interface, that TypeScript does NOT require?
True or false: annotating a variable explicitly when its type is already obviously inferred (like `const isActive: boolean = true`) is a compile error.
Why does a heavily-typed TypeScript function run exactly as fast as an untyped equivalent at runtime?
True or false: type-checking happens at build/compile time, not as part of the running production application.
A Robot class and a Dog class both happen to have a bark() method, with no inheritance relationship between them. Can a function typed to accept Dog also accept a Robot instance?
True or false: TypeScript's type erasure is the same underlying fact confirmed separately when Node.js runs .ts files directly via type stripping.
What's the main practical benefit of catching type errors at compile time rather than at runtime?
True or false: in the inference-first philosophy, a function's parameters should still generally be explicitly typed even though local variables usually don't need to be.
Which of the following correctly describes what TypeScript's type system checks?
What does marking an interface property with `?` (like `email?: string`) mean?
True or false: passing an object literal directly to a function parameter typed with an interface is checked identically to passing a variable holding the same shaped object.
Why does the excess property check exist specifically for object literals, given that structural typing normally ignores extra properties?
True or false: readonly prevents any mutation of the property's value, including mutating properties nested inside an object stored in that property.
What happens when two `interface` declarations share the exact same name in the same scope, with non-conflicting properties?
True or false: type aliases (using the `type` keyword) support declaration merging the same way interfaces do.
What's one valid way to pass an object with genuinely intentional extra properties to a function without triggering the excess property check?
True or false: an interface can extend multiple other interfaces at once.
Two interface declarations with the same name have a CONFLICTING type for the same property (one says number, the other says string). What happens?
True or false: the excess property check and readonly enforcement both add measurable runtime overhead to the compiled JavaScript.
A property is typed `readonly settings: { theme: string }`. Which of these is NOT blocked by readonly?
Which of these can a `type` alias express directly that `interface` genuinely cannot?
True or false: two `type` alias declarations with the same name merge together, the same way interface declarations do.
When two object types with a genuinely conflicting property (one says string, the other says number) are intersected with &, what happens to that property's type?
True or false: interface extension (extends) with a genuinely conflicting property produces a compile error right at the extends declaration itself.
Why might an intersection-type conflict be genuinely confusing to debug compared to an interface-extension conflict?
True or false: for a plain, non-extensible object shape with no unions or intersections involved, the choice between type and interface is mostly inconsequential.
A published library exposes a config object shape and wants consumers to be able to add their own additional fields to it from their own code, without editing the library's source. Which declaration form directly supports this?
True or false: `never`, as it appears in a conflicting intersection property, is a special case invented uniquely for intersections, unrelated to never's general meaning elsewhere.
Which of these type shapes is most naturally expressed as a type alias rather than an interface?
True or false: type aliases and interfaces have different runtime performance characteristics once compiled.
True or false: since TypeScript 5.5, array.filter(x => x != null) automatically infers a null/undefined-free result type, with no manual type predicate required.
What determines whether narrowing survives into a closure that captures the narrowed variable?
True or false: a discriminated union can be narrowed with a simple equality check on its shared literal property, without needing typeof/in/instanceof.
True or false: TypeScript verifies that a custom type predicate's logic actually matches its declared 'is' claim.
Which built-in JavaScript function already has a TypeScript type predicate defined, requiring no custom wrapper for narrowing?
True or false: before TypeScript 5.5, filter(x => x != null) already produced a null/undefined-excluded result type automatically.
A narrowed variable x (typeof x !== "string" check passed, so x: string) is captured by a setTimeout callback. Later in the SAME function, x is reassigned to a number. What happens inside the callback?
True or false: narrowing has a measurable runtime performance cost, since TypeScript has to check the narrowed type at runtime.
What's the practical benefit of extracting repeated narrowing logic into a named type predicate function?
True or false: the `in` operator can be used as a type guard to check for a property's presence, narrowing a union based on which member actually has that property.
True or false: calling a method on a value typed as `any` will never produce a compile error, even if that method doesn't actually exist on the value's real runtime type.
True or false: a tuple type like [number, number] accepts an array of any length, as long as the elements are numbers.
What real, practical benefit does the never-based exhaustiveness pattern provide in a switch statement over a discriminated union?
True or false: an intersection type (A & B) for two object types produces a type with the COMBINED properties of both.
What's a concrete, non-stylistic reason to prefer a union of string literals over an enum for new code?
True or false: unknown accepts having any value assigned to it, but restricts what you can DO with that value until it's narrowed.
A function parameter is typed as number[] but the function actually requires EXACTLY two numbers to work correctly. What's the risk of using number[] here instead of a tuple?
True or false: using `any` as a quick fix for a type error only affects the specific line where the error occurred, with no wider impact.
What does a literal type like the type "up" (as opposed to the general string type) represent?
True or false: enums are always the wrong choice and should never be used in TypeScript.