Design Patterns

Design Patterns Quiz

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which design pattern is used to define a family of algorithms, encapsulate each one, and make them interchangeable?

  1. Strategy
  2. Factory
  3. Singleton
  4. Decorator
Question 2 Multiple Choice (Single Answer)

Which design pattern is used to create a single instance of a class and provide a global point of access to that instance?

  1. Singleton
  2. Factory
  3. Builder
  4. Prototype
Question 3 Multiple Choice (Single Answer)

Which design pattern is used to create objects without specifying the exact class of the object that will be created?

  1. Factory
  2. Builder
  3. Prototype
  4. Abstract Factory
Question 4 Multiple Choice (Single Answer)

Which design pattern is used to create a new object by copying an existing object?

  1. Prototype
  2. Builder
  3. Factory
  4. Singleton
Question 5 Multiple Choice (Single Answer)

Which design pattern is used to add new functionality to an existing object without changing its structure?

  1. Decorator
  2. Adapter
  3. Proxy
  4. Facade
Question 6 Multiple Choice (Single Answer)

Which design pattern is used to convert the interface of a class into another interface that a client expects?

  1. Adapter
  2. Decorator
  3. Proxy
  4. Facade
Question 7 Multiple Choice (Single Answer)

Which design pattern is used to provide a unified interface to a set of interfaces in a subsystem?

  1. Facade
  2. Proxy
  3. Decorator
  4. Adapter
Question 8 Multiple Choice (Single Answer)

Which design pattern is used to define an interface for creating objects, but lets subclasses decide which class to instantiate?

  1. Abstract Factory
  2. Factory
  3. Builder
  4. Prototype
Question 9 Multiple Choice (Single Answer)

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?

  1. Builder
  2. Factory
  3. Prototype
  4. Abstract Factory
Question 10 Multiple Choice (Single Answer)

Which design pattern is used to define a set of classes that share a common interface, allowing objects to be composed dynamically?

  1. Composite
  2. Decorator
  3. Adapter
  4. Proxy
Question 11 Multiple Choice (Single Answer)

Which design pattern is used to provide a surrogate or placeholder for another object to control access to it?

  1. Proxy
  2. Decorator
  3. Adapter
  4. Facade
Question 12 Multiple Choice (Single Answer)

Which design pattern is used to provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation?

  1. Iterator
  2. Composite
  3. Decorator
  4. Adapter
Question 13 Multiple Choice (Single Answer)

Which design pattern is used to define an object that encapsulates how a set of objects interact?

  1. Mediator
  2. Observer
  3. Command
  4. Strategy
Question 14 Multiple Choice (Single Answer)

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?

  1. Observer
  2. Mediator
  3. Command
  4. Strategy
Question 15 Multiple Choice (Single Answer)

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?

  1. Command
  2. Observer
  3. Mediator
  4. Strategy