React / Next.js

Next.js Deployment & Production

Vercel deployment, Docker, environment variables, caching strategies, monitoring, logging

20 interview questions·
Senior
1

What is Vercel Platform in the context of Next.js deployment?

Answer

Vercel Platform is the cloud-native platform designed specifically for Next.js, offering zero-config deployment with automatic framework detection. The platform automatically optimizes builds, configures the global Edge Network, and enables intelligent caching without manual configuration. Unlike generic solutions like AWS or Azure, Vercel is optimized for Next.js features like ISR, Middleware, and Server Components with maximum performance.

2

How to expose an environment variable to the browser in Next.js?

Answer

Variables with the NEXT_PUBLIC_ prefix are automatically exposed to the client and included in the JavaScript bundle during build. Variables without this prefix remain strictly server-side and are never sent to the browser, ensuring secret security. This distinction allows managing public API keys like NEXT_PUBLIC_STRIPE_KEY while protecting sensitive secrets like Stripe private keys.

3

What is the command to create a Next.js production build?

Answer

The next build command generates an optimized production version of the application, including code minification, image optimization, static page generation, and asset bundling. This step is essential before deployment as it produces the .next folder containing all optimized files. The next start command then launches the production server using this optimized build.

4

Which Docker file to use as base for containerizing Next.js?

5

Where to configure environment variables in Vercel?

+17 interview questions

Master React / Next.js for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free