What are the benefits of next/image over a standard img tag?
Tests knowledge of Next.js image infrastructure. Strong answers mention automatic optimization, lazy loading, blur placeholders for layout shift, and responsive srcset. Red flag: calling it a zero-impact wrapper or a styling component.
WHAT THIS TESTS: This question checks if you understand that Next.js does not merely provide a React wrapper around an HTML image element, but rather an integrated optimization pipeline. The interviewer wants to see that you know the difference between client-side rendering concerns and framework-level asset delivery, and that you can name specific performance behaviors that the standard img tag does not provide out of the box.
A GOOD ANSWER COVERS: A strong response hits four areas in order. First, automatic optimization: the framework can serve images in modern formats like WebP and resize them on demand so the browser does not download oversized assets. Second, lazy loading and placeholders: next/image defers offscreen images and can show a blur placeholder while loading, which prevents layout shift. Third, responsive srcset generation: the component creates multiple resolution variants automatically so the browser picks the correct one based on device pixel density and viewport size. Fourth, enforced dimensions: the component requires explicit width and height values to reserve space in the DOM, eliminating cumulative layout shift by default.
COMMON WRONG ANSWERS: The biggest red flag is claiming the component is just a convenience wrapper with no performance impact. Another mistake is confusing the built-in optimization pipeline with a third-party image CDN that you configure separately; candidates should know Next.js handles this unless you opt out. Saying it only adds CSS styling or that it removes the need for alt text are also warning signs.
LIKELY FOLLOW-UPS: An interviewer might ask how the loader prop works or when you would switch from the default server-side optimization to an external CDN like Cloudinary. They could also ask about the priority prop and how it affects Largest Contentful Paint, or how the component behaves during static export versus server rendering.
ONE CONCRETE EXAMPLE: Suppose you have a hero banner at 1920 pixels wide. With a standard img tag, mobile users download the full resolution file and the browser may reflow the page as the image loads. With next/image, you set width and height, add priority for above-the-fold content, and the framework serves a 400-pixel-wide WebP to a phone while reserving the exact space ahead of time, cutting bytes and eliminating layout shift.
Read the original → nextjs.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.