Skip to content
Sharp

Design patterns · interview question

Which purpose does the Factory Pattern primarily serve in design?

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

Correct answer

C. To centralize object creation logic

Why

The Factory Pattern centralizes the creation logic of objects, allowing for more manageable and flexible code. It abstracts the instantiation process, making it easier to manage changes to object creation.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →