The interview problem

Practice prompt

A customer's browser integration fails while the same API call works from a command-line client. Build a diagnosis plan.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume a browser calls an API on a different origin. Inspect the browser's preflight and actual request, including method, requested headers and credentials mode. Configure an explicit allowed-origin policy and required methods/headers; ensure error responses also carry the intended CORS headers. Coordinate caching behavior for origin-dependent responses. Keep authentication and authorization checks independent because CORS is a browser enforcement mechanism.

2. Trace the design or derivation

Observe browser request
  → inspect preflight
  → validate origin policy
  → send authenticated request
  → verify response

Use a small customer-owned test page on the real origin to reproduce the request. Browser extensions or local development origins can make ad hoc tests misleading. Record which headers the browser needs to read; allowing a request does not automatically expose every response header to application JavaScript.

3. Calculate the example

A JSON POST with a custom authorization header can trigger an OPTIONS preflight before the POST. If OPTIONS is rejected, the application POST may never be sent, explaining why server business logs show no corresponding request.

4. Failure cases and trade-offs

A wildcard origin does not work as a universal fix for credentialed browser access. A successful preflight does not establish user permission. Broad origin policies simplify integration but widen which browser contexts can read responses under the configured credential rules.

5. Validation, follow-ups and self-review

Test allowed and disallowed origins, credential modes and cached preflights. Follow-up: why does curl succeeding not prove browser compatibility? Self-review: distinguish preflight, authentication and server-side processing.

Sources and related practice

Technical reference: fetch.spec.whatwg.org — Browser preflight, origins and credentials.

Source publication/update: Updated September 21, 2026. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Integrate an AI workflow with an unreliable legacy API; Diagnose payload content-type mismatches.

Continue your preparation

Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.