All jobs / Frontend / web developer / Tooling
Frontend / web developer interview question · 1–3 years
Fast Refresh resets a component's state on every edit. What usually caused it?
The strongest answer
The file exports a component plus other values in a way that breaks the refresh contract — split the file; don't run side effects at module scope
Why it works
Vite / React Fast Refresh remounts when the module is not a clean component export. That's the interview detail.
What a good answer covers
- Keep component modules refresh-friendly.
- One component family per file when state keeps resetting.
- Don't mix random exports and module-scope fetches.
- Edit source, not dist.
Answers that fall short
- Close, but not the strongest: Restart the dev server after every save
Restarting works and teaches you nothing. - Weak: Turn HMR off
Disabling HMR hides the signal. - Red flag: Edit files in dist/
dist/ is the build output, not the source.
Who gets asked this
More Tooling questions
- A half-rolled feature is erroring in production. Strongest frontend move?
- What does a bundler such as Webpack or Vite’s production build actually do for you, and what breaks tree…
- Three product teams ship the same header with three bugs. How do you organize frontend platform work?
- A critical vulnerability is published in a package three levels down your dependency tree. The scanner is red…
- Shared packages in a monorepo keep causing diamond-dependency breaks. What do you enforce?
- How do you run a frontend hiring loop that predicts the work, not trivia?
- A bad deploy blanks checkout in one browser. What is the incident response?
- A breaking change in the design system will hit forty apps. How do you ship it?