Browsers preflight certain cross-origin requests to ask whether the intended method and headers are permitted. The actual operation follows only under suitable responses.
Before you start
You should understand clients, servers, IP addresses and ports. Follow a request through name resolution, connection establishment and application exchange. Distinguish protocol guarantees from deployment policy, and use observations from the relevant layer rather than guessing from one browser error message.
The practical goal is to reason through this situation: A custom authorization header can require preflight before the main request. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Read requested method and headers
The browser asks whether the intended cross-origin operation is allowed.
Step 2: Inspect OPTIONS behavior
Routing and allowed headers must support the preflight contract.
Step 3: Verify credentials policy
Allowed origin and credential behavior must be consistent.
Worked scenario
A custom authorization header can require preflight before the main request.
A request adds Authorization, triggering preflight under the browser’s rules. The API handles POST correctly but returns an unsuitable OPTIONS response, so the browser never performs the intended main call. Diagnose the preflight network entry first rather than changing the backend’s already working POST handler blindly.
Common mistake
Handling only the main method leaves the browser blocked before the application call.
Verify the behavior
Inspect requested headers, allowed response values and whether the main request was actually sent.
Interview exercise
Diagnose a preflight failure.
Answer and reasoning
Check the OPTIONS response, requested method and headers, allowed origin and credential policy.
Continue learning
Compare the scenario with the Networking interview questions and test your understanding with the Networking MCQs. For terminology and implementation details, consult the reference material.