Skip to content
Preptima

Testing & Tooling interview questions

Jest and Vitest, mocking modules, build and bundling choices, and monorepo workflows.

3 questions in Node.js & TypeScript.

medium3

mediumConceptCodingDesign

How do you test a service that calls a third-party API, without calling it?

Substitute at the network layer or behind your own client interface, not at the HTTP library's function. Stubbing the library couples the test to how you make the call rather than to what you send, so the test keeps passing through refactors that change the request and breaks on refactors that change nothing.

4 minmid, senior
mediumConceptDesign

How do you test a Node service, and what do you refuse to mock?

Drive business logic through injected dependencies rather than module mocks, intercept at the process boundary for outbound HTTP and time, and use a real database in a container for anything where the database is the logic — SQL, constraints, transactions and migrations.

6 minmid, senior, staff