IntermediateTECHNICAL
Given a single-page application with slow initial load, list the concrete techniques you would apply to reduce Time to Interactive and explain how you would measure success.
Frontend Developer
General

Sample Answer

When I see a slow SPA, I start by measuring: Lighthouse, WebPageTest, and Chrome Performance panel. On a recent project our Time to Interactive on 4G was ~9s, so we broke it down systematically. First, I implemented route-based and component-level code splitting with dynamic imports, which cut our JS bundle by about 45%. Then we set up tree-shaking and removed unused dependencies, trimming another ~20%. Next, we optimized our critical rendering path: inlined critical CSS, deferred non-critical scripts, and switched to server-side rendering plus hydration for the main shell. We also added image optimizations (WebP, responsive images, lazy loading) and turned on HTTP/2 + compression at the CDN. To measure success, we tracked TTI, FCP, and Largest Contentful Paint in Lighthouse and added field monitoring via Real User Monitoring. Within two sprints, median TTI on mid-range Android devices dropped from ~9s to ~3.8s, and our bounce rate on mobile improved by about 18%.

Keywords

Use measurements first (Lighthouse, RUM) to identify bottlenecksApply code splitting, tree-shaking, and dependency reductionOptimize critical rendering path, SSR/hydration, and assetsTrack TTI/FCP/LCP and correlate with user/bounce metrics