Testing interview preparation.
Turn your understanding into examples, reasoning, and clear trade-offs.
Explain before you reveal.
Choose a level, explore explained answers, then try a focused session.
4 questions
Unit vs integration vs E2E tests?
Unit tests check a small piece of logic, integration tests verify collaborating components, and E2E tests exercise a complete user or API flow. They catch different classes of failure and have different setup and execution costs. A balanced strategy puts detailed business-rule checks near the unit level and preserves real integration coverage where mocks would hide bugs.
What are Jest, React Testing Library and Supertest?
Jest provides test execution, assertions and tools for replacing dependencies. React Testing Library helps test components through behavior visible to users, while Supertest sends HTTP requests to an application for API assertions. They can be combined, but none automatically chooses meaningful cases or guarantees realism.
Mock vs stub vs spy vs fixture?
Test doubles replace real collaborators so a test can control conditions or observe interactions. A stub supplies a response, a spy records calls, and a mock often combines replacement with expected interactions; terminology varies by library. Fixtures supply stable input data so cases are repeatable.
Is 100% coverage enough?
Coverage measures which lines, branches or functions executed while tests ran. It can reveal untested areas, but execution does not prove that the assertions checked correct behavior. A suite can reach every line and still miss invalid inputs, race conditions or a wrong expected value.
Difficulty is editorial guidance. These questions are not a ranking of interview frequency.
All Testing interview questions by concept
Use the filters above for a practice selection, or follow the full question directory below. Each answer includes its source and explanation; difficulty labels are editorial guidance.