On This Page

This set of software design modeling (SDM) Multiple Choice Questions & Answers (MCQs) focuses on Software Design Modeling Set 8

Q1 | What would lead you to apply the builder design pattern?
  • to abstract steps of construction of objects so that different implementations
  • to apply the same object construction procedure on variety of representations
  • both 1 & 2
  • none of above
Q2 | To implement the Singleton design pattern specify all the needed steps ............
  • add final modifier to the class declaration
  • add private or protected modifier to the constructor declaration
  • introduce a static getter method for the singleton instance
  • all of above
Q3 | 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.
  • singleton design pattern
  • builder factory design pattern
  • prototype factory design pattern
  • factory method design pattern
Q4 | The factory method design pattern is also known as:
  • abstract factory
  • abstract constructor
  • virtual factory
  • virtual constructor
Q5 | Which of the following are participants in the GOF builder design pattern?
  • creator
  • refined abstraction
  • abstract factory
  • none of above
Q6 | Which design pattern is used in the Java InputStream and OutputStream hierarchies?
  • adapter design pattern
  • decorator design pattern
  • composite design pattern
  • singleton design pattern
Q7 | 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?
  • pure fabrication
  • indirection
  • creator
  • polymorphism
Q8 | 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?
  • adapter
  • notifier
  • observer
  • factory
Q9 | When would you use the GOF Decorator design pattern?
  • to translates 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
Q10 | 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
Q11 | What are the advantages of Factory objects?
  • separate the responsibility of complex creation into cohesive helper objects.
  • hide potentially complex creation logic.
  • allow introduction of performance-enhancing memory management strategies, such as object caching or recycling.
  • all of above
Q12 | Classes that contain strongly related functionalities are described as having ____________.
  • high cohesion
  • high coupling
  • strong cohesion
  • none of above
Q13 | You want to minimize development cost by reusing methods? Which design pattern would you choose?
  • adapter pattern
  • singleton pattern
  • delegation pattern
  • immutable pattern
Q14 | Can We Create A Clone Of A Singleton Object?
  • true
  • false
Q15 | Which of the following is correct about Structural design patterns.
  • these design patterns are specifically concerned with communication between objects.
  • 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.
  • these design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator.
  • none of the above.
Q16 | Which of the following describes the Filter 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 enables developers to filter a set of objects using different criteria and chaining them in a decoupled way through logical operations.
  • this pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.
Q17 | Which of the following describes the Flyweight pattern correctly?
  • this pattern allows a user to add new functionality to an existing object without altering its structure.
  • this pattern is used where we need to treat a group of objects in similar way as a single object.
  • this pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance.
  • this pattern hides the complexities of the system and provides an interface to the client using which the client can access the system.
Q18 | 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 opreator
  • 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.
Q19 | 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?
  • chain of responsibility
  • abstract factory
  • builder
  • observer
Q20 | What 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
Q21 | What are the consequences of applying the abstract factory patter?
  • it will be much easier to introduce new family of products
  • it makes it easier for a certain family of objects to work together
  • it makes the designed product families exchangeable
  • both 2 & 3
Q22 | 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;}}
  • printspooler design pattern
  • singleton design pattern
  • factory design pattern
  • abstract singleton design pattern
Q23 | What is a software architectural pattern?
  • the structure of the major subsystemsof a system
  • the components and connectors ina software architecture
  • a small group of collaboratingobjects
  • a recurring architecture used in a variety of systems