Skip to content
RED SAGSkills
easyFull Stack Developer interview question

A page loads data from your API. How do you handle loading, empty and error states so users are never left confused?

What the interviewer wants to hear

  • Design loading, empty, error and success states explicitly
  • Use a consistent error format from the API with useful status codes
  • Show friendly messages and a retry option, not raw errors
  • Distinguish expected errors (404, 422) from unexpected ones (500)
  • Log or report unexpected errors with a request ID

Model answer

I treat every data-driven view as having four states: loading, empty, error and success, and I design each one on purpose. While loading I show a skeleton that matches the layout so the page does not jump. If the list is empty I show a helpful message and an action, such as "Create your first project". For errors, the API returns a consistent JSON shape with a proper status code, so the UI can react differently: a 404 shows "not found", a 422 shows field messages, a 401 sends the user to login, and a 500 shows a friendly message with a Retry button. In React I use an error boundary around each section so one failure does not blank the whole page. Unexpected errors are reported to monitoring with a request ID, which I also display so support can find the exact log.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Full Stack Developer questions