Basic Design Pattern Trivia Quiz

10 Questions | Total Attempts: 4881

SettingsSettingsSettings
Please wait...
Basic Design Pattern Trivia Quiz

Welcome to the Basic Design Pattern Trivia Quiz. The quiz below is designed for all of us with a passion for design, and it offers you a chance to review some of the basic design patterns that one can use. Do you feel like you have done enough revision to tackle it? Do take up this quiz and see if that is true.


Questions and Answers
  • 1. 
    Defines an interface for creating an object, but let the subclasses decide which class to instantiate. It let the instantiation differ to subclasses.
    • A. 

      Factory Method

    • B. 

      Abstract Factory

    • C. 

      Builder

    • D. 

      Prototype

  • 2. 
    Attach additional responsibilities to an object dynamically. It provides a flexible alternative to subclassing for extending functionality.
    • A. 

      Chain of responsibility

    • B. 

      Adapter

    • C. 

      Decorator

    • D. 

      Composite

  • 3. 
    Define a family of algorithms, encapsulate each one, and make them interchangeable. It lets the algorithm vary independently from clients that use it.
    • A. 

      Template method

    • B. 

      Decorator

    • C. 

      Strategy

    • D. 

      Visitor

  • 4. 
    Define one too many dependencies between objects so that when one object changes state, all its dependencies are notified and updated automatically.
    • A. 

      Chain of responsibility

    • B. 

      Event Notification

    • C. 

      Mediator

    • D. 

      Observer

  • 5. 
    Encapsulate a request as an object, thereby letting you parametrize clients with different requests, queue or log requests, and support undoable operation.
    • A. 

      Adapter

    • B. 

      Command

    • C. 

      Decorator

    • D. 

      Composite

  • 6. 
    Ensure a class has only one instance, and provide a global access point to it.
    • A. 

      Single Class Factory

    • B. 

      Proxy

    • C. 

      Singleton

    • D. 

      Flyweight

  • 7. 
    Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. It lets subclasses redefine certain steps of an algorithm without changing the algorithm structure.
    • A. 

      Chain of responsibility

    • B. 

      Template method

    • C. 

      Interpretor

    • D. 

      Prototype

  • 8. 
    Provide a unified interface to a set of interfaces in a subsystem. It defines a higher level interface that makes the subsystem easier to use.
    • A. 

      Facade

    • B. 

      Mediator

    • C. 

      Adapter

    • D. 

      Strategy

  • 9. 
    Provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
    • A. 

      Iterator

    • B. 

      Visitor

    • C. 

      Composite

    • D. 

      Command

  • 10. 
    Which of the following is correct about the Singleton design pattern.
    • A. 

      This type of design pattern comes under creational pattern.

    • B. 

      This pattern involves a single class which is responsible to create an object while making sure that only single object gets created.

    • C. 

      Singleton class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class

    • D. 

      All of the above.