Design Patterns Online Quiz


Advertisements


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

Explanation

Command pattern is a data driven design pattern and falls under behavioral pattern category. A request is wrapped under an object as command and passed to invoker object. Invoker object looks for the appropriate object which can handle this command and passes the command to the corresponding object which executes the command.

Q 5 - Which of the following pattern a request is wrapped under an object as command and passed to invoker object?

A - Proxy Pattern

B - Chain of Responsibility Pattern

C - Command Pattern

D - Interpreter Pattern

Answer : C

Explanation

A request is wrapped under an object as command and passed to invoker object. Invoker object looks for the appropriate object which can handle this command and passes the command to the corresponding object which executes the command.

Q 8 - In which of the following pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

Answer : B

Explanation

In Abstract Factory Pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes.

Q 9 - Which type of design patterns concern class and object composition?

A - Creational Design Patterns

B - Structural Design Patterns

C - Behavioral Design Pattern

D - J2EE Design Patterns

Answer : B

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.

Answer : A

Explanation

Data Access Object Interface, Data Access Object concrete class, Model Object or Value Object are the entities of DAO Pattern.


design_pattern_questions_answers.htm

Advertisements