Comprehensive collection of Next.js interview questions covering fundamentals, the App Router, rendering strategies (SSR, SSG, ISR), and core components. Essential for modern web developers.
0%
Overall Progress
0/175
Status
Problem
Level
2.What are the main features of Next.js?
Easy
3.What is the difference between Next.js and React?
Easy
4.What is the difference between Next.js and Create React App?
Easy
5.How do you create a Next.js application?
Easy
6.What is file-based routing in Next.js?
Easy
7.How do you create a new page in Next.js?
Easy
8.What is the pages directory?
Easy
9.What is the app directory in Next.js 13+?
Medium
10.What is the difference between Pages Router and App Router?
Medium
11.What is the Link component? How is it different from <a> tag?
Easy
12.How do you navigate between pages programmatically?
Easy
13.What is the useRouter hook?
Easy
14.What is the Image component in Next.js?
Easy
15.Why should you use next/image instead of <img>?
Easy
16.What is the Head component used for?
Easy
17.How do you add custom meta tags?
Medium
18.What is the _app.js file?
Medium
19.What is the _document.js file?
Medium
20.What is the difference between _app.js and _document.js?
Hard
21.How do you add global CSS in Next.js?
Easy
22.What are CSS Modules?
Easy
23.How do you use Tailwind CSS with Next.js?
Easy
24.What is the public folder used for?
Easy
25.How do you serve static files?
Easy
26.What is Server-Side Rendering (SSR)?
Medium
27.What is Static Site Generation (SSG)?
Medium
28.What is Client-Side Rendering (CSR)?
Medium
29.What is Incremental Static Regeneration (ISR)?
Medium
30.What is the difference between SSR, SSG, CSR, and ISR?
Hard
31.When should you use SSR vs SSG vs ISR?
Hard
32.What is getStaticProps()? When do you use it?
Medium
33.What is getServerSideProps()? When do you use it?
Medium
34.What is getStaticPaths()? When do you use it?
Medium
35.What is the revalidate property in getStaticProps?
Medium
36.What are the different fallback options: false, true, and 'blocking'?
Hard
37.What happens when fallback: true is used?
Hard
38.What happens when fallback: 'blocking' is used?
Hard
39.Can you use getStaticProps with dynamic routes?
Medium
40.What data can you return from getStaticProps and getServerSideProps?
Medium
41.What is the context parameter in these data fetching methods?
Hard
42.Can you use browser APIs in getServerSideProps?
Hard
43.What are Server Components in Next.js 13+?
Medium
44.What are Client Components in Next.js 13+?
Medium
45.What is the difference between Server and Client Components?
Hard
46.What is the 'use client' directive?
Medium
47.What is the 'use server' directive?
Hard
48.When should you use Server Components vs Client Components?
Hard
49.Can Server Components use hooks like useState or useEffect?
Medium
50.How do you fetch data in Server Components?
Medium
51.What are dynamic routes in Next.js?
Easy
52.How do you create a dynamic route with [id].js?
Easy
53.What are catch-all routes [...slug].js?
Medium
54.What are optional catch-all routes [[...slug]].js?
Medium
55.How do you access route parameters?
Easy
56.What is router.query vs router.pathname?
Medium
57.How do you get query parameters from the URL?
Easy
58.What is shallow routing?
Hard
59.What is the difference between router.push() and router.replace()?
Easy
60.How do you implement nested routes?
Medium
61.What are route groups in App Router (folderName)?
Medium
62.What are parallel routes in Next.js?
Hard
63.What are intercepting routes?
Hard
64.How do you create protected routes?
Medium
65.What is router.back() and router.forward()?
Easy
66.How do you prefetch pages in Next.js?
Medium
67.What is automatic prefetching with Link?
Medium
68.How do you disable prefetching?
Easy
69.What is the scroll prop in Link component?
Easy
70.How do you handle 404 pages?
Easy
71.What are API routes in Next.js?
Easy
72.How do you create an API route?
Easy
73.What is the pages/api directory?
Easy
74.How do you handle different HTTP methods (GET, POST, PUT, DELETE)?
Medium
75.How do you access request body and query parameters?
Medium
76.What are Route Handlers in App Router?
Medium
77.What is the route.js file in App Router?
Medium
78.How do you handle CORS in API routes?
Hard
79.How do you implement authentication in API routes?
Hard
80.Can you use middleware with API routes?
Hard
81.What is middleware in Next.js?
Medium
82.How do you create middleware?
Medium
83.What is the middleware.js file?
Medium
84.What can you do in middleware?
Hard
85.How do you protect routes using middleware?
Hard
86.What is next.config.js?
Easy
87.How do you configure environment variables?
Easy
88.What is the difference between .env.local and .env.production?
Medium
89.What is the NEXT_PUBLIC_ prefix for environment variables?
Medium
90.How do you configure redirects in Next.js?
Medium
91.How do you configure rewrites in Next.js?
Hard
92.What is the difference between redirects and rewrites?
Hard
93.How do you add custom headers?
Medium
94.What is the basePath configuration?
Medium
95.How do you configure internationalization (i18n)?
Hard
96.How does Next.js optimize images?
Easy
97.What are the props of next/image component?
Medium
98.What is the priority prop in Image component?
Medium
99.What is the loading prop (lazy vs eager)?
Easy
100.What is automatic code splitting in Next.js?
Medium
101.How does Next.js handle bundle optimization?
Hard
102.What is the next/dynamic import?
Medium
103.How do you implement lazy loading with dynamic()?
Medium
104.What is the ssr: false option in dynamic imports?
Medium
105.What is next/font? How does it optimize fonts?
Hard
106.What is the next/script component?
Medium
107.What are the different script loading strategies?
Hard
108.What is Edge Runtime vs Node.js Runtime?
Hard
109.What is Streaming in Next.js?
Hard
110.What is React Suspense with Next.js?
Medium
111.What is the loading.js file in App Router?
Easy
112.What is the error.js file in App Router?
Medium
113.How do you handle errors in Server Components?
Hard
114.What is the not-found.js file?
Easy
115.How do you create custom 500 error pages?
Easy
116.How does caching work in Next.js?
Hard
117.What is the fetch() API in Next.js 13+?
Medium
118.What are the caching options: force-cache, no-store, revalidate?
Medium
119.What is the difference between cache: 'force-cache' and cache: 'no-store'?
Medium
120.What is revalidate in fetch options?
Medium
121.What is revalidatePath() function?
Hard
122.What is revalidateTag() function?
Hard
123.How do you implement on-demand revalidation?
Hard
124.What are Server Actions in Next.js?
Medium
125.How do you create Server Actions?
Medium
126.How do you use Server Actions with forms?
Medium
127.What is the useFormStatus hook?
Medium
128.What is the useFormState hook?
Hard
129.How do you handle mutations with Server Actions?
Hard
130.What is the difference between Server Actions and API Routes?
Hard
131.How do you implement SEO in Next.js?
Medium
132.What is the metadata object in App Router?
Easy
133.What is the generateMetadata() function?
Medium
134.How do you implement dynamic metadata?
Medium
135.How do you add Open Graph tags?
Medium
136.How do you add Twitter Card tags?
Medium
137.What is robots.txt generation?
Medium
138.What is sitemap.xml generation?
Medium
139.How do you implement structured data (JSON-LD)?
Hard
140.How do you handle canonical URLs?
Hard
141.How do you implement authentication in Next.js?
Medium
142.What is NextAuth.js?
Easy
143.How do you configure providers in NextAuth?
Medium
144.How do you protect pages with authentication?
Medium
145.How do you implement JWT authentication?
Hard
146.How do you store authentication tokens?
Medium
147.What are HTTP-only cookies?
Medium
148.How do you implement CSRF protection?
Hard
149.What are security headers in Next.js?
Hard
150.How do you prevent XSS attacks?
Hard
151.How do you build a Next.js application for production?
Easy
152.What is the difference between next dev, next build, and next start?
Easy
153.How do you analyze bundle size?
Medium
154.What is the @next/bundle-analyzer package?
Medium
155.How do you deploy Next.js on Vercel?
Easy
156.Can you deploy Next.js on AWS, Netlify, or custom servers?
Medium
157.What is static export (output: 'export')?
Medium
158.What are the limitations of static export?
Hard
159.How do you deploy Next.js with Docker?
Hard
160.What is the standalone output mode?
Hard
161.What is the layout.js file in App Router?
Easy
162.What is nested layouts?
Medium
163.What is route group layouts?
Medium
164.What is the template.js file?
Hard
165.What is the difference between layout.js and template.js?
Hard
166.How do you share data between layouts and pages?
Medium
167.What are loading UI and Streaming?
Hard
168.What is parallel routes and slots (@folder)?
Hard
169.How do you implement modal routes?
Expert
170.What is the default.js file in parallel routes?
Expert
171.How do you handle race conditions in data fetching?