foundation
Routing
File-system routes, App Router conventions, legacy Pages Router knowledge, dynamic segments, route groups, and middleware.
Next.js routing interviews test whether you understand the file-system route tree, not only that folders become URLs. App Router is the modern default; Pages Router knowledge still matters for legacy codebases and migration discussions.
Subtopics: App Router layouts and segments, Pages Router legacy APIs, dynamic segments, route groups, and edge middleware.
On interviews: walk through nested layouts, when route groups change organization without changing URLs, and where middleware should stop versus route handlers.
Common pitfalls: confusing route groups with URL prefixes, overusing middleware, and ignoring dynamic param validation.
Checklist:
- Map folders to URL segments and layouts.
- Know dynamic and catch-all conventions.
- Separate middleware from route handlers.
- Plan not-found and error boundaries.