Interview practice question
Tests fail around midnight
Backend Engineering · Testing · Beginner
Some tests fail only when run around midnight or at month-end. What is the cause, and how do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Code uses current time directly.
- Injectable clock.
- Fixed time in tests.
- Test boundary dates explicitly.
- Avoid timezone assumptions.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.