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

Q 2 - If we serialize a singleton object and deserialize it then the result object will be same.

A - true

B - false

Answer : B

Explanation

false. Deserializing a serialized object will yield a different object.

Answer : B

Explanation

As the name suggests, the chain of responsibility pattern creates a chain of receiver objects for a request.

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 6 - In which of the following pattern, a class behavior or its algorithm can be changed at run time?

A - State Pattern

B - Null Object Pattern

C - Strategy Pattern

D - Template Pattern

Answer : C

Explanation

In Strategy pattern, a class behavior or its algorithm can be changed at run time.

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.

Q 10 - In MVC pattern, Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.

A - true

B - false

Answer : A

Explanation

True. In MVC pattern, Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes.

design_pattern_questions_answers.htm
Advertisements