Interview practice question
Untangling tests coupled to the database
Backend Engineering · Testing · Experienced
In your monolith, nearly all tests go through the database with large shared fixtures, so the suite is slow and fragile. How would you restructure the test architecture?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Separate domain logic from persistence.
- Unit tests for domain with fakes.
- Focused repository tests against real DB.
- Builders replace shared fixtures.
- Migrate gradually per module.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.