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.

Answer : C

Explanation

Adapter pattern works as a bridge between two incompatible interfaces. This pattern involves a single class which is responsible to join functionalities of independent or incompatible interfaces.

Q 3 - Which of the following pattern refers to creating duplicate object while keeping performance in mind?

A - Builder Pattern

B - Bridge Pattern

C - Prototype Pattern

D - Filter Pattern

Answer : C

Explanation

Prototype pattern refers to creating duplicate object while keeping performance in mind.

Q 4 - Which of the following pattern allows a user to add new functionality to an existing object without altering its structure?

A - Composite Pattern

B - Facade Pattern

C - Flyweight Pattern

D - Decorator Pattern

Answer : D

Explanation

Decorator Pattern allows a user to add new functionality to an existing object without altering its structure.

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

Explanation

Service, Context, Service Locator, Cache, Client are the entities of Service Locator pattern.

design_pattern_questions_answers.htm
Advertisements