Dependency Injection

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • medium
  • Pro

A service class creates its own email client and database connection inside its constructor, and the team can't test it without sending real emails. Explain what dependency injection is, how you'd apply it here, and whether you need a framework to do it.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →