C# Dependency Injection – Interview Questions & Answers
Last updated: February 2026
What is Dependency Injection?
Dependency Injection (DI) is a design pattern where dependencies are passed rather than created internally.
Example
public class OrderService
{
private readonly IEmailService _emailService;
public OrderService(IEmailService emailService)
{
_emailService = emailService;
}
}
Conclusion
DI is essential for .NET developers and commonly asked in interviews.