FreeExam

Frontend engineer: Browser Security and Performance Diagnosis

Original interview cases on browser trust boundaries, response access, content policy, caching, execution cost, and measurement. Scenarios connect performance claims to correct and authorized user-visible outcomes.

These prompts are original practice. They are not questions from a named employer or a live hiring loop.

  1. 1.A browser application embeds a privileged server credential into its downloadable JavaScript bundle. What trust-boundary problem must review address?

    Show answer and explanation
    1. Only the variable name determines whether it is secret.
    2. The credential is distributed to clients.
    3. The minifier guarantees secrecy.
    4. Build-time substitution makes the value unreadable.

    Answer: The credential is distributed to clients.

    Browser-delivered code and data are available to users of that client. Privileged secrets need a suitable server-side boundary rather than concealment in a bundle.

  2. 2.An account page hides an administrator button from ordinary users, but its server endpoint accepts the operation without checking permission. What must enforce authorization?

    Show answer and explanation
    1. Only the route's frontend name
    2. Only whether the user can navigate to the page normally
    3. Only the button's visibility
    4. The server's operation boundary

    Answer: The server's operation boundary

    Client presentation is not an authorization boundary. The server must validate the caller and permitted effect independently of hidden controls.

  3. 3.A server accepts an account ID from a route and returns its data after checking only that the caller is signed in. What additional relationship matters?

    Show answer and explanation
    1. A guarantee authentication implies access to every account
    2. Only whether the ID parses as an integer
    3. The caller's permission for that account
    4. Only whether the frontend normally links to it

    Answer: The caller's permission for that account

    Identity and object-level authorization are distinct. Validate access to the requested resource at the actual server boundary.

  4. 4.Untrusted text is inserted through an HTML-parsing sink although the interface needs only plain text. Which choice avoids that unnecessary interpretation?

    Show answer and explanation
    1. Minify the insertion code.
    2. Use an appropriate text-content API.
    3. Trust the value because it came from JSON.
    4. Remove spaces from the string.

    Answer: Use an appropriate text-content API.

    Choose the representation required by the task. Plain text need not be interpreted as markup; data format alone does not establish trust.

  5. 5.A component escapes text for an HTML text node, then reuses that output inside a script context. What should review verify?

    Show answer and explanation
    1. Only that one escaping function ran
    2. Only that the string was previously displayed safely
    3. Correct handling for the destination context
    4. A guarantee every context uses identical escaping rules

    Answer: Correct handling for the destination context

    Output handling depends on where data is interpreted. Safety in one context does not establish safety in every other parser context.

  6. 6.A rich-text feature deliberately permits limited markup from users. What must its handling define?

    Show answer and explanation
    1. A suitable sanitization policy and allowed content model
    2. Only whether the input is valid JSON
    3. A guarantee all user markup is safe after whitespace removal
    4. Only a maximum character count

    Answer: A suitable sanitization policy and allowed content model

    Rich content requires a defined policy and a suitable maintained implementation. Plain encoding validity does not enforce which markup behaviors are allowed.

  7. 7.An application validates links by checking that the string contains example.org anywhere. What must a meaningful URL policy inspect?

    Show answer and explanation
    1. A guarantee a familiar hostname anywhere establishes the destination
    2. The parsed URL and relevant scheme/origin rules
    3. Only a substring match
    4. Only the link's visible text

    Answer: The parsed URL and relevant scheme/origin rules

    A string can contain a trusted-looking hostname without naming it as the actual destination. Parse and validate the components relevant to the policy.

  8. 8.A redirect feature accepts a destination from a query parameter. The contract allows only same-origin destinations. What should be checked?

    Show answer and explanation
    1. Only whether the string begins with a slash character
    2. A guarantee all relative-looking strings have the intended destination
    3. Only the link label shown to the user
    4. The resolved destination's origin under the intended URL rules

    Answer: The resolved destination's origin under the intended URL rules

    URL resolution and parsing determine the actual destination. Enforce the stated origin policy rather than rely on a superficial string test.

  9. 9.A parent window receives postMessage data and trusts it without checking its origin or expected sender. What should the receiver validate?

    Show answer and explanation
    1. The sender boundary and message schema
    2. Only that an event arrived
    3. Only that the payload is a string
    4. A guarantee every message came from its own embedded frame

    Answer: The sender boundary and message schema

    Cross-context messages need appropriate origin/source validation and data handling. Event delivery alone does not establish a trusted sender.

  10. 10.A page posts sensitive data to a frame using targetOrigin='*', although one specific origin is intended. What should sending policy restrict?

    Show answer and explanation
    1. Only the message's character count
    2. Only the current frame's visual position
    3. The intended recipient origin
    4. A guarantee a wildcard selects the originally intended page forever

    Answer: The intended recipient origin

    Restrict delivery according to the actual trust boundary. A frame can navigate, and a wildcard does not bind the message to one intended origin.

  11. 11.A browser blocks a script from reading a cross-origin response after the server has already processed the request. Which conclusion about the server-side outcome is justified?

    Show answer and explanation
    1. Read rejection alone does not establish server-side rollback.
    2. No request could have been sent under any CORS failure.
    3. A response hidden from script guarantees no data was written.
    4. The browser automatically rolls back the server transaction.

    Answer: Read rejection alone does not establish server-side rollback.

    CORS governs browser-mediated response access under its rules. A read failure is not a rollback mechanism for a request already processed by the server.

  12. 12.A public API accepts requests from non-browser clients. Its only access control is a restrictive CORS response policy. What boundary is missing?

    Show answer and explanation
    1. Only another browser origin string
    2. Server-side authentication and authorization as needed
    3. A guarantee CORS prevents arbitrary clients from sending requests
    4. Only a different response content type

    Answer: Server-side authentication and authorization as needed

    Browser response-access rules do not provide general API authorization. Enforce the operation's access policy on the server.

  13. 13.A credentialed browser fetch expects an explicit allowed origin, but the response uses Access-Control-Allow-Origin: *. Under the standard credentialed CORS rule, what needs correction?

    Show answer and explanation
    1. Only the response body's indentation
    2. Only the caller's variable names
    3. The response's origin/credential permission configuration
    4. A guarantee wildcard permission works identically with credentials

    Answer: The response's origin/credential permission configuration

    Credentialed CORS has stricter requirements than a wildcard public response. Configure permitted origins and credentials according to the actual policy.

  14. 14.A server reflects every Origin value into its allow-origin header while allowing credentials, with no trust check. What must review examine?

    Show answer and explanation
    1. A guarantee reflection itself is an allowlist
    2. Whether untrusted origins gain credentialed read access
    3. Only the number of configured routes
    4. Only whether the reflected string is syntactically a URL

    Answer: Whether untrusted origins gain credentialed read access

    A dynamic response must still enforce a meaningful trust policy. Reflecting arbitrary input is not equivalent to selecting approved origins.

  15. 15.A preflight succeeds for a method and headers. What must the actual operation still enforce?

    Show answer and explanation
    1. A guarantee preflight approval proves the caller may access every object
    2. Its own authorization and validation rules
    3. Only the preflight's successful status
    4. Only the browser's user-agent string

    Answer: Its own authorization and validation rules

    Preflight permission is not business authorization. The server handling the real request must enforce its actual operation contract.

  16. 16.A state-changing endpoint relies on a cookie automatically sent by browsers. What request-forgery question must design assess?

    Show answer and explanation
    1. A guarantee every cookie-authenticated request is user-intended
    2. Only the session cookie's display name
    3. Only whether JavaScript can read the cookie
    4. Whether an unintended cross-site request can trigger the effect

    Answer: Whether an unintended cross-site request can trigger the effect

    Authentication cookies can accompany requests independently of the application's intended interaction. Use appropriate defenses under the request and deployment model.

  17. 17.A session cookie has HttpOnly, but hostile script can already run in the page's origin. Which claim is too strong?

    Show answer and explanation
    1. HttpOnly makes all script-driven account actions impossible.
    2. Other script execution risks still require attention.
    3. Direct script access to that cookie value is restricted.
    4. Server-side authorization is still relevant.

    Answer: HttpOnly makes all script-driven account actions impossible.

    HttpOnly restricts direct cookie access through script interfaces. It does not generally stop running same-origin script from attempting authenticated actions.

  18. 18.A cookie is marked Secure. What should not be inferred solely from that attribute?

    Show answer and explanation
    1. That other cookie attributes can have separate purposes
    2. That transport configuration remains relevant
    3. That its stored value is encrypted at rest
    4. That its sending policy is restricted to secure transport under the cookie rules

    Answer: That its stored value is encrypted at rest

    Secure is a transport-related cookie attribute, not a general encryption or authorization guarantee. Describe each protection within its actual scope.

  19. 19.A team describes same-site and same-origin as identical. Two HTTPS subdomains share a registrable domain but have different hostnames. What distinction should be checked?

    Show answer and explanation
    1. A guarantee every same-site pair is same-origin
    2. Only the names of the frontend frameworks
    3. Only whether both pages use HTML
    4. Site-based cookie rules versus origin-based boundaries

    Answer: Site-based cookie rules versus origin-based boundaries

    Origins include scheme, host, and port under the applicable rules; site-based concepts serve a different boundary. Do not substitute one for the other.

  20. 20.A browser logout clears application state but leaves a still-valid server session and credential cookie. What must logout semantics account for?

    Show answer and explanation
    1. The actual credential and server-session lifecycle
    2. Only the hidden navigation menu
    3. Only removal of the user's displayed name
    4. A guarantee clearing one JavaScript object revokes server access

    Answer: The actual credential and server-session lifecycle

    A UI state change does not automatically invalidate credentials or server sessions. Implement the promised logout behavior at the relevant boundaries.

  21. 21.A cookie's Path attribute is treated as a complete isolation boundary between mutually untrusted applications on one origin. What should be reconsidered?

    Show answer and explanation
    1. Only the cookie's expiry date
    2. Only the length of each route
    3. The actual same-origin security boundary
    4. A guarantee path matching creates separate origins

    Answer: The actual same-origin security boundary

    Cookie path controls sending scope under cookie rules; it is not a complete origin-level isolation mechanism. Use boundaries appropriate to the threat model.

  22. 22.An application stores a long-lived credential in script-readable storage. What risk changes if its origin suffers script injection?

    Show answer and explanation
    1. Only a CSS file can read the storage.
    2. Stored values become automatically encrypted.
    3. The browser guarantees every stored value remains secret from same-origin code.
    4. The credential may be accessible to that script.

    Answer: The credential may be accessible to that script.

    Choose credential handling with the actual execution and threat model in mind. Script-readable storage does not protect a value from code running with that origin's access.

  23. 23.A CSP is delivered only in Report-Only mode. What should the rollout not claim from that mode alone?

    Show answer and explanation
    1. That enforcement mode is a separate decision
    2. That reported violations were blocked by that policy
    3. That reports can inform investigation
    4. That a policy was evaluated for reporting

    Answer: That reported violations were blocked by that policy

    Report-only evaluation is evidence about policy behavior, not the same as active blocking. Verify the delivered headers and intended rollout state.

  24. 24.A CSP allows an untrusted page fragment to supply its own script nonce value and treats that value as trusted authorization. What must nonce handling preserve?

    Show answer and explanation
    1. An unpredictable trusted value and a suitable trust boundary
    2. Only matching text between untrusted fields
    3. A guarantee naming a value nonce makes it protective
    4. Only a nonempty nonce attribute

    Answer: An unpredictable trusted value and a suitable trust boundary

    A nonce-based policy depends on trusted generation and use. Letting untrusted content choose its authorization value defeats the intended boundary.

  25. 25.A CSP blocks one observed injection attempt. What should the team continue to address?

    Show answer and explanation
    1. The underlying unsafe data interpretation
    2. Only the policy header's byte length
    3. A guarantee one blocked case proves all injection impossible
    4. Only the blocked attempt's browser name

    Answer: The underlying unsafe data interpretation

    CSP can be a useful additional boundary. A successful block does not justify leaving unsafe handling or assuming universal protection.

  26. 26.A script nonce is reused predictably across unrelated responses. What property needs scrutiny?

    Show answer and explanation
    1. A guarantee repetition improves security
    2. Only the script filename extension
    3. Only whether each page parses
    4. Whether it remains an effective unpredictable authorization value

    Answer: Whether it remains an effective unpredictable authorization value

    Nonce design should follow the policy's threat model and generation requirements. Predictability or inappropriate reuse can undermine the intended protection.

  27. 27.A third-party script is granted execution in the main page's origin context. What must a dependency review consider?

    Show answer and explanation
    1. A guarantee externally hosted scripts have no access to page data
    2. Its access and behavior within that page's privileges
    3. Only the script's compressed size
    4. Only the provider's logo

    Answer: Its access and behavior within that page's privileges

    Loading code into a privileged page can grant substantial access. Assess provenance, necessity, integrity where applicable, and isolation options.

  28. 28.A sandboxed frame is used for untrusted content, but configuration relaxes the exact restrictions the design relies on. What should be verified?

    Show answer and explanation
    1. Only the existence of the sandbox attribute
    2. Only the frame's border style
    3. The effective capabilities of the deployed frame
    4. A guarantee every sandbox token combination has identical protection

    Answer: The effective capabilities of the deployed frame

    Security depends on effective configuration and interactions, not the label alone. Test the actual privileges the chosen policy permits.

  29. 29.A browser cache stores a personalized response under a key that omits the user or authorization context. What must correctness review assess?

    Show answer and explanation
    1. Cross-user response reuse
    2. Only the cache's hit rate
    3. Only whether the response is valid JSON
    4. A guarantee cached responses cannot contain private data

    Answer: Cross-user response reuse

    Cache identity and policy must reflect the result's scope. A fast hit can still return another user's data.

  30. 30.A response contract forbids storing the response. Which HTTP cache directive directly expresses that storage requirement?

    Show answer and explanation
    1. no-store
    2. no-cache
    3. public
    4. max-age=86400

    Answer: no-store

    No-store instructs caches not to store the response under the applicable rules. No-cache instead concerns reuse without successful validation; it is not simply the same directive.

  31. 31.A cache directive requires validation before reuse. A team equates it with never storing any bytes. What distinction should be corrected?

    Show answer and explanation
    1. A guarantee every cache directive has identical semantics
    2. Only compression versus encryption
    3. Only request versus response body size
    4. Storage versus validated reuse

    Answer: Storage versus validated reuse

    A response can be stored yet require validation before reuse. Read the exact directive semantics and actual cache implementation.

  32. 32.A service worker returns a previously cached personalized page after logout. What must its cache strategy honor?

    Show answer and explanation
    1. A guarantee server logout deletes every browser-managed cache entry
    2. Only the newest JavaScript bundle's version
    3. Only the network's current speed
    4. User/session scope and logout invalidation semantics

    Answer: User/session scope and logout invalidation semantics

    Client-managed caches need their own correct identity and lifecycle rules. A server state change does not automatically remove every local artifact.

  33. 33.A frontend release changes the API response shape, while a stale cached script still expects the old shape. What rollout issue should be assessed?

    Show answer and explanation
    1. Only the asset's compression level
    2. Only the new source revision
    3. Compatibility of cached clients and current responses
    4. A guarantee publishing assets updates every open tab immediately

    Answer: Compatibility of cached clients and current responses

    Clients can outlive a deployment. Versioning, cache policy, and compatibility should support the intended transition.

  34. 34.A content-hashed script URL changes, but cached HTML still references the old script and the old asset is immediately deleted. What can break?

    Show answer and explanation
    1. Clients using the retained old HTML
    2. A guarantee hashed URLs keep deleted files available
    3. Only clients already using the newest script
    4. Only the asset's displayed filename

    Answer: Clients using the retained old HTML

    Asset retention and HTML cache lifetimes must be coordinated. A content hash identifies an artifact; it does not preserve a removed artifact's availability.

  35. 35.A preload fetches one image URL, but the rendered image resolves to a different URL. The network trace shows both downloads. What should optimization review align?

    Show answer and explanation
    1. A guarantee any image preload accelerates every later image URL
    2. Only the image's alternative text
    3. The preload and actual resource selection
    4. Only the preload tag's order in source

    Answer: The preload and actual resource selection

    Preloading helps when it fetches the resource the page will actually use under compatible conditions. Inspect the resolved request and reuse behavior.

  36. 36.Two resource requests use the same visible path but different relevant credentials or cache contexts. What should a reuse claim verify?

    Show answer and explanation
    1. Only the resource's file extension
    2. Only equality of displayed path strings
    3. The complete request and cache-matching semantics
    4. A guarantee every same-path request shares one cache entry

    Answer: The complete request and cache-matching semantics

    Resource reuse depends on the actual request and cache rules. A simplified URL display may omit relevant differences.

  37. 37.A broken service worker keeps serving stale application assets after the server is corrected. What recovery path should be tested?

    Show answer and explanation
    1. A guarantee server rollback immediately replaces every active worker
    2. Only the server's latest source revision
    3. Client cache and worker lifecycle behavior
    4. Only a successful response from a fresh command-line client

    Answer: Client cache and worker lifecycle behavior

    Client-managed execution and caches can outlive a server change. Verify the update and recovery path in affected browser states.

  38. 38.A frontend error reporter sends full URLs containing sensitive query parameters to an external collection service. What should telemetry review minimize?

    Show answer and explanation
    1. Unnecessary sensitive data in reports
    2. Only the JavaScript bundle size
    3. A guarantee error reporting is outside data-boundary review
    4. Only the number of stack frames

    Answer: Unnecessary sensitive data in reports

    Useful diagnosis should use appropriate context and data controls. An observability pipeline is also a data transfer with its own scope.

  39. 39.A public source map reveals browser-delivered code and a credential that was accidentally bundled. What is the primary underlying secret-handling defect?

    Show answer and explanation
    1. Only the use of a build tool
    2. The credential was shipped to the client.
    3. Only the map's readable formatting
    4. A guarantee deleting the source map makes the distributed credential private

    Answer: The credential was shipped to the client.

    A source map can make inspection easier, but the client bundle already contains the credential. Correct the actual secret boundary and handle the exposure appropriately.

  40. 40.Two enforced CSP policies apply to a page. A script is allowed by one and blocked by the other. Under the standard combined enforcement model, what must the script satisfy?

    Show answer and explanation
    1. A guarantee a second policy cancels the first
    2. All applicable enforced policies
    3. Only whichever policy appears last
    4. Only the most permissive policy

    Answer: All applicable enforced policies

    Multiple enforced policies apply together; adding one does not generally relax another. Review effective enforcement rather than assume a last-policy overwrite.

  41. 41.An API response arrives in 60 ms, but the interface cannot paint feedback for another 900 ms because the main thread is busy. What should diagnosis examine?

    Show answer and explanation
    1. Only the API payload's status code
    2. A guarantee fast networking makes the interaction responsive
    3. Only server response time
    4. Main-thread work and rendering delay

    Answer: Main-thread work and rendering delay

    User-visible response includes scheduling and rendering. A quick network result can wait behind expensive browser work.

  42. 42.A large synchronous computation runs in one input handler. What change should be evaluated for responsiveness while preserving correct results?

    Show answer and explanation
    1. Only renaming the handler
    2. Only compressing unrelated images
    3. A guarantee fewer network requests makes all CPU work nonblocking
    4. Reducing, dividing, or appropriately moving that work

    Answer: Reducing, dividing, or appropriately moving that work

    Inspect the actual expensive path. Suitable chunking or off-main-thread work can help, with attention to scheduling, data transfer, and correctness.

  43. 43.A supplied browser model drains queued promise microtasks before its next rendering opportunity. An application splits expensive work into a continuous chain of those microtasks. What is still possible?

    Show answer and explanation
    1. Promise syntax automatically runs work on a worker.
    2. Every microtask guarantees a visible frame between chunks.
    3. Rendering remains delayed by the whole chain.
    4. The computation's CPU cost becomes zero.

    Answer: Rendering remains delayed by the whole chain.

    Asynchronous syntax does not necessarily yield to rendering. Use scheduling with the actual event-loop and workload behavior in mind.

  44. 44.A callback scheduled with requestAnimationFrame performs 80 ms of synchronous work before returning. What should review avoid assuming?

    Show answer and explanation
    1. That the callback can contain JavaScript
    2. That a shorter equivalent computation could help
    3. That scheduling the callback makes its work cheap or nonblocking
    4. That its work consumes execution time

    Answer: That scheduling the callback makes its work cheap or nonblocking

    A rendering-related callback still runs work. Heavy synchronous processing can delay the frame it was intended to support.

  45. 45.In a supplied browser trace, each geometry read after a style write forces layout. A loop alternates those operations for 100 elements. What should optimization consider?

    Show answer and explanation
    1. Batching reads and writes when semantics allow
    2. A guarantee every geometry read is free
    3. Only shortening variable names
    4. Only moving the same loop into a promise microtask

    Answer: Batching reads and writes when semantics allow

    The dependency between reads and invalidated layout can cause repeated work. Reorganize carefully and measure the actual layout behavior.

  46. 46.A performance patch reduces rendering time by omitting the latest edited value from the display. What must evaluation include?

    Show answer and explanation
    1. Only the number of DOM operations removed
    2. A guarantee any faster render is an equivalent improvement
    3. Observable correctness of the rendered state
    4. Only the shorter rendering duration

    Answer: Observable correctness of the rendered state

    Optimization should preserve the UI contract. A faster stale or incomplete result is not an equivalent successful interaction.

  47. 47.A virtualized list renders 20 nodes but still downloads and retains all 5,000 full records. Which cost can remain substantial?

    Show answer and explanation
    1. Only the twenty visible labels can occupy memory
    2. A guarantee the DOM still contains 5,000 item nodes
    3. A guarantee virtualization eliminates all network cost
    4. Data transfer and retained record memory

    Answer: Data transfer and retained record memory

    Virtualization can reduce rendered nodes without reducing every data or computation cost. Measure each relevant resource separately.

  48. 48.A compressed script is small over the network but expands into code that takes a long time to parse and execute. What should a budget assess?

    Show answer and explanation
    1. Transfer, parse, and execution costs
    2. A guarantee compression reduces every browser cost proportionally
    3. Only compressed byte count
    4. Only the number of script tags

    Answer: Transfer, parse, and execution costs

    Wire size is one component. CPU work and execution structure affect responsiveness and startup independently.

  49. 49.A page paints a small loading message quickly, then delays its large main content for several seconds. What should load measurement distinguish?

    Show answer and explanation
    1. Only the first painted text
    2. A guarantee any first paint means useful content is ready
    3. Early visible feedback from main-content readiness
    4. Only the loading indicator's font size

    Answer: Early visible feedback from main-content readiness

    Different milestones describe different experiences. Inspect the content and task the metric is intended to represent.

  50. 50.A page downloads a 3,000×2,000 image to display at 300×200 CSS pixels on a one-device-pixel-per-CSS-pixel display. What source-selection question matters?

    Show answer and explanation
    1. Only whether the image decodes successfully
    2. Only the image's filename length
    3. A guarantee displayed dimensions reduce the downloaded bytes automatically
    4. Whether a suitable smaller resource meets the visual requirement

    Answer: Whether a suitable smaller resource meets the visual requirement

    CSS sizing does not by itself select a smaller file. Choose and measure resources appropriate to display needs and quality requirements.

  51. 51.A page inserts an image only after download without reserving its expected space. Nearby content moves. What layout design should be evaluated?

    Show answer and explanation
    1. A stable reserved geometry that fits the actual image
    2. A guarantee asynchronous insertion never affects layout
    3. Only changing the download's request ID
    4. Only a smaller alt string

    Answer: A stable reserved geometry that fits the actual image

    Content dimensions and placeholders can help preserve layout. The reserved space must match the actual responsive result rather than merely exist.

  52. 52.A font preload downloads a file for a weight the page never uses, while the required font starts later. What evidence should guide the fix?

    Show answer and explanation
    1. Actual font selection and request reuse
    2. Only the presence of any preload
    3. Only the font family's display name
    4. A guarantee one font file satisfies every weight and style

    Answer: Actual font selection and request reuse

    Align preload configuration with the actual resource selected by styles and browser behavior. Inspect the request path instead of counting preload tags.

  53. 53.A third-party script is marked async. It later executes a long synchronous task on the main thread. What remains possible?

    Show answer and explanation
    1. Async guarantees no main-thread execution cost.
    2. Only parser blocking can ever affect responsiveness.
    3. The browser must execute it in a separate worker.
    4. It delays interaction and painting during execution.

    Answer: It delays interaction and painting during execution.

    Async loading changes some scheduling behavior but does not make arbitrary script execution free. Measure its actual runtime impact.

  54. 54.A module is dynamically imported immediately before it is needed for the first view. The import is on the critical path. What should a loading claim reflect?

    Show answer and explanation
    1. A guarantee dynamic import removes all startup cost
    2. Only the module's source filename
    3. Only the use of import() syntax
    4. Its actual discovery, download, and execution timing

    Answer: Its actual discovery, download, and execution timing

    Deferral syntax does not establish a faster first view. The timing and dependencies determine whether work is moved off the relevant path.

  55. 55.A patch halves transfer bytes while measured parse and execution time stay unchanged. What performance improvement is directly supported?

    Show answer and explanation
    1. A guarantee CPU time also halved
    2. Reduced transfer size under the measurement
    3. A proof that interaction latency is now zero
    4. A guarantee every user's total load time halved

    Answer: Reduced transfer size under the measurement

    Report the component actually measured. End-to-end gains depend on which components dominate for relevant users.

  56. 56.A page adds an event listener on every mount but never removes it. After five mount/unmount cycles, one event triggers repeated work. What should lifecycle review inspect?

    Show answer and explanation
    1. A guarantee unmounting always removes manually registered listeners
    2. Subscription ownership and cleanup
    3. Only the event's text label
    4. Only the browser window's width

    Answer: Subscription ownership and cleanup

    Resources need lifecycle handling matching their registration scope. Repeated subscriptions can duplicate work and retain objects.

  57. 57.A performance observer from an old view continues reporting after navigation, and its events are attributed to the new view. What association is missing?

    Show answer and explanation
    1. Only the new view's title text
    2. Only the number of downloaded stylesheets
    3. A guarantee every observed event belongs to the current route
    4. Measurement ownership and lifecycle

    Answer: Measurement ownership and lifecycle

    Instrumentation must bind events to the correct view or operation and retire obsolete observers where appropriate.

  58. 58.Two timing values come from different time origins. A report subtracts them as though they shared one origin. What must be established?

    Show answer and explanation
    1. A guarantee all browser clocks share the same zero
    2. Only that both values are numbers
    3. Only the number of printed decimal places
    4. A valid common time reference or conversion

    Answer: A valid common time reference or conversion

    Timing values need compatible origins and semantics. Numeric units alone do not make arbitrary timestamps directly comparable.

  59. 59.A browser withholds detailed timing for a cross-origin resource, but the network trace shows it loaded. What should a diagnostic avoid concluding from missing detail alone?

    Show answer and explanation
    1. That the network trace contains evidence of a request
    2. That the browser exposed limited information
    3. That another suitable measurement can be useful
    4. That the resource request never occurred

    Answer: That the resource request never occurred

    Observability can have access and implementation limits. Missing a detailed field is not proof of missing work when other evidence shows it occurred.

  60. 60.A lab run uses a fast desktop and warm caches, while field users include slower devices and cold starts. What should a general performance claim include?

    Show answer and explanation
    1. A guarantee identical code yields identical user timing
    2. Only the source code revision
    3. The relevant device and cache-condition differences
    4. Only the lab's fastest run

    Answer: The relevant device and cache-condition differences

    Performance depends on workload and environment. Qualify and test the conditions relevant to the intended audience.

  61. 61.A dashboard averages p95 latency values from several groups and calls the result the global p95. What should be corrected?

    Show answer and explanation
    1. Only the group names
    2. Only the metric's color
    3. The quantile aggregation method
    4. A guarantee percentiles average into the same global percentile

    Answer: The quantile aggregation method

    A global quantile generally depends on the combined distributions and their weights. Group percentile values alone do not determine it.

  62. 62.A page's mean interaction latency improves while a small but critical editing flow becomes much slower. What should review examine?

    Show answer and explanation
    1. Only the new global mean
    2. A guarantee every flow improved when the average fell
    3. Task-specific and tail behavior
    4. Only the number of measured interactions

    Answer: Task-specific and tail behavior

    Aggregate improvement can hide a local regression. Assess the workflows and users affected by the change.

  63. 63.A release's field score improves after traffic shifts to faster devices. What must attribution consider?

    Show answer and explanation
    1. A guarantee any improvement after a release was caused by it
    2. Only the aggregate score
    3. Population mix as well as code changes
    4. Only the release timestamp

    Answer: Population mix as well as code changes

    User and device composition can confound a before/after result. Compare relevant cohorts and measurement definitions.

  64. 64.An interaction metric ends at the next visible feedback, while an async save finishes later. What should a product reliability report track separately?

    Show answer and explanation
    1. Only the button's animation duration
    2. Only the early feedback metric
    3. A guarantee first feedback proves durable save success
    4. The eventual save outcome and completion time

    Answer: The eventual save outcome and completion time

    Early responsiveness and completion of an operation are different outcomes. A fast acknowledgment can coexist with a failed or slow save.

  65. 65.A performance test omits user interactions and measures only initial loading. What evidence is missing for a responsiveness claim?

    Show answer and explanation
    1. The observed initial-load timings
    2. The existence of the test's page navigation
    3. Behavior during relevant interactions
    4. The ability to inspect startup resources

    Answer: Behavior during relevant interactions

    Loading and interaction performance have different paths and bottlenecks. Exercise the tasks relevant to the claim.

  66. 66.An application serves a stale response quickly from cache, although the task requires current state. What must its success metric incorporate?

    Show answer and explanation
    1. A guarantee faster cached data are always acceptable
    2. Correctness and freshness under the task contract
    3. Only the cache hit rate
    4. Only response latency

    Answer: Correctness and freshness under the task contract

    Performance should be measured for a valid result. A quick response can still fail the actual information requirement.

  67. 67.A load-time comparison uses different image quality settings between variants. What tradeoff should be reported?

    Show answer and explanation
    1. Only the rendering library's name
    2. Achieved visual quality and loading cost
    3. Only the smaller file size
    4. A guarantee every compression change preserves identical output

    Answer: Achieved visual quality and loading cost

    Different outputs may have different costs. Compare at a suitable quality target or state the tradeoff explicitly.

  68. 68.A script optimization is tested once on a quiet machine. Its claimed gain is smaller than ordinary rerun variation. What evidence would strengthen the conclusion?

    Show answer and explanation
    1. Comparable repeated measurements and uncertainty assessment
    2. Only a more confident claim
    3. Only more digits in the single time
    4. A guarantee one favorable run estimates every user's experience

    Answer: Comparable repeated measurements and uncertainty assessment

    Measure variability and control relevant conditions. A small apparent gain may not be resolved by a noisy single observation.

  69. 69.A supplied CPU model budgets 1,000 ms of main-thread work per second. Forty events each cost 8 ms and thirty renders each cost 12 ms. Ignoring other work, what budget remains?

    Show answer and explanation
    1. 320 ms
    2. 680 ms
    3. 200 ms
    4. 1,000 ms

    Answer: 320 ms

    Event work is 40×8=320 ms and render work is 30×12=360 ms. Total is 680 ms, leaving 320 ms in the toy model; actual scheduling still affects responsiveness.

  70. 70.A view needs two independent downloads of 300 and 500 ms in parallel, followed by 200 ms parsing that cannot overlap them. Ignoring overhead, what critical-path duration follows?

    Show answer and explanation
    1. 1,000 ms
    2. 700 ms
    3. 500 ms
    4. 200 ms

    Answer: 700 ms

    Both required downloads finish after max(300,500)=500 ms, then parsing adds 200 ms. The model's dependency graph determines the sum.

  71. 71.A waterfall contains a large image download that finishes early, but a late data request prevents the main view from rendering. What should optimization prioritize for that view?

    Show answer and explanation
    1. Only the largest byte transfer
    2. A guarantee all large resources are on the critical path
    3. The actual blocking dependency path
    4. Only the first request in the waterfall

    Answer: The actual blocking dependency path

    Size alone does not identify the bottleneck. Trace which dependencies actually gate the relevant user-visible result.

  72. 72.A field metric excludes users whose page crashes before telemetry initialization. What bias should analysis consider?

    Show answer and explanation
    1. Missing the affected failing experiences
    2. Only the average of received successful reports
    3. Only the telemetry payload's compression
    4. A guarantee missing reports represent fast success

    Answer: Missing the affected failing experiences

    Collection can be selective. Treat initialization failures and missingness as part of the measurement's coverage question.

  73. 73.An optimization reduces requests from 40 to 20 but doubles total transferred bytes and delays a critical resource. What should performance assessment compare?

    Show answer and explanation
    1. Only the lower request count
    2. End-to-end cost and the relevant critical path
    3. Only the number of source modules
    4. A guarantee fewer requests always means faster loading

    Answer: End-to-end cost and the relevant critical path

    Request count is a proxy, not the user outcome. Transfer, priority, reuse, CPU, and dependencies can dominate the result.

  74. 74.An instrumentation change stops recording slow interactions because its timeout is too short. The measured percentile improves. What should be examined?

    Show answer and explanation
    1. Only the number of remaining measurements
    2. Only the new percentile value
    3. A guarantee the interface became faster
    4. Selection caused by the measurement timeout

    Answer: Selection caused by the measurement timeout

    Selective missing measurements can improve a metric without improving performance. Validate collection and denominator semantics.

  75. 75.A third-party script's bytes match a configured integrity digest under the chosen integrity mechanism. What does that check fail to establish by itself?

    Show answer and explanation
    1. That the script's behavior is trustworthy
    2. The possibility of reviewing the script's privileges separately
    3. That the checked bytes passed the integrity condition
    4. That an integrity comparison was performed

    Answer: That the script's behavior is trustworthy

    Artifact integrity and trust in its behavior are different questions. A known artifact can still have excessive privileges or harmful behavior.

  76. 76.A deployment changes script bytes but retains an integrity value for the old artifact. What should release testing detect?

    Show answer and explanation
    1. Only the script's visual filename
    2. A guarantee a matching URL implies matching content
    3. A mismatch between the resource and its integrity metadata
    4. Only the order of unrelated style tags

    Answer: A mismatch between the resource and its integrity metadata

    Coordinate resource content and integrity configuration. An unchanged path does not establish unchanged bytes.

  77. 77.A CSP works on the development server, but the production edge omits its header. What evidence is needed?

    Show answer and explanation
    1. Only the local configuration file
    2. A guarantee policy source code is always the deployed policy
    3. The effective policy delivered to real clients
    4. Only a successful development build

    Answer: The effective policy delivered to real clients

    Check the response that reaches the browser through the actual delivery path. Configuration intent and effective enforcement can differ.

  78. 78.A security test checks that a CSP header exists but never inspects its directives or enforcement mode. What remains untested?

    Show answer and explanation
    1. The fact that a response was received
    2. The header's observed presence
    3. The possibility of parsing its value
    4. Whether the effective policy supports the intended boundary

    Answer: Whether the effective policy supports the intended boundary

    A named header alone does not establish a suitable policy. Evaluate actual directives, delivery, mode, and relevant browser behavior.

  79. 79.A policy rollout reports many violations caused by a browser extension rather than application code. What should investigation distinguish?

    Show answer and explanation
    1. Sources and relevance of violation evidence
    2. A guarantee every violation has one application cause
    3. Only the raw report count
    4. Only the length of the report endpoint's URL

    Answer: Sources and relevance of violation evidence

    Reports are evidence to classify, not automatic proof of one defect. Examine the origin, affected behavior, and actual policy scope.

  80. 80.A test uses a privileged non-browser HTTP client and concludes that browser CORS behavior is correct. What test scope is missing?

    Show answer and explanation
    1. Only server response bytes
    2. Only the endpoint's successful status
    3. A guarantee every HTTP client enforces browser-origin rules
    4. The actual browser enforcement path

    Answer: The actual browser enforcement path

    A server test can validate headers, but browser enforcement has its own relevant conditions. Exercise the client model on which the claim depends.

  81. 81.A security regression tests one same-origin deployment, while production separates the frontend and API origins. What configuration needs coverage?

    Show answer and explanation
    1. Only the API's source language
    2. The deployed origin and credential relationships
    3. Only the local route names
    4. A guarantee origin layout cannot affect browser behavior

    Answer: The deployed origin and credential relationships

    Origin, cookie, CORS, and transport rules can change across deployment layouts. Test the relevant production relationships explicitly.

  82. 82.A browser response-access test passes for anonymous data but is used to certify credentialed access. What distinction should be tested?

    Show answer and explanation
    1. A guarantee anonymous and credentialed CORS have identical rules
    2. Credential mode and corresponding response permissions
    3. Only the URL path
    4. Only the response's JSON shape

    Answer: Credential mode and corresponding response permissions

    Credentials can change the applicable access requirements. Exercise the actual request mode and policy rather than extrapolate from one simpler case.

  83. 83.A state-changing action is performed through a GET route because the UI normally calls it only after confirmation. What design assumption should be reviewed?

    Show answer and explanation
    1. Only the route's character count
    2. A guarantee the frontend confirmation prevents every unintended request
    3. Only the confirmation dialog's color
    4. Whether the method and server behavior fit the intended action semantics

    Answer: Whether the method and server behavior fit the intended action semantics

    Server effects should match the method and security contract. A UI convention does not control every caller or browser-triggered request path.

  84. 84.An application validates a URL before one decoding step, then uses a differently decoded or resolved value. What boundary should be aligned?

    Show answer and explanation
    1. Only whether a validation function returned true
    2. The validated representation and actual interpreted destination
    3. Only the original string's length
    4. A guarantee every transformation preserves the validated meaning

    Answer: The validated representation and actual interpreted destination

    Canonicalization and interpretation can change meaning. Validate according to the representation and parser actually used at the effect boundary.

  85. 85.A sanitization result is later concatenated with untrusted markup before insertion. What must be reassessed?

    Show answer and explanation
    1. The safety of the final composed value in its destination
    2. A guarantee one sanitized component makes every later composition safe
    3. Only the length of the trusted fragment
    4. Only the earlier sanitization function's success

    Answer: The safety of the final composed value in its destination

    Safety is not automatically preserved by arbitrary later composition. Review the complete final value and interpretation context.

  86. 86.A security fix changes one rendering helper, but another route still inserts the same data through an unsafe helper. What should coverage follow?

    Show answer and explanation
    1. Only the shared helper's unit test
    2. A guarantee one patched function protects unused call paths
    3. All relevant data-to-sink paths
    4. Only the original failing component

    Answer: All relevant data-to-sink paths

    Track actual callers and sinks. A fix applies where the corrected behavior is used, not automatically across every similar route.

  87. 87.A test proves a control hides private data visually, but the full private record remains in a public page response. What is the real boundary issue?

    Show answer and explanation
    1. Only the screenshot's crop
    2. A guarantee hidden elements make response data confidential
    3. The data were delivered to an unauthorized client.
    4. Only the CSS visibility property

    Answer: The data were delivered to an unauthorized client.

    Presentation does not undo disclosure in delivered data. Authorize and minimize content before sending it across the relevant trust boundary.

  88. 88.An app uses one shared response cache for account-specific data and keys only by pathname. What should a multi-user regression test check?

    Show answer and explanation
    1. Only the cache's average hit rate
    2. A guarantee matching paths imply matching permitted responses
    3. Only repeated requests by one user
    4. Isolation between different authorized sessions

    Answer: Isolation between different authorized sessions

    Test the result's actual identity and authorization scope. A same-user happy path can miss cross-session reuse.

  89. 89.A logout test clears cookies in a fresh tab but never tests an already open tab's in-memory or service-worker state. What coverage remains?

    Show answer and explanation
    1. Other retained client state and its allowed lifecycle
    2. Only the logout button's label
    3. A guarantee all tabs share one automatically cleared state object
    4. Only the fresh tab's current cookie list

    Answer: Other retained client state and its allowed lifecycle

    Client state can live in several contexts and stores. Verify the actual logout contract across relevant retained sessions and views.

  90. 90.A performance improvement appears only because error responses are much smaller than successful responses. What should evaluation separate?

    Show answer and explanation
    1. A guarantee every smaller response is a valid improvement
    2. Only the fastest response
    3. Only the average response size
    4. Equivalent successful outcomes from failures

    Answer: Equivalent successful outcomes from failures

    A fast failure is not an equivalent successful operation. Compare costs and responsiveness for the outcomes users actually need.

  91. 91.A browser worker speeds up computation but adds significant serialization and transfer overhead. What should a claim about the interaction measure?

    Show answer and explanation
    1. A guarantee off-main-thread work has zero communication cost
    2. Only the number of worker threads
    3. Only the worker's computation time
    4. Total user-visible cost and responsiveness

    Answer: Total user-visible cost and responsiveness

    Offloading can help the main thread while adding other costs. Measure the full interaction and relevant resource tradeoffs.

  92. 92.A component memoizes a result using dependencies that omit the current user. The output contains user-specific data. What correctness issue should be tested?

    Show answer and explanation
    1. Stale or cross-user result reuse
    2. Only whether the memoized value exists
    3. A guarantee memoization preserves every omitted input's effect
    4. Only a lower render count

    Answer: Stale or cross-user result reuse

    A cache or memo key must represent the inputs that determine the result. Optimization must preserve both correctness and data scope.

  93. 93.A page loads a new JavaScript version but reuses an incompatible persisted client-state schema. What should its update path include?

    Show answer and explanation
    1. State compatibility or a justified migration/reset
    2. Only the deployment timestamp
    3. Only the bundle's content hash
    4. A guarantee updated code makes stored state compatible automatically

    Answer: State compatibility or a justified migration/reset

    Persisted browser state can outlive code. Validate its schema and apply an appropriate transition under the product contract.

  94. 94.A main-thread optimization is evaluated only on a mouse click, while typing and touch use different handlers. What test matrix is relevant?

    Show answer and explanation
    1. Only another identical click
    2. The supported interaction paths and devices
    3. A guarantee one input method exercises every path
    4. Only the shared component name

    Answer: The supported interaction paths and devices

    Input methods can take different code and scheduling paths. Test the actual interactions the performance claim covers.

  95. 95.A dashboard shows a large score gain but changes its metric definition at the same release. What must comparison reconcile?

    Show answer and explanation
    1. A guarantee every value with the same label is comparable
    2. Measurement semantics and actual behavioral changes
    3. Only the score's numerical direction
    4. Only the release's date

    Answer: Measurement semantics and actual behavioral changes

    A metric-definition change can create an apparent improvement. Compare like quantities or explain the conversion and its limits.

  96. 96.A request returns an error, but a frontend promise handler treats any resolved fetch as application success without checking the response. What should outcome handling inspect?

    Show answer and explanation
    1. The response's status and operation contract
    2. Only whether the promise resolved
    3. Only the number of response headers
    4. A guarantee network completion means the business operation succeeded

    Answer: The response's status and operation contract

    Transport completion and successful application outcome differ. Handle the actual response and error semantics rather than a generic resolved state.

  97. 97.A script timing report sums durations that overlap across network and worker activity, then calls the sum page load time. What accounting error can arise?

    Show answer and explanation
    1. A guarantee the sum equals critical-path latency
    2. Double counting concurrent work
    3. Automatic removal of idle time
    4. A proof that all work ran serially

    Answer: Double counting concurrent work

    Component activity durations and elapsed time are different. Use compatible timing boundaries and the actual dependency graph.

  98. 98.A cache optimization passes correctness tests only when requests arrive in one fixed order. Concurrent requests can complete out of order. What should be added?

    Show answer and explanation
    1. Only another run in the same fixed order
    2. Relevant race and stale-result tests
    3. A guarantee cache hits enforce completion order
    4. Only a faster machine

    Answer: Relevant race and stale-result tests

    Result ownership and cache population can race. Exercise the interleavings and state versions the actual implementation permits.

  99. 99.A release's lab metrics are good, but field reports show crashes only on a supported older browser. What should investigation establish?

    Show answer and explanation
    1. Only the fastest modern-browser result
    2. The affected compatibility path and real deployment behavior
    3. A guarantee a successful build proves every supported browser works
    4. Only the size of the release bundle

    Answer: The affected compatibility path and real deployment behavior

    A build and one test environment do not establish the full support claim. Reproduce the failing combination and inspect actual delivered code and APIs.

  100. 100.A page needs 100 KiB from a link delivering 200 KiB/s, then 150 ms parsing and 50 ms rendering in sequence. Ignoring latency and overlap, what total follows?

    Show answer and explanation
    1. 350 ms
    2. 700 ms
    3. 200 ms
    4. 500 ms

    Answer: 700 ms

    Transfer time is 100/200=0.5 seconds, or 500 ms. Add 150+50 ms to obtain 700 ms under the supplied model.

  101. 101.A response cache keys only by path. User A's account response is stored; user B later receives those bytes quickly. Performance metrics call it a successful hit. What must release judgment prioritize?

    Show answer and explanation
    1. The violated response-isolation contract
    2. Only the improved hit percentage
    3. Only the low response latency
    4. A guarantee a byte-identical cache hit is authorized for every user

    Answer: The violated response-isolation contract

    A cache can preserve bytes while violating who may receive them. Correctness and authorization scope are part of success, not optional additions to timing metrics.