Depend on the Core

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

In your app, the business rules for pricing an order call the database library and the payment provider's SDK directly. Testing them needs a real database, and switching payment providers would mean rewriting the pricing code. Explain how you'd restructure it so the business rules don't depend on these details.

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 →