SpinTheMic
Pro

Interview practice question

Database details leaking into the domain

Backend Engineering · OOP and Design Patterns · Experienced

In a code review, you see domain classes that catch SQL exceptions and check database-specific error codes to decide business outcomes. What would you suggest?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Leaky abstraction.
  • Translate infra errors at repository boundary.
  • Domain-specific exceptions (DuplicateEmail).
  • Domain stays persistence-agnostic.
  • Tests for translation layer.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics