Design Patterns/Design Patterns MCQ QUESTIONS AND ANSWER Sample Test,Sample questions

Question:
 GOF stands for ?

1. Gamma of four

2.Gang of four

3.Gang of helm

4.Gamma of helm

Posted Date:-2024-02-09 08:11:14


Question:
 In factory method pattern, the framework must instantiate classes but it only knows about the abstract classes, which it cannot initiate. How would one solve this problem?

1.encapsulating the knowledge of which document subclass to is to be created and

2.moving this knowledge out of the framework

3.instantiating the application specific documents without knowing their class

4.all of the mentioned

Posted Date:-2024-02-09 08:07:16


Question:
 In which pattern does a surrogate or placeholder class control access to the original object? 

1.Adapter

2.Proxy

3.Decorator

4.Bridge

Posted Date:-2024-02-09 07:41:46


Question:
 What is the primary purpose of the Prototype Pattern in design patterns? 

1.To provide a mechanism for creating, deleting, and managing classes at runtime.

2.To create a clone of an existing object rather than creating a new one, typically for performance reasons.

3.To provide a simple way to represent hierarchical relationships between objects.

4. To provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

Posted Date:-2024-02-09 07:38:48


Question:
 Which behavioral design pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable? 

1.Strategy

2.Observer

3.Mediator

4.State

Posted Date:-2024-02-09 07:57:31


Question:
 You want to minimize development cost by reusing methods? Which design pattern would you choose?

1.Adapter Pattern

2. Singleton Pattern

3. Delegation pattern

4. Immutable Pattern

Posted Date:-2024-02-09 08:04:50


Question:
Can we create a clone of a singleton object?

1.Yes

2.No

3.Can be yes or no

4.Can not say

Posted Date:-2024-02-09 08:14:53


Question:
Design patterns can be classified in _______ categories.

1.1

2.2

3.3

4.4

Posted Date:-2024-02-09 08:11:38


Question:
Factory pattern is one of most used design pattern in Java.

1.TRUE

2.FALSE

3.Can be true or false

4.Can not say

Posted Date:-2024-02-09 08:12:59


Question:
Filter pattern also known as?

1. Adapter pattern

2.Composite pattern

3. Filter pattern

4.Decorator pattern

Posted Date:-2024-02-09 08:14:20


Question:
Filter pattern also known as?

1. Adapter pattern

2.Composite pattern

3. Filter pattern

4.Decorator pattern

Posted Date:-2024-02-09 08:14:27


Question:
How many types of design patterns are there? 

1.3

2.5

3.8

4.10

Posted Date:-2024-02-09 07:34:31


Question:
In how many steps Singleton class in java created?

1. 1

2. 2

3.3

4.4

Posted Date:-2024-02-09 08:13:25


Question:
The Decorator design pattern is also known as: 

1.Wrapper

2. Virtual Proxy

3.Ghost

4. Pseudo Proxy

Posted Date:-2024-02-09 07:40:11


Question:
The recurring aspects of designs are called design

1.patterns

2.documents

3.structures

4.methods

Posted Date:-2024-02-09 08:05:54


Question:
The use of design patterns for the development of object-oriented software has important implications for

1.Component-based software engineering

2.Reusability in general

3.All of the mentioned

4.None of the mentioned

Posted Date:-2024-02-09 08:03:51


Question:
What is a design pattern in software development? 

1. A fixed set of coding rules

2. A general reusable solution to a commonly occurring problem

3.A specific coding style

4.None of the above

Posted Date:-2024-02-09 07:34:09


Question:
What is a Singleton design pattern? 

1. A design pattern that allows you to ensure that a class has only one instance

2.A design pattern that lets you fit more objects into the available amount of RAM

3.A design pattern that separates an object's specification from its implementation

4. A design pattern that ensures that the class has multiple instances

Posted Date:-2024-02-09 07:36:36


Question:
What is Template Design Pattern? 

1. It defines the skeleton of an algorithm in a method, deferring some steps to subclasses.

2.it ensures that a class has only one instance and provides a global point of access to it.

3.It encapsulates a request as an object, thereby allowing for the parameterization of clients with queues, requests, and operations.

4.It provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

Posted Date:-2024-02-09 07:59:14


Question:
What is the main benefit of using a design pattern?

1. It reduces the total codebase

2.It allows for the separation of responsibilities

3.It ensures that the code is easier to understand and debug

4.All of the above

Posted Date:-2024-02-09 07:35:02


Question:
What is the primary function of the Adapter design pattern in software development? 

1.It allows classes with incompatible interfaces to work together by wrapping its own interface around that of an already existing class.

2.It ensures that a class only has one instance and provides a global point of access to it.

3. It provides an interface for creating families of related or dependent objects without specifying their concrete classes.

4.It allows for the dynamic addition of new operations to objects without modifying the classes.

Posted Date:-2024-02-09 07:39:21


Question:
What is the primary purpose of the Abstract Factory design pattern in software design? 

1. It provides an interface for creating families of related or dependent objects without specifying their concrete classes.

2.It ensures that a class only has one instance and provides a global point of access to it.

3. It defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

4.It decouples an abstraction from its implementation so that the two can vary independently.

Posted Date:-2024-02-09 07:38:15


Question:
What is the use of the Builder Pattern?

