Web performance · Scenario
Code splitting, lazy loading and bundle size
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe interviewer asks
Your main bundle is 1.8 MB. How do you bring it down, and how do you stop it from creeping back?
Then
Follow-ups the interviewer asks next
- Route-level vs component-level splitting (
import(),React.lazy). - Analysing with a bundle analyzer /
source-map-explorer; spotting duplicate dependencies. - Performance budgets in CI (size-limit).
- Prefetching the next route's chunk on hover or idle.
The answer
What a strong answer covers
- Measure first; remove or replace heavy libraries (moment → date-fns/Temporal, lodash → per-method imports)
- Tree shaking requires ESM and side-effect-free modules
- Defer third-party scripts; ship modern bundles to modern browsers
- Budgets plus PR checks to prevent regressions
The red pen
Common traps
Avoid:splitting into hundreds of tiny chunks (waterfalls); lazy-loading above-the-fold UI.
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voicePractise questions like this out loud
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.