0% found this document useful (0 votes)
8 views2 pages

Section 7 Design Patterns Questions

The document contains a series of questions related to design patterns, focusing on their definitions and appropriate use cases. It covers various patterns such as Singleton, Factory, Abstract Factory, Observer, Decorator, and Command, among others. Each question presents multiple-choice answers to test understanding of these design patterns.

Uploaded by

karimstudy67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Section 7 Design Patterns Questions

The document contains a series of questions related to design patterns, focusing on their definitions and appropriate use cases. It covers various patterns such as Singleton, Factory, Abstract Factory, Observer, Decorator, and Command, among others. Each question presents multiple-choice answers to test understanding of these design patterns.

Uploaded by

karimstudy67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Section 7: Design Patterns

Q1. Which design pattern is best suited for creating a family of related objects?
• A) Singleton
• B) Factory
• C) Abstract Factory
• D) Adapter

Q2. In which design pattern is a single instance of a class restricted?


• A) Prototype
• B) Singleton
• C) Builder
• D) Proxy

Q3. Which pattern allows behavior to be added to an individual object without affecting
others of the same class?
• A) Singleton
• B) Observer
• C) Decorator
• D) Adapter

Q4. What type of pattern is the Observer pattern?


• A) Creational
• B) Structural
• C) Behavioral
• D) Factory

Q5. Which design pattern separates the construction of a complex object from its
representation?
• A) Builder
• B) Factory
• C) Singleton
• D) Adapter

Q6. Which of the following is a feature of the Adapter pattern?


• A) Adapts interfaces of different classes
• B) Creates a family of related objects
• C) Controls object access
• D) Defines an object for undefined behavior

Q7. Which design pattern involves creating a duplicate of an existing object?


• A) Singleton
• B) Prototype
• C) Factory
• D) Decorator

Q8. In the MVC pattern, where is business logic generally handled?


• A) Model
• B) View
• C) Controller
• D) Proxy

Q9. Which design pattern would be most appropriate for managing expensive-to-create
resources?
• A) Factory
• B) Prototype
• C) Proxy
• D) Singleton

Q10. The Command pattern is typically used for what purpose?


• A) To encapsulate requests as objects
• B) To allow a single method for various commands
• C) To restrict object creation
• D) To clone complex objects

You might also like