All jobs / Full-stack developer / Frontend
Full-stack developer interview question · 0–1 years
The first screen is a list loaded from `GET /items`.
What states does the screen need?
The strongest answer
Loading, empty, error and data — and the error must be retryable, not a blank page
Why it works
Exactly. Those four states are the contract of any GET. Skipping one is how you ship a flicker or a lie.
What a good answer covers
- Every fetch has loading, empty, error and data.
- Do not flash an empty list while the request is in flight.
- Errors get a message and a retry.
- The happy path is one of four, not the only one.
Answers that fall short
- Close, but not the strongest: A spinner forever until data arrives
A spinner with no timeout or error path is a hung product. - Weak: Render an empty table and hope the request wins the race
An empty table that then fills teaches users the list is vacant. - Red flag: Only the happy path; failures are rare
Network and 500s are normal. Design for them on the first ticket.
Who gets asked this
More Frontend questions
- Saving a profile can fail with a 400 (`email taken`) or a 500. What does the UI show?
- 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?