LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Build an authenticated dashboard
BUILD → VERIFY → EXPLAIN · STEP 4 OF 6

Handle loading, empty, error, and retry

Make delayed and failed requests understandable and recoverable.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Implement loadInvoices with a loading state and a generation check before publishing results. Map the single owned invoice to a list.
  2. Use the labeled UI practice scenario controls for empty, connection-failure, and slow states. Each first makes a real authorized API request; these are explicit display simulations.
  3. Retry normal data after an error and ensure a slow older result cannot replace newer state. The checks inject deferred requests to verify this race.
async function loadInvoices(mode = "normal") {
  // Load /invoices/mine, protect against stale responses, publish each state.
}
Need a hint?
  • A zero-row result is a successful empty state, not an error.
  • Increment generation at the start and compare it after every await before publishing state.

Saved on this device · 0 / 6000 · Do not include passwords or private data.

VERIFY

Acceptance checks

From the folder containing your downloaded files, run:

node checks.mjs ./starter.mjs 4

This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.

Record your attempt to enable the checklist and reference comparison.

Compare with the reference

Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.

EXPLAIN

Your interviewer asks

Two requests finish in reverse order. How do you keep the UI correct?

Say your answer aloud, then record the trade-offs and evidence in your notes above.

LOCAL VOICE REHEARSAL

Rehearse your step walkthrough aloud

Target pacing: 02:00 · Stays in this browser only; never uploaded.

00:00/ 02:00
AlifBay Prep