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
17 questions
Parcial ING2-2025

Quiz
•
University
20 questions
Software Engineering

Quiz
•
University
20 questions
Introduction to the Innovative Design Process

Quiz
•
6th Grade - University
27 questions
ADVANCE JAVA PROGRAMMING

Quiz
•
University
20 questions
Generics

Quiz
•
University
20 questions
Computational Thinking Quiz

Quiz
•
10th Grade - University
20 questions
Programación II -Conceptos basicos

Quiz
•
University
20 questions
Behavioral Design Patterns

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade