0
0
NextJSframework~20 mins

Route groups with (groupName) in NextJS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Route Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What is the rendered output of this Next.js route group?
Consider a Next.js app router with this folder structure:

app/(admin)/dashboard/page.tsx

The (admin) folder is a route group. What URL path will render the dashboard page?
NextJS
app/(admin)/dashboard/page.tsx
export default function Dashboard() {
  return <h1>Admin Dashboard</h1>;
}
A/(admin)/dashboard
B/admin/dashboard
C/dashboard
D/dashboard/admin
Attempts:
2 left
💡 Hint
Route groups group routes without adding to the URL path.
📝 Syntax
intermediate
1:30remaining
Which folder name correctly creates a route group in Next.js?
You want to create a route group named 'marketing' in your Next.js app router. Which folder name is valid?
A[marketing]
B<marketing>
C{marketing}
D(marketing)
Attempts:
2 left
💡 Hint
Route groups use parentheses in folder names.
🔧 Debug
advanced
2:30remaining
Why does this route group cause a 404 error?
You have this folder structure:

app/(user)/profile/page.tsx

But navigating to '/profile' shows a 404 error. What is the likely cause?
NextJS
app/(user)/profile/page.tsx
export default function Profile() {
  return <p>User Profile</p>;
}
ARoute groups cannot contain pages directly
BThe app folder must have a layout.tsx file for nested routes to work
CThe (user) folder is missing a layout.tsx file
DThe profile folder name should be in parentheses
Attempts:
2 left
💡 Hint
Next.js app router requires layouts to render nested pages.
🧠 Conceptual
advanced
1:30remaining
What is the main benefit of using route groups in Next.js?
Why would a developer use route groups (folders with parentheses) in a Next.js app router project?
ATo organize routes without changing the URL structure
BTo create dynamic route parameters
CTo enable server-side rendering only for those routes
DTo automatically generate API routes
Attempts:
2 left
💡 Hint
Think about URL paths and folder structure.
state_output
expert
3:00remaining
What is the URL path and rendered output for nested route groups?
Given this folder structure:

app/(dashboard)/(settings)/profile/page.tsx

And the page.tsx contains:

export default function Profile() { return <h2>Profile Settings</h2>; }

What URL path shows this page and what is the rendered output?
NextJS
app/(dashboard)/(settings)/profile/page.tsx
export default function Profile() {
  return <h2>Profile Settings</h2>;
}
AURL: /profile, Output: <h2>Profile Settings</h2>
BURL: /(dashboard)/(settings)/profile, Output: <h2>Profile Settings</h2>
CURL: /profile, Output: <h1>Profile Settings</h1>
DURL: /dashboard/settings/profile, Output: <h2>Profile Settings</h2>
Attempts:
2 left
💡 Hint
Route groups do not add to the URL path.