I failed this question in multiple interviews.
Not because I didn’t know it…
But because I explained it like a textbook.
❌ Bad answer
It reduces coupling.
⚠️ This is why most candidates fail this question.
✅ Senior answer
Dependency Injection separates object creation from business logic.
Instead of creating dependencies inside a class, they are injected from the outside (usually via constructor), making the system more testable and maintainable.
💡 What interviewers actually expect:
They don’t care about “reduce coupling”.
They want to see if you understand separation of concerns and how it improves testability in real systems.
// ❌ Without DI
public class OrderService {
private EmailService _email = new EmailService();
}
// ✅ With DI
public class OrderService {
private readonly IEmailService _email;
public OrderService(IEmailService email) {
_email = email;
}
}I failed 20+ interviews before I learned how to answer this properly.
Get Real Interview Answers →Learn how to explain like a senior — not like a textbook.
👉 Start Practicing Now