Performance questions in an interview are rarely about knowing a trick. They are about whether you can locate a problem before reaching for a fix. Every answer in this section follows the same shape: measure → name the layer → apply the matching lever → verify with the same measurement. A candidate who opens with "I would add caching" has skipped the only part that matters.
hyperfine and nuxt analyze for build; curl -w timings, autocannon and --cpu-prof for server; the Network panel and the DevTools payload tab for the wire; Lighthouse, web-vitals and the Performance panel for the client. Naming the instrument is half the answer."TTFB went from 180 ms to 900 ms after the last release."
A senior answer: measure first with curl -s -o /dev/null -w '%{time_starttransfer}\n' against a warm server to confirm it is the server and not the network; profile one request with node --cpu-prof .output/server/index.mjs under autocannon to see whether the time is in data fetching, rendering or serialisation; if it is data, look for sequential await useAsyncData calls in setup and for a cache that stopped hitting; apply the matching lever (parallelise, lazy: true for non-critical data, or a route rule); re-measure the same way and quote the delta.
The wrong answer names a lever first ("I'd add SWR"), because SWR on a personalised route is also a security incident, and caching a slow query hides it until the cache is cold.
Dev mode is unbundled, uncached and instrumented. Every number that matters comes from nuxt build plus node .output/server/index.mjs (or a preview deployment), with the server warmed up first. The only thing worth measuring in dev is dev itself: startup and HMR.
hyperfine), TTFB on a warm server (curl -w), client entry chunk size (du -sh .output/public/_nuxt), and Lighthouse LCP. These four are your baseline for every exercise in this section."I measure before I touch anything, and I name the layer the time is in: build, server, network or client. Each has its own instrument, so the measurement tells me which lever is even relevant. Then I apply the matching lever and re-measure the same way, so I can quote a delta rather than a feeling. For shared tooling I also measure what the package costs an app that installs it and uses nothing, because that cost is multiplied by every consumer, and I put that number in CI as a budget."
Patterns to adopt
The rules a layer or module author follows so the leak catalogues become someone else's reading — lifetimes, scopes, bounded caches, cleanup contracts, and the review checklist every PR goes through.
How to talk about performance
The five layers, the instrument for each, and how to structure an answer so an interviewer hears judgement rather than a list of tricks.