Skip to content
Sharp

Design patterns · interview question

How does the Factory Pattern enhance flexibility in an application?

Multiple choiceEasychapter-13-curatedpremiumdesign-patternsfactory-pattern
Choose one answer
Answer and explanation

Correct answer

D. By allowing the code to instantiate objects without specifying the exact class

Why

The Factory Pattern enhances flexibility by allowing the application to instantiate objects without specifying the exact class. This abstraction enables easier modifications and extensions to the code.

Test yourself on Design patterns

A free test with instant, explained results. No account needed.

Start free test
All Design patterns questions →