Creational Design Pattern
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Kasmir Syariati
Used 6+ times
FREE Resource
Enhance your content in a minute
22 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 2 pts
Which of the following creational design patterns shares the goal of hiding the object creation logic from the client code?
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
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Quiz PBO SIA
Quiz
•
University
20 questions
CH02 IS of hardware
Quiz
•
University
20 questions
Node.js Server
Quiz
•
University
18 questions
Model Tuning Quiz
Quiz
•
University
20 questions
SPCC ISE 2 Quiz TE B
Quiz
•
University
20 questions
Python with Ai
Quiz
•
9th Grade - University
20 questions
Robotics 1: Fall Final Review
Quiz
•
9th Grade - University
20 questions
Quiz 2 PBO
Quiz
•
University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
