Questions
Which design pattern is used to define a family of algorithms, encapsulate each one, and make them interchangeable?
- Strategy
- Factory
- Singleton
- Decorator
Which design pattern is used to create a single instance of a class and provide a global point of access to that instance?
- Singleton
- Factory
- Builder
- Prototype
Which design pattern is used to create objects without specifying the exact class of the object that will be created?
- Factory
- Builder
- Prototype
- Abstract Factory
Which design pattern is used to create a new object by copying an existing object?
- Prototype
- Builder
- Factory
- Singleton
Which design pattern is used to add new functionality to an existing object without changing its structure?
- Decorator
- Adapter
- Proxy
- Facade
Which design pattern is used to convert the interface of a class into another interface that a client expects?
- Adapter
- Decorator
- Proxy
- Facade
Which design pattern is used to provide a unified interface to a set of interfaces in a subsystem?
- Facade
- Proxy
- Decorator
- Adapter
Which design pattern is used to define an interface for creating objects, but lets subclasses decide which class to instantiate?
- Abstract Factory
- Factory
- Builder
- Prototype
Which design pattern is used to separate the construction of a complex object from its representation so that the same construction process can create different representations?
- Builder
- Factory
- Prototype
- Abstract Factory
Which design pattern is used to define a set of classes that share a common interface, allowing objects to be composed dynamically?
- Composite
- Decorator
- Adapter
- Proxy
Which design pattern is used to provide a surrogate or placeholder for another object to control access to it?
- Proxy
- Decorator
- Adapter
- Facade
Which design pattern is used to provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation?
- Iterator
- Composite
- Decorator
- Adapter
Which design pattern is used to define an object that encapsulates how a set of objects interact?
- Mediator
- Observer
- Command
- Strategy
Which design pattern is used to define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically?
- Observer
- Mediator
- Command
- Strategy
Which design pattern is used to encapsulate a request as an object, thereby allowing you to parameterize clients with different requests, queue or log requests, and undo requests?
- Command
- Observer
- Mediator
- Strategy