NEW
Font size
S
M
L
XL
WorksheetsDesign Pattern Creational Basic 2
Total questions: 15
Worksheet time: 5mins
Name
Class
Date
1.
Which design pattern is used to create objects without specifying their concrete classes?
a)
Abstract Factory
b)
Factory Method
c)
Builder
d)
Prototype
2.
Which of the following is a key advantage of using the Factory Method design pattern?
a)
It enforces the creation of only one instance of a class
b)
It simplifies the creation of complex objects
c)
It allows objects to be copied without specifying their concrete classes
d)
It provides a way to create families of related objects
3.
In the Factory Method design pattern, which component is responsible for creating objects?
a)
Abstract Factory
b)
Product
c)
Creator
d)
Concrete Factory
4.
Which design pattern provides an interface for creating families of related or dependent objects?
a)
Abstract Factory
b)
Factory Method
c)
Builder
d)
Singleton
5.
Which of the following is a characteristic of the Abstract Factory design pattern?
a)
It allows only one instance of a class to be created
b)
It provides a way to create objects without specifying their concrete classes
c)
It simplifies the creation of complex objects by separating the construction process
d)
It allows objects to be copied without specifying their concrete classes
6.
What is the role of the Abstract Factory in the Abstract Factory design pattern?
a)
It defines the interface for creating objects
b)
It creates objects without specifying their concrete classes
c)
It provides a way to construct complex objects step by step
d)
It ensures that only one instance of a class can be created
7.
Which design pattern is used to construct complex objects step by step?
a)
Abstract Factory
b)
Factory Method
c)
Builder
d)
Singleton
8.
What is the advantage of using the Builder design pattern?
a)
It provides a way to create families of related objects
b)
It enforces the creation of only one instance of a class
c)
It simplifies the creation of complex objects by separating the construction process
d)
It allows objects to be copied without specifying their concrete classes
9.
Which component of the Builder design pattern is responsible for constructing the object?
a)
Director
b)
Product
c)
Concrete Builder
d)
Abstract Factory
10.
Which design pattern is used to create objects by cloning existing objects?
a)
Abstract Factory
b)
Factory Method
c)
Builder
d)
Prototype
11.
What is the benefit of using the Prototype design pattern?
a)
It simplifies the creation of complex objects by separating the construction process
b)
It allows objects to be copied without specifying their concrete classes
c)
It provides a way to create families of related objects
d)
It enforces the creation of only one instance of a class
12.
In the Prototype design pattern, what is the role of the Prototype interface or abstract class?
a)
It defines the interface for creating objects
b)
It provides a way to construct complex objects step by step
c)
It allows objects to be copied without specifying their concrete classes
d)
It creates objects without specifying their concrete classes
13.
Which design pattern ensures that only one instance of a class can be created?
a)
Abstract Factory
b)
Factory Method
c)
Builder
d)
Singleton
14.
What is the purpose of the Singleton design pattern?
a)
It simplifies the creation of complex objects by separating the construction process
b)
It provides a way to create families of related objects
c)
It allows objects to be copied without specifying their concrete classes
d)
It ensures that only one instance of a class can be created and accessed
15.
Which component of the Singleton design pattern is responsible for creating and managing the single instance of the class?
a)
Singleton
b)
Client
c)
Concrete Singleton
d)
Abstract Factory
Reset
