JavaScript·Advanced·Conceptual·1 min read
Can the factory pattern be combined with the strategy pattern?
Short interview answer
Yes — a factory can select and instantiate a specific strategy implementation based on runtime configuration, centralizing both which algorithm gets used and how its object is constructed in one place.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.