1. It simplifies the creation of complex objects by breaking the creation process into steps.

2. It allows an object to alter its behavior when its internal state changes.

3.It ensures a class has only one instance and provides a global point of access to it.

4.It helps in hiding the complexities of the system and provides an interface to the client.

Posted Date:-2024-02-09 07:37:45


Question:
Which behavioral design pattern should be used when a behavior among objects should be encapsulated and made to operate on an object structure? 

1.Visitor

2.Strategy

3.Observer

4.Command

Posted Date:-2024-02-09 07:57:04


Question:
Which design pattern defines one-to-many dependency among objects?

1.Singleton pattern

2.Facade Pattern

3.Observer pattern

4.Factory method pattern

Posted Date:-2024-02-09 08:06:48


Question:
Which design pattern is used when there is a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically?

1.Observer

2.State

3.Visitor

4.Command

Posted Date:-2024-02-09 07:57:58


Question:
Which design pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation? 

1. Proxy pattern

2.Observer pattern

3.Iterator pattern

4.Strategy pattern

Posted Date:-2024-02-09 07:41:02


Question:
Which design pattern would you use to encapsulate a request as an object? 

1. Decorator Pattern

2.Command Pattern

3.Singleton Pattern

4. Bridge Pattern

Posted Date:-2024-02-09 07:58:29


Question:
Which design patterns are specifically concerned with communication between objects?

1.Creational Patterns

2.Structural Patterns

3.Behavioral Patterns

4. J2EE Patterns

Posted Date:-2024-02-09 08:12:10


Question:
Which mechanism is applied to use a design pattern in an OO system?

1.Inheritance

2.Composition

3.All of the mentioned

4.None of the mentioned

Posted Date:-2024-02-09 08:02:51


Question:
Which of the following best describes the Composite design pattern? 

1.The Composite pattern composes objects into tree structures to represent part-whole hierarchies.

2. The Composite pattern defines an interface for creating families of related or dependent objects without specifying their concrete classes.

3. The Composite pattern decouples an abstraction from its implementation so that the two can vary independently.

4.The Composite pattern provides a way to access the elements of a collection object in a sequential manner without any need to know its underlying representation.

Posted Date:-2024-02-09 07:40:38


Question:
Which of the following best describes the Factory Pattern in design patterns? 

1.It is used to create duplicate objects while keeping performance in mind.

2.It involves a single class that is responsible to join functionalities of independent or incompatible interfaces.

3.It restricts the instantiation of a class and ensures that only one instance of the class exists.

4.It allows an object to be created without exposing the creation logic to the client and the created object is referred to using a common interface.

Posted Date:-2024-02-09 07:37:10


Question:
Which of the following is a behavioral design pattern? 

1.Observer Pattern

2.Composite Pattern

3.Flyweight Pattern

4.Builder Pattern

Posted Date:-2024-02-09 07:36:07


Question:
Which of the following is a design pattern?

1.Behavioral

2.Structural

3.Abstract Factory

4. All of the mentioned

Posted Date:-2024-02-09 08:04:21


Question:
Which of the following is NOT a creational design pattern? 

1.Singleton Pattern

2.Factory Pattern

3.Bridge Pattern

4.Prototype Pattern

Posted Date:-2024-02-09 07:35:33


Question:
Which pattern allows an object to change its behavior when its internal state changes? 

1.State

2.Strategy

3.Visitor

4.Composite

Posted Date:-2024-02-09 07:42:29


Question:
Which pattern are identified by Sun Java Center?

1. Factory pattern

2. Abstract Factory pattern

3.Behavioral Patterns

4.J2EE Patterns

Posted Date:-2024-02-09 08:12:38


Question:
Which pattern helps in reducing complex conditional logic? 

1.Strategy pattern

2. Observer pattern

3. Factory pattern

4. Proxy pattern

Posted Date:-2024-02-09 07:39:49


Question:
Which pattern is specifically concerned with communication between objects? 

1.Mediator

2.Decorator

3.Factory

4.Command

Posted Date:-2024-02-09 07:41:24


Question:
Which pattern prevents one from creating more than one instance of a variable?

1.Factory Method

2.Singleton

3.Observer

4.None of the mentioned

Posted Date:-2024-02-09 08:06:21


Question:
Which structural design pattern decouples an abstraction from its implementation so that the two can vary independently? 

1.Adapter

2.Bridge

3.Composite

4.Facade

Posted Date:-2024-02-09 07:42:06


Question:
You want to avoid multiple inheritance. Which design pattern would you choose?

1.Abstraction-Occurrence Pattern

2.Player-Role Pattern

3.General Hierarchy Pattern

4.Singleton Pattern

Posted Date:-2024-02-09 08:05:22


Question:
_____ works as a bridge between two incompatible interfaces.

1.Prototype pattern

2.Adapter pattern

3. Bridge pattern

4. Filter pattern

Posted Date:-2024-02-09 08:13:58


Question:
________ represent the best practices used by experienced object-oriented software developers.

1.EB2

2.IMS

3.Design Patterns

4.JCL

Posted Date:-2024-02-09 08:10:30


More MCQS

  1. Design Pattern Mcq Set 1
  2. Design Patterns MCQ QUESTIONS AND ANSWER
  3. Software Design Modeling MCQ QUESTIONS AND ANSWER
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!