Interview Patterns ⚡ Recently updatedUpdated on Jun 30, 2026 — this content may still be evolving.
Debugging Scenario Questions
15 realistic “something is broken” scenarios. Walk through: reproduce → inspect → isolate → hypothesize → fix → prevent.
See Framework 7 in answer-frameworks.md.
Question: Blank page after deploy — works on localhost
Difficulty
🟡 Medium
Why Interviewers Ask This
Classic deployment debugging.
Answer
Check browser console for errors. Verify API base URL env vars in production. Check build output path and router (SPA needs redirect rules). Network tab for 404 on JS bundles.
Example
VITE_API_URL still localhost → fix env on Vercel.
Follow-up Questions
- CORS in prod?
- Mixed content HTTP/HTTPS?
- Base path wrong?
Common Mistakes
Only saying ‘CORS’ without checking console first.
Project Connection
Your deploy bug story or checklist you’d run.
Question: API returns 401 on protected route after login
Difficulty
🟡 Medium
Why Interviewers Ask This
Auth debugging staple.
Answer
Verify token sent in Authorization header. Check token expiry. Confirm middleware order. Inspect JWT secret same on server. Clock skew rare but possible.
Example
fetch without headers: { Authorization: Bearer ${token} }.
Follow-up Questions
- Cookie vs header?
- Refresh flow?
- OPTIONS preflight stripping header?
Common Mistakes
Storing token but never attaching to requests.
Project Connection
Trace your login → stored token → API call chain.
Question: CORS error in browser but Postman works
Difficulty
🟢 Easy
Why Interviewers Ask This
Most common student full-stack bug.
Answer
CORS is browser-only. Server must return Access-Control-Allow-Origin. Handle OPTIONS preflight. Don’t use * with credentials.
Example
Add cors({ origin: ‘http://localhost:3000’, credentials: true }).
Follow-up Questions
- Proxy in dev?
- Production origins?
- Why Postman different?
Common Mistakes
Browser CORS extension as ‘fix’ for production.
Project Connection
Your cors() config or vite proxy setup.
Question: React component renders twice / infinite loop
Difficulty
🟡 Medium
Why Interviewers Ask This
useEffect dependency bugs.
Answer
Check useEffect deps — missing or unstable object/array causes re-run. setState in render causes loop. Strict Mode double-mount in dev.
Example
useEffect(() => fetch(), []) not [user] object recreated each render.
Follow-up Questions
- useCallback fix?
- Strict Mode?
- Abort controller?
Common Mistakes
Removing deps array entirely ‘to fix it’.
Project Connection
useEffect in your project — what are deps.
Question: Button click doesn’t update UI but state logs correctly
Difficulty
🟡 Medium
Why Interviewers Ask This
State mutation bug.
Answer
Likely mutating state directly instead of new reference. Arrays/objects need spread or map. React compares by reference.
Example
setItems(items.push(x)) wrong → setItems([…items, x]).
Follow-up Questions
- Immer?
- Why mutation fails?
- useState object update?
Common Mistakes
items[0].done = true without new array.
Project Connection
Find immutable update pattern in your code.
Question: Form submits and page refreshes
Difficulty
🟢 Easy
Why Interviewers Ask This
HTML form default behavior.
Answer
Missing e.preventDefault() in onSubmit. Or button type=‘submit’ outside controlled handler.