0
0
NextJSframework~20 mins

Intercepting routes (.) in NextJS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Intercepting Routes Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What happens when navigating to an intercepting route?
Consider a Next.js app with an intercepting route defined as (dashboard)/settings. What will the user see when navigating to /dashboard/settings?
NextJS
app/(dashboard)/layout.tsx
export default function DashboardLayout({ children }) {
  return (
    <div>
      <h1>Dashboard</h1>
      {children}
    </div>
  )
}

app/(dashboard)/settings/page.tsx
export default function Settings() {
  return <p>Settings Page</p>
}
AOnly 'Dashboard' heading is shown, 'Settings Page' content is missing.
BOnly 'Settings Page' is shown, 'Dashboard' heading is not rendered.
CThe app throws a 404 error because intercepting routes are not supported.
DThe page shows 'Dashboard' heading and below it 'Settings Page' content.
Attempts:
2 left
💡 Hint
Think about how layouts wrap their children in Next.js app router.
📝 Syntax
intermediate
1:30remaining
Identify the correct intercepting route syntax
Which of the following folder names correctly defines an intercepting route in Next.js app router?
A(admin)/users
B[admin]/users
C{admin}/users
D<admin>/users
Attempts:
2 left
💡 Hint
Intercepting routes use parentheses in folder names.
🔧 Debug
advanced
2:30remaining
Why does this intercepting route fail to render nested content?
Given this layout code, why does the nested page content not appear? app/(main)/layout.tsx export default function MainLayout({ children }) { return
Main Layout
} app/(main)/profile/page.tsx export default function Profile() { return

Profile Page

}
AThe layout does not render {children}, so nested pages have no place to appear.
BThe folder name (main) is invalid for layouts.
CThe profile page must be named index.tsx to render inside layout.
DLayouts cannot be used inside intercepting routes.
Attempts:
2 left
💡 Hint
Check what the layout returns in its JSX.
state_output
advanced
2:30remaining
What is the rendered output with parallel intercepting routes?
Consider this folder structure: app/(dashboard)/page.tsx app/(dashboard)/settings/page.tsx app/(dashboard)/(notifications)/page.tsx Navigating to /dashboard/(notifications) renders which content?
ADashboard, settings, and notifications pages are all shown simultaneously.
BBoth dashboard and notifications page content are shown, but settings page is hidden.
COnly the notifications page content is shown inside the dashboard layout.
DA 404 error occurs because parallel routes require special syntax.
Attempts:
2 left
💡 Hint
Parallel routes allow multiple UI sections to render at once.
🧠 Conceptual
expert
3:00remaining
What is the main benefit of using intercepting routes in Next.js?
Why would a developer choose to use intercepting routes in a Next.js app instead of traditional nested routes?
ATo disable client-side navigation and force full page reloads.
BTo automatically generate API routes alongside pages without extra configuration.
CTo enable rendering multiple UI sections in parallel without changing the URL structure.
DTo enforce strict URL patterns that prevent dynamic routing.
Attempts:
2 left
💡 Hint
Think about UI flexibility and URL management.