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 3 - Which of the following pattern is used when creation of object directly is costly?

A - Bridge Pattern

B - Adapter Pattern

C - Prototype Pattern

D - Filter Pattern

Answer : A

Explanation

Prototype pattern is used when creation of object directly is costly.

Answer : A

Explanation

In proxy pattern, a class represents functionality of another class. This type of design pattern comes under structural pattern. In proxy pattern, we create object having original object to interface its functionality to outer world.

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, a null object replaces check of NULL object instance?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : B

Explanation

In Null Object pattern, a null object replaces check of NULL object instance.

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 involves a single class which is responsible to create an object while making sure that only single object gets created?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

Answer : C

Explanation

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

Q 9 - Which type of design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator?

A - Creational Design Patterns

B - Structural Design Patterns

C - Behavioral Design Pattern

D - J2EE Design Patterns

Answer : A

Explanation

Creational Design Patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator.

Answer : A

Explanation

Business Object , Transfer Object, Client are the entities of Transfer Object pattern.

design_pattern_questions_answers.htm
Advertisements