set-8
351. Identify the problem of GoF pattern: How to obtain the power of polymorphism when reusing a class whose methods have the same function but not the same signature as the other methods in the hierarchy?
Adapter
Singleton
Façade
Delegation
352. Identify the problem of GoF pattern: How do you simplify the view that programmers have of a complex package?
Adapter
Singleton
Façade
Delegation
353. ______ represent the best practices used by experienced object-oriented software developers.
EB2
IMS
Design Patterns
JCL
354. GOF stands for?
Gamma of four
Gang of four
Gang of helm
Gamma of helm
355. Design patterns can be classified in ______ categories.
1
2
3
4
356. Which design patterns are specifically concerned with communication between objects?
Creational Patterns
Structural Patterns
Behavioral Patterns
J2EE Patterns
357. Which pattern are identified by Sun Java Center?
Adapter pattern
Creational pattern
Behavioral Patterns
J2EE Patterns
358. Factory pattern is one of most used design pattern in Java.
TRUE
FALSE
Can be true or false
Can not say
359. In how many steps Singleton class in java created?
1
2
3
4
360. ______ works as a bridge between two incompatible interfaces.
Builder pattern
Adapter pattern
Bridge pattern
Memento pattern
361. Filter pattern also known as?
Visitor pattern
Composite pattern
Filter pattern
Iterator pattern
362. Can we create a clone of a singleton object?
Yes
No
Can be yes or no
Can not say
363. You want to avoid multiple inheritance. Which design pattern would you choose?
Abstraction-Occurrence Pattern
Player-Role Pattern
General Hierarchy Pattern
Singleton Pattern
364. The recurring aspects of designs are called design
Patterns
Documents
Structures
Methods
365. Design pattern is a solution to a problem that occurs repeatedly in a variety of contexts.
True
False
366. Which pattern prevents one from creating more than one instance of a variable?
Factory Method
Singleton
Observer
None of the mentioned
367. Facade pattern promotes weak coupling between subsystem and its clients.
True
False
368. Which design pattern defines one-to-many dependency among objects?
State pattern
Adapter Pattern
Observer pattern
Factory method pattern
369. Facade pattern couples a subsystem from its clients.
True
False
370. 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?
Encapsulating the knowledge of which document subclass to is to be created and
Moving this knowledge out of the framework
Instantiating the application specific documents without knowing their class
All of the mentioned
371. Which mechanism is applied to use a design pattern in an OO system?
Inheritance
Composition
All of the mentioned
None of the mentioned
372. Design patterns does not follow the concept of software reuse.
True
False
373. The use of design patterns for the development of object-oriented software has important implications for ______.
Component-based software engineering
Reusability in general
All of the mentioned
None of the mentioned
374. Which of the following is a design pattern?
Behavioral
Structural
Abstract Factory
All of the mentioned
375. You want to minimize development cost by reusing methods? Which design pattern would you choose?
Adapter Pattern
Singleton Pattern
Delegation pattern
Builder Pattern
376. Which of the following is the correct list of entities of Composite Entity pattern?
Composite Entity, Coarse-Grained Object, Strategies
Composite Entity, Dependent Object, Strategies
Composite Entity, Coarse-Grained Object, Dependent Object, Strategies
Composite Entity, Coarse-Grained Object, Dependent Object
377. Which of the following describes the Behavioral pattern correctly?
This type of patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new operator
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.
This type of pattern are specifically concerned with communication between objects.
This type of pattern are specifically concerned with the presentation tier.
378. Which of the following is correct about Abstract Factory design pattern.
This type of design pattern comes under creational pattern.
Abstract Factory patterns work around a super-factory which creates other factories.
In Abstract Factory pattern an interface is responsible for creating a factory of related objects without explicitly specifying their classes.
All of the above.
379. Which of the following pattern refers to creating duplicate object while keeping performance in mind?
Proxy Pattern
Composite Pattern
Prototype Pattern
Facade Pattern
380. Which of the following pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance?
Iterator Pattern
Observer Pattern
Flyweight Pattern
Visitor Pattern
381. GRASP stands for ______.
Global responsibility assignment software patterns
General responsibility assignment software patterns
General responsibility assignment system patterns
General research assignment software patterns
382. There are ______ GRASP patterns.
7
8
9
10
383. Which GRASP pattern is suitable to handle alternatives based on type?
Indirection
Pure fabrication
Polymorphism
Creator
384. Which GRASP pattern helps to find out answer for “Who should be responsible for creating a new instance of some class?”
Adapter
Protected variations
Creator
Controller
385. You want all the clients using class A to use the same instance of class A, what should you do to achieve this goal?
Override a method of class A
Mark class a abstract
Apply the singleton pattern to class “A”
Apply the command pattern to class “A”
386. Which design pattern you would you use to have a prototypical instance determine the concrete class of object being created?
Prototype factory design pattern
Virtual prototype design pattern
Non-abstract prototype design pattern
Prototype design pattern
387. Which Design Pattern should you use when you want to parameterize objects by an action to perform?
Command
Prototype
Memento
Iterator
388. Which design pattern you would you use to decouple the creation procedure of a complex object from its concrete instance to be able to apply that procedure on variety of implementations.
Factory builder design pattern
Method builder design pattern
Builder design pattern
Observer method design pattern
389. Which Design Pattern should you use when you want to represent part-whole hierarchies of objects?
Composite
Decorator
Adapter
State
390. 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?
Mediator
Abstract factory
Visitor
Iterator
391. When would you use the GOF Decorator design pattern?
To translate an existing class interface into a compatible target interface
To assign more functionality to an object without sub-classing it
To decouple an abstraction from its implementation so that the two can vary independently
To nest layers of decorators to add more functionality
392. When would you use the GOF Composite design pattern?
To decouple an abstraction from its implementation so that the two can vary independently
To translates an existing class interface into a compatible target interface
To arrange object hierarchies such that the client code can access both the individual objects and compositions in a uniform manner
To improve the system overall performance
393. ______ are the consequences of applying the GOF Singleton pattern.
It introduces thread safety issue when the singleton instance is instantiated on demand
The client code can creates multiple instances at run time
It reduces of the class hierarchy as compared to the other factory design patterns
It makes it easier for a certain family of objects to work together
394. ______ describes the Builder pattern correctly.
This pattern builds a complex object using simple objects and using a step by step approach.
This pattern refers to creating duplicate object while keeping performance in mind.
This pattern is used when creation of object directly is costly.
This pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.
395. ______ is not one of the elements of a design pattern.
Content
Environment
Problem
Solution
396. Which GOF design pattern is applied in the code snippet below?
Proxy design pattern
Singleton design pattern
Façade design pattern
Abstract singleton design pattern
Can send a message
Cannot send a message
May send a message
Can’t send a message because Register and ProductCatalog are instance of a class
Last updated