IntermediateTECHNICAL
Given a single-page application that becomes sluggish as user data grows, explain the concrete steps you would take to diagnose and resolve the performance issues (including tooling, metrics to monitor, rendering and state strategies, and trade-offs).
Frontend Developer
General

Sample Answer

On a recent dashboard app, things got noticeably sluggish once users crossed ~5k records. My first step was measurement, not guessing. I used Chrome Performance and React Profiler to record interactions like filtering and scrolling, looking at FPS, scripting time, and commit durations. We saw renders taking 200–300ms and the main thread blocked by heavy array operations. I split the problem: data layer and rendering. For data, we introduced server-side pagination, memoized selectors (Reselect), and moved a few expensive calculations to web workers, which cut main-thread work by about 40%. For rendering, we virtualized long lists (react-window), normalized state in a global store, and pushed ephemeral UI state (hover, open/closed) down into local component state. End result: interaction latency dropped from ~800ms to under 150ms, and Time to Interactive improved by about 35%, with minimal code complexity added.

Keywords

Start with profiling using Chrome DevTools and React Profiler, focusing on FPS and commit timesSeparate data and rendering issues; optimize both layersUse pagination, memoization, and possibly web workers for heavy workApply list virtualization and smart state placement to cut unnecessary re-renders