Creational Design Patterns

Structural Design Patterns

Behavioral Design Patterns

J2EE Design Patterns

Design Patterns Useful Resources

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 2 - Runtime class is an example of singleton.

A - true

B - false

Answer : A

Explanation

true. Each java application uses Runtime as a single object.

Q 3 - Which of the following pattern builds a complex object using simple objects and using a step by step approach?

A - Builder Pattern

B - Bridge Pattern

C - Adapter Pattern

D - Filter Pattern

Answer : A

Explanation

Builder Pattern builds a complex object using simple objects and using a step by step approach. This builder is independent of other objects.

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.

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 - Which of the following pattern is used to separate application's concerns?

A - Visitor Pattern

B - MVC Pattern

C - Business Delegate Pattern

D - Composite Entity Pattern

Answer : B

Explanation

MVC pattern is used to separate application's concerns.

Q 9 - Which of the following pattern is used when we want to pass data with multiple attributes in one shot from client to server?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

Answer : D

Explanation

Transfer Object Pattern is used when we want to pass data with multiple attributes in one shot from client to server.

Answer : C

Explanation

Composite Entity, Coarse-Grained Object, Dependent Object, Strategies are the entities of Composite Entity Pattern.

design_pattern_questions_answers.htm
Advertisements