Images and Media — Concept Check
Questions on Images and Media. next/image resizes, converts to modern formats, lazy-loads and reserves space in one component. The defaults are right; the mistakes are priority and remote patterns.
Questions in this quiz
8 questions on Images and Media — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer notices their hero image is loading slowly on the homepage. What is the most likely cause?
- AThe image dimensions are not specified.
- BThe image is not in AVIF or WebP format.
- CThe image is being lazy-loaded instead of prioritized.
- DThe image is hosted on an unallow-listed remote host.
2.You have a remote image with unknown dimensions. What should you do to ensure proper layout?
- AUse the fill property with a positioned parent container.
- BUse the priority flag to preload the image.
- CSet explicit width and height attributes.
- DLeave dimensions unspecified and let the browser handle it.
3.A page's Largest Contentful Paint (LCP) is poor. Which next/image mistake is most likely responsible?
- AThe LCP image is not in a modern format like AVIF.
- BThe LCP image is missing explicit dimensions.
- CThe LCP image is not allow-listed in next.config.js.
- DThe LCP image is lazy-loaded instead of prioritized.
4.A developer sets up next/image but finds their images are not rendering. What might be the issue?
- AThe priority flag is missing on all images.
- BRemote hosts are not allow-listed in next.config.js.
- CImages are not in AVIF or WebP formats.
- DThe images lack alt attributes.
5.You want to optimize costs on Vercel for image transformations. Which approach helps?
- AAllow-list fewer remote hosts.
- BSet the priority flag on all images.
- CUse AVIF format for all images.
- DUse unoptimized images from a CDN.
6.What is a common mistake when using next/image for the hero image?
- ANot using AVIF or WebP formats.
- BNot specifying alt attributes.
- CUsing fixed dimensions instead of fill.
- DFailing to use the priority flag.
7.A developer uses fill for an image but notices layout issues. What might be wrong?
- AThe image is not in a modern format.
- BThe priority flag is missing.
- CThe parent container is not positioned.
- DThe image lacks explicit dimensions.
8.When embedding a YouTube video, what should be done to minimize initial load?
- AUse preload='auto' to load quickly.
- BUse next/video for optimization.
- CRender a thumbnail and load the iframe on click.
- DEmbed directly without a thumbnail.