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

Answer : C

Explanation

Structural design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.

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.

Q 3 - Which of the following pattern works as a bridge between two incompatible interfaces?

A - Builder Pattern

B - Adapter Pattern

C - Prototype Pattern

D - Filter Pattern

Answer : B

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 4 - Which of the following pattern creates a chain of receiver objects for a request?

A - Proxy Pattern

B - Chain of Responsibility Pattern

C - Command Pattern

D - Interpreter Pattern

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.

Answer : C

Explanation

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

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 8 - Which of the following pattern involves a single class which is responsible to create an object while making sure that only single object gets created?

A - Factory Pattern

B - Abstract Factory Pattern

C - Singleton Pattern

D - Transfer Object Pattern

Answer : C

Explanation

Singleton Pattern involves a single class which is responsible to create an object while making sure that only single object gets created.

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

Explanation

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

design_pattern_questions_answers.htm
Advertisements