Design Patterns Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Design Patterns Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : A

Explanation

In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book titled Design Patterns - Elements of Reusable Object-Oriented Software which initiated the concept of Design Pattern in Software development. These authors are collectively known as Gang of Four (GOF).

Answer : C

Explanation

Adapter pattern works as a bridge between two incompatible interfaces. This pattern involves a single class which is responsible to join functionalities of independent or incompatible interfaces.

Q 3 - Which of the following pattern is used where we need to treat a group of objects in similar way as a single object?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : A

Explanation

Composite Pattern is used where we need to treat a group of objects in similar way as a single object.

Q 4 - Which of the following pattern allows a user to add new functionality to an existing object without altering its structure?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : D

Explanation

Decorator Pattern allows a user to add new functionality to an existing object without altering its structure.

Q 5 - Which of the following pattern is used when there is one-to-many relationship between objects such as if one object is modified, its depenedent objects are to be notified automatically?

A - Iterator Pattern

B - Mediator Pattern

C - Memento Pattern

D - Observer Pattern

Answer : A

Explanation

Observer Pattern is used when there is one-to-many relationship between objects such as if one object is modified, its depenedent objects are to be notified automatically.

Answer : A

Explanation

In Visitor pattern, a visitor class is used which changes the executing algorithm of an element class.

Q 8 - Which of the following pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : B

Explanation

Front Controller Pattern is used to provide a centralized request handling mechanism so that all requests will be handled by a single handler.

Answer : C

Explanation

Filter, Filter Chain, Target, Filter Manager, Client are the entities of Intercepting pattern.

design_pattern_questions_answers.htm
Advertisements