SOLID & Design Patterns Interview Question #99
How do you choose between a design pattern and a simpler solution?
DDD Boundaries, Resilience, Caching & Practical ASP.NET Core Design Mid-Level Intermediate
Quick Interview Answer
Start with the actual change pressure, coupling, complexity, and business requirement. If a constructor, method, or small service solves the problem clearly, introducing a formal pattern may only add indirection.
Detailed Explanation
Start with the actual change pressure, coupling, complexity, and business requirement. If a constructor, method, or small service solves the problem clearly, introducing a formal pattern may only add indirection.
Use a pattern when its structure addresses a recurring problem and makes future changes safer or clearer. The ability to explain why the pattern is needed, its tradeoffs, and what simpler alternative was considered is important in senior-level design discussions.
Code Example
// Do not replace this automatically:
decimal CalculateTax(decimal amount)
=> amount * 0.15m;
// Introduce Strategy only when tax behavior
// genuinely varies and needs independent change.