WorksheetsDesign Patterns Quiz
Total questions: 15
Worksheet time: 8mins
What is a design pattern in the context of software engineering?
A set of coding conventions
A reusable solution to a common problem in software design
A specific programming language syntax
A detailed project plan
Which of the following is a creational design pattern?
Singleton
Observer
Adapter
Composite
Which pattern ensures a class has only one instance and provides a global point of access to it?
Prototype
Singleton
Adapter
Facade
Which design pattern is used to represent the dependency between objects to notify other objects when there is a state change?
Observer
Factory Method
Decorator
Command
In which design pattern do objects take on multiple responsibilities instead of specializing in one?
Strategy
Adapter
Composite
Facade
Which design pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes?
Abstract Factory
Builder
Singleton
Chain of Responsibility
Which structural design pattern allows objects with incompatible interfaces to work together?
Adapter
Decorator
Proxy
Composite
Which behavioral design pattern allows an object to alter its behavior when its internal state changes?
Strategy
State
Observer
Command
Which pattern is often used to provide a simplified interface to a complex subsystem?
Adapter
Facade
Singleton
Composite
Which design pattern encapsulates a request as an object, thereby allowing users to parameterize clients with queues, requests, and operations?
Command
Iterator
Observer
Memento
Which design pattern is used when you want to create a family of related objects that are intended to be used together?
Singleton
Abstract Factory
Builder
Prototype
Which design pattern allows an object to change its behavior when its state changes, often by having a state class for each possible state?
Command
Observer
State
Iterator
Which creational design pattern allows you to create different representations of a complex object?
Singleton
Builder
Prototype
Factory Method
Which structural design pattern composes objects into tree structures to represent part-whole hierarchies?
Composite
Adapter
Decorator
Proxy
Which design pattern involves the creation of an object that holds the state of another object and allows restoring it later?
Command
Memento
Observer
Prototype
