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

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 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 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.

Q 7 - Which of the following pattern is used to to decouple presentation tier and business tier?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : C

Explanation

Business Delegate pattern is used to decouple presentation tier and business tier.

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

Explanation

Client, Business Delegate, LookUp Service, Business Service are the entities of Business Delegate Pattern.

design_pattern_questions_answers.htm
Advertisements