All jobs / Frontend / web developer / Performance
Frontend / web developer interview question · 3–5 years
A feature flag flips the hero after hydrate (flicker). How do you prevent it?
The strongest answer
Evaluate the flag on the server or from a boot snapshot so the HTML matches; avoid client-only default-off then on
Why it works
Flicker is a hydration mismatch with extra steps. The first HTML must already know the variant.
What a good answer covers
- Flags that change HTML belong on the server.
- Read the flag before first paint.
- Hydrate the same tree.
- Don't default off and flip on.
Answers that fall short
- Close, but not the strongest: Hide the hero until flags load
Hiding the hero protects consistency and hurts LCP. - Weak: Toggle display:none in CSS until the client wins
A CSS hide still flashes or delays paint. - Red flag: Serve two complete pages and client-redirect
A redirect doubles the wait.
Who gets asked this
More Performance questions
- An SSR page waits for user, then cart, then recommendations, sequentially. What's the issue and the fix?
- A content site with a few interactive widgets — full CSR SPA or islands / edge?
- Personalized HTML at the edge versus cache hit ratio — how do you decide?
- How does a frontend platform prove it is not making products slower?
- Images pop the page down as they load. What do you set and why?
- The main bundle includes an admin charts page most visitors never open. What do you do?
- 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?