All jobs / Full-stack developer / Testing

Full-stack developer interview question · 1–3 years

Your service runs a query with a join and a couple of filters, and the team is arguing about how to test it.

Do you test this against a real database or against a mocked repository?

The strongest answer

Against a real instance of the same engine, started for the test run and thrown away — a mocked repository only proves your own assumptions, never that the query returns the right rows

Why it works

Right — same engine, disposable instance. Joins, constraints, types and migrations are exactly what this test should exercise.

What a good answer covers

Answers that fall short

Who gets asked this

More Testing questions