1/34
Looks like no tags are added yet.
This design principle suggests that all the derived classes of a base class should be able to perform the same behavior as their base class without negative side effects.
Liskov Substitution Principle
This design principle suggests that flexible software are those with classes that rely on abstract classes or interfaces.
Dependency Inversion Principle
This design principle advises software engineers to avoid relying on things that they do not use.
Interface Segregation Principle
Software is hard to change because every applied change will affect many parts of the software. Which characteristic of poor software design is described?
Rigidity
This feature of a design pattern describes when to use the pattern
Problem
This behavioral design pattern suggests that when an object changes state, all of its dependents are notified automatically.
Observer Pattern
The software modules are hard to reuse in another software because these cannot be extracted from the current software. Which characteristic of poor software design is described?
Immobility
This design principle suggests that each software module should have only one (1) reason to change.
Single Responsibility Principle
When applying changes to the software, unexpected parts of the software break. Which characteristic of poor software design is described?
Fragility
This feature of design patterns refers to the results and interchanges of applying the pattern.
Consequences
This creational design pattern ensures that a class has only one (1) instance while providing a global access point to the instance.
Singleton Pattern
This category of design pattern describes how communication happens between objects.
Behavioral Pattern
This feature of design patterns describes the responsibilities and collaborations of elements that make up the design.
Solution
This design principle states that when there are new software requirements, the new behavior must be added by deriving a new class without modifying the existing class.
Open-Closed Principle
This category of design pattern describes how objects are composed into larger groups.
Structural Pattern
A class named BankAccount is modified every time a new type of bank account is added. This scenario violates which design principle?
Open-Closed Principle
Which of the following is NOT a structural design pattern?
Strategy Pattern
Which of the following is NOT a structural design pattern?
Observer Pattern
Which best describes the Decorator pattern?
It allows developers to attach new behaviors to objects by placing them inside special wrapper objects.
Which best describes the Bridge pattern?
It allows developers to split a large class into two (2) separate hierarchies: abstraction and implementation.
A payroll application consists of an Employee class that consists of methods belonging to multiple actors. This scenario violates which design principle?
Single Responsibility Principle
Which of the following is NOT a structural design pattern?
Abstract Factory Pattern
A high-level class named UserManager relies on the low-level class named EmailNotifier. This scenario violates which design principle?
Dependency Inversion Principle
Which of the following is NOT a creational pattern?
Adapter Pattern
Which best describes the Prototype pattern?
It allows developers to copy existing objects without making their code dependent on their classes.
Which best describes the Flyweight pattern?
It allows developers to fit more objects into the available memory by having multiple objects share common parts of a state.
Which best describes the Factory Method pattern?
It defines an interface or abstract class for creating objects in a superclass but allows subclasses to alter the type of objects to be created.
Which best describes the Proxy pattern?
It allows developers to provide a substitute or placeholder for another object.
Which of the following best describes the Strategy pattern?
It allows developers to define a family of algorithms, put each of them into a separate class, and make their objects interchangeable.
Which best describes the Builder pattern?
It allows developers to construct complex objects step by step.
When using the Proxy pattern, what is the primary advantage of introducing a proxy object before the real service object?
It allows performing pre/post-processing without altering the original class.
The Composite Pattern simplifies working with tree-like structures by:
Allowing clients to treat individual and grouped objects uniformly
In the Prototype Pattern, why is cloning preferable to creating new objects directly?
It avoids code dependency on object classes and handles private fields
A developer modifies a payroll application's calculatePay() method without realizing that the same method is also used by the reportHours() function, leading to incorrect HR reports. Which design principle would have prevented this issue?
Single Responsibility Principle
The Interface Segregation Principle (ISP) promotes which of the following design practices?
Creating multiple small, client-specific interfaces instead of one large interface