What are the differences between getStaticProps
, getServerSideProps
, and getInitialProps
?
When would you use each?
Explain the difference between static generation (SSG) and server-side rendering (SSR) in Next.js.
What is Incremental Static Regeneration (ISR)?
How does it work under the hood, and when is it useful?
How does routing work in Next.js?
How do dynamic routes, catch-all routes, and optional catch-all routes behave?
How do you prefetch pages in Next.js and improve perceived performance?
What’s the difference between the Pages Router and the new App Router?
How do layout.js
, page.js
, and loading.js
work in the App Router?
How do you manage metadata (<head>
) in the new App Router with metadata
export?
How is routing and nested layouts handled differently in the App Router vs Pages Router?
Explain the concept of server and client components in the App Router.
When should you make a component use client
?
How does data fetching differ between client and server components?
How would you fetch and cache data using useSWR
or React Query in a Next.js app?
What are the trade-offs between fetching on the server vs client in terms of performance and UX?
How do you handle sensitive tokens or credentials when calling APIs in Next.js?
Explain how Next.js API routes work.
How would you secure them?
How does Next.js optimize performance out of the box?
What is the Image Optimization API?
How would you use the next/image
component?
How does Next.js handle code splitting and lazy loading?
How do you analyze and reduce bundle size in a Next.js application?
How do you handle large lists/pages with pagination or infinite scroll efficiently in Next.js?
How would you implement authentication in a Next.js app?
Using NextAuth, Clerk, custom JWT-based, etc.
How would you protect both client and server routes in a secure way?
How do middleware functions work in Next.js 13+?
What are their limitations and use cases?
How do you persist authentication across client and server renders?
What is Middleware in Next.js, and how do you use it for redirects, AB testing, or auth?
How would you handle internationalization (i18n) in a Next.js app?
How do you customize the build and webpack configuration in Next.js?
How would you implement error boundaries and error handling in both page and layout-levels?
How do you configure custom document (_document.js
) and app (_app.js
) files? What are they for?
How do you structure a large-scale project using Next.js?
Folder structure, feature-based architecture, etc.
How do you approach SEO and social sharing optimization in Next.js?
What challenges have you faced migrating from CRA or other frameworks to Next.js?
How would you architect a dashboard with authentication, role-based access, and dynamic routing in Next.js?
How do you deploy a Next.js app to Vercel vs other providers like AWS, Netlify, or Docker?
These are the type of problems you might be asked to code live or explain your thought process:
getStaticPaths
and getStaticProps
./admin
.I can help you with:
Let me know which direction you want to take — or if you want all of them bundled for prep!
Quick Links
Legal Stuff
Social Media