Tutorialspoint design patterns mock test 1

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A

13 - Runtime class is an example of singleton. A - true B - false

A

Can we create a clone of a singleton object? A - true B - false

B

Event handling frameworks like swing, awt use Observer Pattern. A - false B - true

B

If we serialize a singleton object and deserialize it then the result object will be same. A - true B - false

A

Integer class is an example of Decorator pattern. A - true B - false

B

Integer.valueOf is an example of Factory pattern. A - false B - true

A

What is Gang of Four GOF? A - Four authors of Book 'Design Patterns - Elements of Reusable Object-Oriented Software' are known as Gang of Four GOF. B - Gang of Four GOF is a name of a book on Design Patterns. C - Gang of Four GOF is a Design Pattern. D - None of the above.

C

Which of the following describes the Adapter pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern works as a bridge between two incompatible interfaces. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

D

Which of the following describes the Bridge pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern is used when creation of object directly is costly. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

A

Which of the following describes the Builder pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern is used when creation of object directly is costly. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

B

Which of the following describes the Filter pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern enables developers to filter a set of objects using different criteria and chaining them in a decoupled way through logical operations. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

B

Which of the following describes the Prototype pattern correctly? A - This pattern builds a complex object using simple objects and using a step by step approach. B - This pattern refers to creating duplicate object while keeping performance in mind. C - This pattern works as a bridge between two incompatible interfaces. D - This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.

D

Which of the following is correct about Abstract Factory design pattern. A - This type of design pattern comes under creational pattern. B - Abstract Factory patterns work around a super-factory which creates other factories. C - In Abstract Factory pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes. D - All of the above.

A

Which of the following is correct about Behavioral design patterns. A - These design patterns are specifically concerned with communication between objects. B - These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. C - These 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. D - None of the above.

B

Which of the following is correct about Creational design patterns. A - These design patterns are specifically concerned with communication between objects. B - These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. C - These 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. D - None of the above.

D

Which of the following is correct about Factory design pattern. A - This type of design pattern comes under creational pattern. B - Factory pattern creates object without exposing the creation logic to the client. C - Factory pattern refers to newly created object using a common interface. D - All of the above.

D

Which of the following is correct about Singleton design pattern. A - This type of design pattern comes under creational pattern. B - This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. C - Singleton class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class. D - All of the above.

C

Which of the following is correct about Structural design patterns. A - These design patterns are specifically concerned with communication between objects. B - These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. C - These 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. D - None of the above.

A

Which of the following is correct list of classifications of design patterns. A - Creational, Structural and Behavioral patterns. B - Executional, Structural and Behavioral patterns. C - Creational, Executional and Behavioral patterns. D - None of the above.

D

Which of the following is true about design patterns? A - Design patterns represent the best practices used by experienced object-oriented software developers. B - Design patterns are solutions to general problems that software developers faced during software development. C - Design patterns are obtained by trial and error by numerous software developers over quite a substantial period of time. D - All of the above.

A

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

A

Which of the following pattern is used when creation of object directly is costly? A - Bridge Pattern B - Adapter Pattern C - Prototype Pattern D - Filter Pattern

A

Which of the following pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently? A - Bridge Pattern B - Adapter Pattern C - Prototype Pattern D - Filter Pattern

C

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

B

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


Set pelajaran terkait

Midterm 2 Cog Psych Quiz 5 Problem Solving

View Set

religion chapter 3 history of the church

View Set

International Business Chapter 16

View Set

BIOEE 1610: Post Prelim 3 Questions

View Set