SOLID & Design Patterns Interview Question #149
How should a senior developer choose a design pattern during an interview?
Anti-Patterns, Refactoring, DI Lifetimes & Senior Design Scenarios Senior Advanced
Quick Interview Answer
Start by describing the problem, constraints, expected changes, and failure modes. Then explain a simple baseline design and introduce a pattern only when its intent matches a real pressure in the problem.
Detailed Explanation
Start by describing the problem, constraints, expected changes, and failure modes. Then explain a simple baseline design and introduce a pattern only when its intent matches a real pressure in the problem.
Discuss alternatives and tradeoffs. Interviewers generally gain more information from reasoning about coupling, cohesion, testability, performance, and operational complexity than from simply naming many patterns.
Code Example
1. Clarify requirements
2. Identify change points
3. Define boundaries
4. Choose the simplest design
5. Apply a pattern where justified
6. Explain tradeoffs
7. Consider testing and operations