All jobs / Full-stack developer / Frontend
Full-stack developer interview question · 0–1 years
Saving a profile can fail with a 400 (`email taken`) or a 500.
What does the UI show?
The strongest answer
A field message for a 400 the API explained, and a retryable 'something went wrong' for a 500 — never the stack trace
Why it works
Exactly. 400s are often the user's to fix; 500s are ours. The stack trace is for logs, not the page.
What a good answer covers
- Map status to a human next step, not to a dump.
- 400 with a field: show it on that field.
- 500 / network: apologise and offer retry — no internals.
- Never leave the button spinning; always end the request in the UI.
Answers that fall short
- Close, but not the strongest: The raw response body so power users can debug
A raw body can leak internals and reads as a crash, not a product. - Weak: The same red banner for every failed call
One banner trains people to ignore it and hides the field they can actually fix. - Red flag: Nothing — a failed save just leaves the button spinning
A spinner that never ends is how users submit twice and you get duplicates.
Who gets asked this
More Frontend questions
- The user submits 'create project'. A teammate wants the new card to appear before the response. When do you…
- The API process is down. The UI still loads. What should the UI do?
- A Next-style SSR page flashes and React logs a hydration mismatch on the header. What do you fix first?
- A long profile form is open. The user hits Save and the network is slow. What does the form do?
- Two people edit the same note. The second save returns 409 Conflict. What does the UI do with 409?
- A teammate throws inside `fetch` so the React error boundary can show the outage. What is the difference?
- A burst of autosaves returns 429 from the API gateway. What does the UI do with 429?
- The first screen is a list loaded from `GET /items`. What states does the screen need?