Guest MemberLanguage   English
Software Architecture · Clean Architecture

How would you answer an interview scenario involving dependency rule?

AdvancedUpdated 2026-08-09

For an interview scenario involving dependency rule, I would first clarify the business goal, scale, constraints, and the failure or quality attribute the interviewer wants to explore. The dependency rule keeps source-code dependencies pointing inward toward stable business rules rather than outward toward frameworks and infrastructure. In this scenario, a domain service currently depends directly on EF Core DbContext. Explain how you would restructure it. For production, define inward-facing abstractions at stable boundaries, keep infrastructure implementations outside, and enforce references at project or package level. I would then explain the main alternatives and tradeoffs, identify likely failure modes, and describe how I would validate the solution through testing, observability, security controls, and recovery or rollback planning.

#clean-architecture#dependencies