All jobs / Frontend / web developer / Testing
Frontend / web developer interview question · 5+ years
After a bad release, management asks you to enforce 90% code coverage on the frontend repository as a merge gate.
How do you respond?
The strongest answer
Agree on the goal, fewer escaped bugs, then offer better levers: tests for changed behaviour, coverage on new code as a signal, critical flows end to end, escaped defects tracked. A hard global number invites empty tests
Why it works
Right — coverage shows what is untested, never what is well tested. Tie the practice to the failure that actually happened.
What a good answer covers
- Measure outcomes, not just lines.
- Name the goal behind the request.
- Coverage as a signal on new code.
- Track escaped defects.
Answers that fall short
- Close, but not the strongest: Accept the gate but set it at the current level and raise it a little every quarter
A ratchet is reasonable, but without attention to what tests assert, the number rises and the bugs stay. - Weak: Refuse; coverage is a meaningless metric and we should not measure it at all
Coverage is a useful map of blind spots; dismissing it also dismisses the concern behind the request. - Red flag: Accept, and have the team add snapshot tests across the codebase until the number is reached
Gaming the metric delivers the number and none of the safety, and it teaches the team that tests are theatre.
Who gets asked this
More Testing questions
- How do you catch layout breakage before you translate into German and Hebrew?
- What is the difference between a unit test, a component test and an end-to-end test on the frontend, and…
- How do you assert a login button in React Testing Library?
- How do you test a search box that debounces input by 300 ms, in Jest or Vitest, without slowing the suite…
- A test passes when run alone and fails when the whole file runs, and the failing test changes when you…
- A Playwright or Cypress suite fails about one run in five on CI, in different places. The tests are full of…