Gang of Four Design Patterns

Access: Public Instant Grading

Start FlashCards Download PDF Quiz Series

Get the best College algebra course in your pocket!

Quiz PDF eBook: 
Gang of Four Design Patterns
Download GOF Quiz PDF eBook
69 Pages
English US
Educational Materials

Sample Questions from the Gang of Four Design Patterns Quiz

Question: You want all the clients using class A to use the same instance of class A, what should you do to achieve this goal?


mark class A final

mark class A abstract

apply the Singleton pattern to class A

apply the Memento pattern to class A

Question: Which pattern is most appropriate when a decision must be made at the time a class is instantiated?




Factory Method


Question: When would you use the GOF abstract factory pattern?


To design a structure which has a uniform interface for both compositions of objects and individual objects.

To ensure that a certain group of related objects are used together

The client which uses your design is not dependent on how the object are created or connected together

To decouple the creation of objects from their usage

Question: What are the consequences of applying the Builder design pattern?


it makes the designed product hierarchies exchangeable

it's easier to introduce new product implementation

it separates the prodcut construction from it's representation

the director has fine control over the product creation procedure

Question: It is also known as Virtual Constructor and it is used to define an interface for creating an object but letting the subclass decide which class to instantiate, this pattern is :



Abstract Factory


Factory Method

Question: Which design pattern you would you use to decouple the creation procedure of a complex object from it's concrete instance to be able to apply that procedure on variety of implementations.


Factory builder design pattern

Method Builder design pattern

Builder design pattern

Factory method design pattern

Question: What would lead you to apply the builder design pattern?


To abstract steps of construction of objects so that different implementations

To apply the same object construction procedure on variety of representations

To translates one interface for a class into a compatible interface

To restrict instantiation of a class to one object

Question: What are the consequences of applying the abstract factory patter?


it will be much easier to introduce new family of products

it makes it easier for a certain family of objects to work together

it makes it easier for the client to deal with tree-structured data

it makes the designed product families exchangeable

Question: Given the following scenario: You want to create families of related objects, to be used interchangeably to configure you application. What is the most appropriate GoF pattern to use?


Chain of Responsibility

Abstract Factory



Question: Which of the following are participants in the GOF abstract factory design pattern ?


Factory methods

Factory constructors

Abstract factory

Abstract product

Concrete factory

Question: Which of the following are participants in the GOF builder design pattern?


Builder interface

Constructor Interface

Director Interface

Concrete Builder class

Concrete constructor class

Start FlashCards Download PDF Quiz Series
Anindyo Mukhopadhyay
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>