All jobs / Backend developer / Testing

Backend developer interview question · 1–3 years

Your repository tests run against an in-memory database and pass, but the same query fails in production. What do you change?

The strongest answer

Test against the engine you ship on, in a throwaway container per run — the in-memory substitute has different SQL, types and constraint behaviour — and have each test set up and clean its own data

Why it works

Exactly — same engine, disposable instance, isolated data. Anything else and you are testing a different database.

What a good answer covers

Answers that fall short

Who gets asked this

More Testing questions