All jobs / Frontend / web developer / Performance
Frontend / web developer interview question · 1–3 years
The main bundle includes an admin charts page most visitors never open. What do you do?
The strongest answer
Route-level import() / lazy for the admin page, and split heavy widgets — then look at the bundle graph
Why it works
Split on routes and expensive leaves. Measure so you don't guess.
What a good answer covers
- Split what users don't need yet.
- Lazy the admin route.
- Split heavy charts inside it if needed.
- Confirm with the bundle visualizer.
Answers that fall short
- Close, but not the strongest: Wrap the entire app in one lazy() so 'everything is split'
One lazy around the root does not shrink the first graph. - Weak: Add extra script tags that load a second copy of React
Duplicate Reacts break hooks and waste bytes. - Red flag: Ask users to download a zip of extra pages
Users should not be your bundler.
Who gets asked this
More Performance questions
- When would you render a marketing homepage on the server versus a settings screen on the client?
- A late-loading banner pushes content down (CLS). How do you prevent it?
- LCP is a hero image. What do you change first?
- Clicking Filter freezes the tab for about 400ms. How do you investigate?
- Product asks if the new home is faster. What do you report?
- How do you ingest Web Vitals without drowning the backend or leaking PII?
- How do you keep marketing JS from growing without anyone noticing?
- Ten thousand rows in a div and the tab dies. What do you do?