Question presented to candidate: "Our dashboard shows a team panel, a revenue chart and an activity feed side by side. Each one loads at its own speed and should fail on its own. How would you build that with the App Router, and what happens when the user reloads a deep URL?"
What a strong answer should cover:
- A folder named
@nameis a slot: the parent layout receives it as a prop (team,analytics) next tochildren, which is itself the implicit slot. Slots are not URL segments. - Each slot is its own route subtree with its own
loading.tsxanderror.tsx, so slots stream and fail independently. - On a soft navigation, slots that have no match for the new URL keep showing their previous page; on a hard navigation (reload, direct visit) they render
default.tsx. - Every slot needs a
default.tsxfor URLs it does not match; in Next.js 16 the build fails without one. - Use cases: dashboards, conditional UI by role (with authorization inside each slot, because all slots run), tabbed sub-navigation inside a slot, and modals together with intercepting routes.
- All slots at one level share a render mode: one dynamic slot makes the route dynamic.
Clarifying questions expected:
- "Do the panels change with the URL, or are they always the same?" β if they never navigate, plain components with Suspense are simpler.
- "Is any panel role-specific?" β conditional slots still execute, so authorization must live inside the slot.
Code / implementation expected: Yes β a dashboard layout with @team, @revenue and role slots, each with default.tsx, and a per-slot loading.tsx.