next
Round
Technologies
Saved
Contribute
Login
next
Round
Technologies
Saved
Contribute
Login
Question Loading...
Middleware
1. Describe middleware.js.
Level: Expert | Frequency: High
2. What is Next.js Middleware? Where does it run, and what can it do that API routes cannot?
Level: Expert | Frequency: High
3. How do you write middleware that applies to some routes but not others? Explain the matcher config.
Level: Expert | Frequency: High
4. What are the limitations of Middleware in Next.js? What can't you do in middleware?
Level: Expert | Frequency: High
5. How do you implement role-based route protection — what's the difference between doing it in middleware vs layout vs page?
Level: Expert | Frequency: High
6. What is the difference between middleware rewrite and redirect? How does each affect the browser URL?
Level: Expert | Frequency: High
7. How does middleware interact with static pages? Does it run for SSG pages?
Level: Expert | Frequency: High
8. How would you implement a feature flag system that routes users to different page variants using middleware?
Level: Expert | Frequency: High
9. How would you implement A/B testing using Next.js middleware and routing?
Level: Expert | Frequency: High
10. How would you implement geo-based routing (serve different content by country) using middleware?
Level: Expert | Frequency: High
All Topics
Basics
Project Structure
Runtime
Compiler
SSG
SSR
CSR
Routing
Route Handlers
Route Groups
Dynamic Routes
Parallel Routes
Intercepting Routes
Middleware
Server Actions
APIS
Data Fetching
Caching
Clients
Optimisation
i18n
Security
Architecture
Deployment
Accessibility