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 1 - Can we create a clone of a singleton object?

A - true

B - false

Answer : A

Explanation

true. It is possible to get a clone of singleton object. Throw exception within the body of clone() method to prevent cloning.

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 hides the complexities of the system and provides an interface to the client using which the client can access the system?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : B

Explanation

Facade pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.

Answer : C

Explanation

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

Q 8 - Which of the following pattern is used when we want to locate various services using JNDI lookup?

A - DAO Pattern

B - Front Controller Pattern

C - Intercepting Pattern

D - Service Locator Pattern

Answer : D

Explanation

Service Locator Pattern is used when we want to locate various services using JNDI lookup.

Answer : C

Explanation

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

design_pattern_questions_answers.htm
Advertisements