All jobs / Full-stack developer / Frontend
Full-stack developer interview question · 0–1 years
The user submits 'create project'. A teammate wants the new card to appear before the response.
When do you update the list?
The strongest answer
After the API confirms, unless we designed a true optimistic path that can undo — a create is not a toggle
Why it works
Exactly. Optimistic UI is a technique with rollback. Blindly painting a create that failed is a lie.
What a good answer covers
- Writes wait for the server, or they optimistic-and-rollback.
- Creates and payments wait.
- Toggles can be optimistic if you can undo.
- Never invent a success the API did not send.
Answers that fall short
- Close, but not the strongest: Immediately in the UI so it feels fast, and ignore the response
Ignoring the response is how you show a row the server rejected. - Weak: Never; the user can refresh
Making the user refresh is giving up on the product. - Red flag: In a `setTimeout` of 300ms to look async
A fake delay is not a contract with the server.
Who gets asked this
More Frontend questions
- 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?
- Saving a profile can fail with a 400 (`email taken`) or a 500. What does the UI show?