Which of the following creational design patterns shares the goal of hiding the object creation logic from the client code?
Creational Design Pattern

Quiz
•
Computers
•
University
•
Hard
Kasmir Syariati
Used 5+ times
FREE Resource
22 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 2 pts
Factory
Builder
Prototype
Abstract Factory
Singleton
Answer explanation
Both Factory Method and Abstract Factory hide the object creation logic and provide an interface for clients to interact with the created objects.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When might you choose the Prototype pattern over the Factory Method pattern?
When you need to create complex objects with many configurable parts.
When you need to ensure only one instance of an object exists.
When you want to defer the decision of which object to create until runtime.
When you need a central registry to manage all created objects.
Answer explanation
Prototype excels at creating complex objects by cloning existing ones, while Factory Method focuses on creating new objects based on a type.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The Factory Method pattern often relies on inheritance to differentiate between object types. Can the Builder pattern also leverage inheritance for similar purposes?
No, Builder uses composition to define object structures.
Yes, Builder subclasses can define specific construction steps for different object types.
Builder relies solely on interfaces to define object creation logic.
Both inheritance and composition are commonly used in Builder.
Answer explanation
Builder uses composition with different builder methods to define object structures, not inheritance.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Imagine a system where you need to create different shapes (Square, Circle) based on user input. Which creational pattern would be most suitable, considering the Factory Method?
Singleton
Abstract Factory
Prototype
Builder
Answer explanation
Abstract Factory allows creating families of related objects (like shapes) based on a user choice.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The Factory Method class typically defines a method to create objects. Can the Singleton pattern also define a similar method for controlled access to its single instance?
No, Singleton relies on a static field for access, not a method.
Yes, the Singleton class can have a getInstance() method for controlled access.
Singleton uses a factory class to delegate object creation.
Both Factory Method and Singleton hide the object creation logic completely.
Answer explanation
Singleton often defines a getInstance() method to provide controlled access to its single instance.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When using the Factory Method pattern, the client code interacts with the created objects through an interface. Does the Builder pattern also enforce this concept?
No, Builder clients directly interact with concrete builder classes.
Yes, Builder provides an interface to define the object structure, which clients use.
Factory Method allows concrete classes to be returned, while Builder always returns interfaces.
Both patterns hide the implementation details of the created objects.
Answer explanation
Builder defines an interface for object construction, similar to Factory Method using interfaces for created objects.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Compared to the Factory Method, the Abstract Factory pattern introduces an additional layer of abstraction. What benefit does this extra layer provide?
It simplifies the creation of complex objects with many parts.
It allows creating families of related objects based on a type.
It reduces the number of concrete factory classes required.
It enforces code reusability for object creation logic.
Answer explanation
Abstract Factory provides a central location to define families of related objects, promoting code reuse and flexibility.
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Software Engineering

Quiz
•
University
20 questions
Digital and Analog transmission

Quiz
•
University
27 questions
ADVANCE JAVA PROGRAMMING

Quiz
•
University
20 questions
Architectural Styles and Patterns Quiz

Quiz
•
University
20 questions
Computer Graphics

Quiz
•
University
20 questions
Laboratory - Week 10 – 11 Facade Pattern

Quiz
•
University
21 questions
Multimedia Development Stage

Quiz
•
University
23 questions
SE2 (LAB) Week 3 – 4 Strategy Pattern

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade