Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 458 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

351.

What is a database wrapper class?

A. a class that encapsulates a data structure
B. a class that encapsulates a database
C. a class that encapsulates the details of how to access data in a database
D. a class that encapsulates a relational table
Answer» D. a class that encapsulates a relational table
352.

Which view in architectural design shows the key abstractions in the system as objects or object classes?

A. physical
B. development
C. logical
D. process
Answer» D. process
353.

Which of the following pattern is the basis of interaction management in many web-based systems?

A. architecture
B. model-view-controller
C. repository pattern
D. different operating system
Answer» C. repository pattern
354.

In a client-server model where ‘n clients’ are sending request or receiving data from ‘m servers’. There are ‘x intermediate servers’ present which re-route the request (coming from Clients) to appropriate server based on the type of request. The intermediate server also returns the response to the client user-interface. What is the role of the intermediate server here?

A. blackboard
B. pipe
C. controller or model
D. broker
Answer» E.
355.

What is a deployment view of a software architecture?

A. a static view in terms of a module hierarchy
B. a static view in terms of components and connectors
C. a view of the physical configuration in terms of nodes and interconnections
D. a dynamic interaction view in terms of objects and messages
Answer» D. a dynamic interaction view in terms of objects and messages
356.

 Which of the following term is best defined by the statement:”The client sends structured query language (SQL) requests to the server which are transmitted as messages across the net”?

A. file servers
B. database servers
C. client servers
D. high end servers
Answer» C. client servers
357.

What is a software architectural pattern?

A. the structure of the major subsystems of a system
B. the components and connectors in a software architecture
C. a small group of collaborating objects
D. a recurring architecture used in a variety of systems
Answer» E.
358.

Which GOF design pattern is applied in the code snippet below? public class PrintSpooler { private static final PrintSpooler INSTANCE = new PrintSpooler(); private PrintSpooler() {} public static PrintSpooler getInstance() { return INSTANCE; } }

A. printspooler design pattern
B. singleton design pattern
C. factory design pattern
D. abstract singleton design pattern
Answer» C. factory design pattern
359.

What are the consequences of applying the abstract factory patter?

A. it will be much easier to introduce new family of products
B. it makes it easier for a certain family of objects to work together
C. it makes the designed product families exchangeable
D. both 2 & 3
Answer» E.
360.

What are the consequences of applying the GOF Singleton pattern?

A. it introduces thread safety issue when the singleton instance is instantiated on demand
B. the client code can creates multiple instances at run time
C. it reduces of the class hierarchy as compared to the other factory design patterns
D. it makes it easier for a certain family of objects to work together
Answer» B. the client code can creates multiple instances at run time
361.

Given the following scenario: You want to create families of related objects, to be used interchangeably to configure you application. What is most appropriate GoF pattern to use?

A. chain of responsibility
B. abstract factory
C. builder
D. observer
Answer» C. builder
362.

Which of the following describes the Behavioral pattern correctly?

A. this type of patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator
B. this type of patterns concern class and object composition. concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
C. this type of pattern are specifically concerned with communication between objects.
D. this type of pattern are specifically concerned with the presentation tier.
Answer» D. this type of pattern are specifically concerned with the presentation tier.
363.

Which of the following describes the Flyweight pattern correctly?

A. this pattern allows a user to add new functionality to an existing object without altering its structure.
B. this pattern is used where we need to treat a group of objects in similar way as a single object.
C. this pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance.
D. this pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.
Answer» D. this pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.
364.

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.
Answer» C. this pattern enables developers to filter a set of objects using different criteria and chaining them in a decoupled way through logical operations.
365.

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 concern class and object composition. concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
C. these design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator.
D. none of the above.
Answer» C. these design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator.
366.

Which of the following describes the MVC pattern correctly?

A. in this pattern, a visitor class is used which changes the executing algorithm of an element class.
B. this pattern is used to separate application\s concerns.
C. this pattern is used to decouple presentation tier and business tier.
D. this pattern is used in ejb persistence mechanism.
Answer» C. this pattern is used to decouple presentation tier and business tier.
367.

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.
Answer» B. this pattern refers to creating duplicate object while keeping performance in mind.
368.

Can We Create A Clone Of A Singleton Object?

A. true
B. false
Answer» B. false
369.

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

A. adapter pattern
B. singleton pattern
C. delegation pattern
D. immutable pattern
Answer» D. immutable pattern
370.

Classes that contain strongly related functionalities are described as having ____________.

A. high cohesion
B. high coupling
C. strong cohesion
D. none of above
Answer» B. high coupling
371.

What are the advantages of Factory objects?

A. separate the responsibility of complex creation into cohesive helper objects.
B. hide potentially complex creation logic.
C. allow introduction of performance-enhancing memory management strategies, such as object caching or recycling.
D. all of above
Answer» E.
372.

When would you use the GOF Composite design pattern?

A. to decouple an abstraction from its implementation so that the two can vary independently
B. to translates an existing class interface into a compatible target interface
C. to arrange object hierarchies such that the client code can access both the individual objects and compositions in a uniform manner
D. to improve the system overall performance
Answer» D. to improve the system overall performance
373.

When would you use the GOF Decorator design pattern?

A. to translates an existing class interface into a compatible target interface
B. to assign more functionality to an object without sub-classing it
C. to decouple an abstraction from its implementation so that the two can vary independently
D. to nest layers of decorators to add more functionality
Answer» C. to decouple an abstraction from its implementation so that the two can vary independently
374.

In the Publish-Subscribe messaging model, the subscribers register themselves in a topic and are notified when new messages arrive to the topic. Which pattern does most describe this model?

