MCQsSpecialized MCQsC++ Design PatternsC++ Design Patterns 1).What is a design pattern in C++?1) A reusable solution to a common problem2) A specific algorithm3) A C++ feature4) None of the above 2).Which of the following is a structural design pattern?1) Observer2) Decorator3) Factory4) None of the above 3).What is the purpose of the Singleton design pattern?1) To ensure a class has only one instance2) To allow multiple instances of a class3) To hide the implementation details4) None of the above 4).Which design pattern is used to create objects without specifying the exact class?1) Factory Method2) Singleton3) Abstract Factory4) None of the above 5).Which design pattern is used to provide a way to access elements of a collection without exposing the underlying structure?1) Iterator2) Observer3) Decorator4) None of the above 6).What is the purpose of the Observer design pattern?1) To allow an object to notify other objects about changes2) To control the creation of objects3) To represent a hierarchy of classes4) None of the above 7).Which design pattern is used to add new functionality to an object without changing its structure?1) Decorator2) Strategy3) Composite4) None of the above 8).Which of the following is an example of a behavioral design pattern?1) Observer2) Abstract Factory3) Prototype4) None of the above 9).Which design pattern is used to represent part-whole hierarchies?1) Composite2) Strategy3) Chain of Responsibility4) None of the above 10).Which design pattern allows an object to behave differently based on its internal state?1) State2) Factory Method3) Singleton4) None of the above