A single-page application scores well in the lab and users on mid-range Android phones say it is unusable. Diagnose.
Show the full answer Hide the answer
What the interviewer is testing
Whether you know that main-thread work dominates on constrained devices, and that lab testing hides it.
The diagnosis
JavaScript execution on a slow CPU. Download time is only part of the cost; parsing, compiling and executing a large bundle takes several times longer on a mid-range phone than on a developer laptop. A bundle that executes in 300 ms in the lab can take two seconds on real hardware.
Hydration is the specific cost in a server-rendered SPA: the page appears complete and is inert while component logic re-runs, so the user taps and nothing happens. This is what Interaction to Next Paint measures and it is where the "unusable" complaint comes from.
Third-party scripts — analytics, tag managers, chat widgets, advertising — frequently exceed the application's own JavaScript and all compete for the same main thread.
Network conditions: higher latency and packet loss make waterfalls of dependent requests far more expensive than the lab suggests.
The fix
Measure with real user monitoring, segmented by device class and connection, and treat the 75th percentile of real users as the target rather than a lab score. The aggregate hides this entirely.
Ship less JavaScript: code splitting by route, deferring non-critical work, and removing dependencies. This is the lever with the largest effect and the least appetite.
Reduce hydration cost: hydrate only interactive regions, or move component logic to the server.
Audit third-party scripts ruthlessly, load them after interaction where possible, and give them a separate budget.
Enforce a performance budget in the pipeline, measured on a throttled mid-range profile, so regressions fail the build rather than accumulating.
What a strong answer adds
The commercial framing that gets it funded: the affected users are a real segment of the market, the conversion correlation with these metrics is well documented, and search ranking is influenced by them. "Slow on cheap phones" is a revenue argument, not an engineering preference.
Common weak answers
Optimising images and server response time, which are usually not the binding constraint here. Recommending a native app.