A. adapter
B. notifier
C. observer
D. factory
Answer» D. factory
375.

What object should have the responsibility, when you do not want to violate High Cohesion and Low Coupling, or other goals, but solutions offered by Expert are not appropriate?

A. pure fabrication
B. indirection
C. creator
D. polymorphism
Answer» B. indirection
376.

Which design pattern is used in the Java InputStream and OutputStream hierarchies?

A. adapter design pattern
B. decorator design pattern
C. composite design pattern
D. singleton design pattern
Answer» C. composite design pattern
377.

Which of the following are participants in the GOF builder design pattern?

A. creator
B. refined abstraction
C. abstract factory
D. none of above
Answer» B. refined abstraction
378.

The factory method design pattern is also known as:

A. abstract factory
B. abstract constructor
C. virtual factory
D. virtual constructor
Answer» E.
379.

Which design pattern you would you use to control the creation of an object based on a established interface, while allowing the concrete implementation to determine the subclass to construct.

A. singleton design pattern
B. builder factory design pattern
C. prototype factory design pattern
D. factory method design pattern
Answer» E.
380.

To implement the Singleton design pattern specify all the needed steps ............

A. add final modifier to the class declaration
B. add private or protected modifier to the constructor declaration
C. introduce a static getter method for the singleton instance
D. all of above
Answer» E.
381.

What would lead you to apply the builder design pattern?

A. to abstract steps of construction of objects so that different implementations
B. to apply the same object construction procedure on variety of representations
C. both 1 & 2
D. none of above
Answer» D. none of above
382.

Which design pattern you would you use to decouple the creation procedure of a complex object from it's concrete instance to be able to apply that procedure on variety of implementations.

A. factory builder design pattern
B. method builder design pattern
C. builder design pattern
D. factory method design pattern
Answer» D. factory method design pattern
383.

Which design pattern you would you use to have a prototypical instance determine the concrete class of object being created?

A. prototype factory design pattern
B. virtual prototype design pattern
C. abstract prototype design pattern
D. prototype design pattern
Answer» E.
384.

You want all the clients using class A to use the same instance of class A, what should you do to achieve this goal?

A. mark class a final
B. mark class a abstract
C. apply the singleton pattern to class a
D. apply the memento pattern to class a
Answer» D. apply the memento pattern to class a
385.

It is also known as Virtual Constructor and it is used to define an interface for creating an object but letting the subclass decide which class to instantiate, this pattern is :

A. builder
B. abstract factory
C. prototype
D. factory method
Answer» E.
386.

Which pattern is most appropriate when a decision must be made at the time a class is instantiated?

A. bridge
B. composite
C. factory method
D. command
Answer» D. command
387.

Which design pattern suggest multiple classes through which request is passed and multiple but only relevant classes carry out operations on the request?

A. singleton pattern
B. chain of responsibility pattern
C. state pattern
D. bridge pattern
Answer» C. state pattern
388.

Which of the following Chooses and standardizes patterns for a problem domain promotes software reuse and, hence, quality and productivity?

A. promoting communication
B. streamlining documentation
C. increasing development efficiency
D. supporting software reuse
Answer» E.
389.

Which design pattern provides a single class which provides simplified methods required by client and delagates call to those methods?

A. adapter pattern
B. builder pattern
C. facade pattern
D. prototype pattern
Answer» D. prototype pattern
390.

Which of the following describes the Command pattern correctly?

A. in this pattern a class represents functionality of another class.
B. this pattern creates a chain of receiver objects for a request.
C. this pattern provides a way to evaluate language grammar or expression.
D. in this pattern a request is wrapped under an object as command and passed to invoker object.
Answer» E.
391.

A ___________ is an object that stores a snapshot of the internal state of another object.

A. observer
B. memento
C. create
D. none of above
Answer» C. create
392.

Which pattern is used When an object wants to publish information and many objects will need to receive that information.

A. publisher pattern
B. brodcast pattern
C. observer pattern
D. none of above
Answer» D. none of above
393.

The ____________ is often employed when there is a need to use different sets of objects and where the objects could be added or changed some time during the lifetime of an application.

A. abstract factory
B. singleton pattern
C. builder pattern
D. prototype pattern
Answer» B. singleton pattern
394.

___________ pattern ensure a class only has one instance and provide a global point of access to it.

A. singleton pattern
B. filter pattern
C. state pattern
D. bridge pattern
Answer» B. filter pattern
395.

Which pattern is used when configuring an application with classes dynamically.

A. facade pattern
B. builder pattern
C. prototype pattern
D. bridge pattern
Answer» D. bridge pattern
396.

The client software uses the ___________ which provides an interface for creating families related or dependent objects.

A. constant factory
B. abstract factory
C. full factory
D. intermediate factory
Answer» C. full factory
397.

In which of the following pattern a class represents functionality of another class?

A. proxy pattern
B. chain of responsibility pattern
C. command pattern
D. interpreter pattern
Answer» B. chain of responsibility pattern
398.

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

A. component-based software engineering
B. reusability in general
C. all of the above
D. none of above
Answer» D. none of above
399.

Which of the following describes the Facade pattern correctly?

A. this pattern allows a user to add new functionality to an existing object without altering its structure
B. this pattern is used where we need to treat a group of objects in similar way as a single object
C. this pattern hides the complexities of the system and provides an interface to the client using which the client can access the system
D. this pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance
Answer» D. this pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance
400.

Attach additional responsibilities to an object dynamically.It provides a flexible alternative to subclassing for extending functionality.

A. chain of responsibility
B. adapter
C. decorator
D. composite
Answer» D. composite