Creational Design Patterns

Structural Design Patterns

Behavioral Design Patterns

J2EE Design Patterns

Design Patterns Useful Resources

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 : C

Explanation

Structural design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.

Q 2 - Integer class is an example of Decorator pattern.

A - true

B - false

Answer : A

Explanation

true. Wrapper classes like Integer, Boolean uses Decorator pattern.

Q 3 - Which of the following pattern builds a complex object using simple objects and using a step by step approach?

A - Builder Pattern

B - Bridge Pattern

C - Adapter Pattern

D - Filter Pattern

Answer : A

Explanation

Builder Pattern builds a complex object using simple objects and using a step by step approach. This builder is independent of other objects.

Q 4 - Which of the following pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : C

Explanation

Flyweight pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance.

Q 5 - Which of the following pattern is used to reduce communication complexity between multiple objects or classes?

A - Iterator Pattern

B - Mediator Pattern

C - Memento Pattern

D - Observer Pattern

Answer : B

Explanation

Mediator pattern is used to reduce communication complexity between multiple objects or classes.

Q 6 - In which of the following pattern, an abstract class exposes defined way(s)/template(s) to execute its methods?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : D

Explanation

In Template pattern, an abstract class exposes defined way(s)/template(s) to execute its methods.

Q 7 - In which of the following pattern, a visitor class is used which changes the executing algorithm of an element class?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

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 when we want to do some pre-processing / post-processing with request or response of the application?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : C

Explanation

Intercepting Pattern is used when we want to do some pre-processing / post-processing with request or response of the application.

Q 10 - Which of the following is the correct list of entities of MVC pattern?

A - Model, View, Controller

B - Model, Viewer, Control

C - Middle, Viewer, Controller

D - Model, View, Control

Answer : A

Explanation

Model, View, Controller are the entities of MVC Pattern.

design_pattern_questions_answers.htm
Advertisements