Skip to content
Sharp

Design patterns · interview question

Which principle is most closely aligned with the Factory Pattern?

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

Correct answer

D. Encapsulation of object creation

Why

The Factory Pattern aligns closely with the encapsulation of object creation, as it abstracts and centralizes the logic for creating instances of classes, promoting cleaner and more maintainable code.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →