Frontend Engineering
Testing
5 practice questions. Free questions open a full answer guide; the rest unlock with Pro.
- How do you decide what to cover with unit tests versus integration tests versus end-to-end tests in a frontend app, and how do you keep the suite from becoming slow and flaky?
- What does it mean to mock the network in a frontend test, and how do you choose between mocking at the fetch layer, using a tool like MSW, or hitting a real test backend?Go Pro
- When writing tests for a UI component, what does it mean to test behavior instead of implementation details, and why is that the recommended approach?Go Pro
- Your end-to-end suite is flaky: tests fail intermittently in CI, and someone has scattered fixed waits like a two-second sleep before clicks to 'stabilize' them. How would you reason about the real cause and fix it properly?Go Pro
- In a code review you see frontend tests that query elements by CSS class and test ids and assert on internal component state. They pass today but break on every refactor. How do you explain what's wrong and what you'd change?Go Pro
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.