0
0
Software Engineeringknowledge~5 mins

SOLID principles in Software Engineering - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the 'S' in SOLID stand for?
It stands for <em>Single Responsibility Principle</em>. This means a class or module should have only one reason to change, focusing on a single task or responsibility.
Click to reveal answer
beginner
Explain the Open/Closed Principle in simple terms.
It means software entities like classes should be open for extension but closed for modification. You can add new features without changing existing code.
Click to reveal answer
intermediate
What is the Liskov Substitution Principle?
It says that objects of a parent class should be replaceable with objects of a child class without affecting the program's correctness.
Click to reveal answer
intermediate
Describe the Interface Segregation Principle.
This principle advises that no client should be forced to depend on methods it does not use. It's better to have many small, specific interfaces than one large, general one.
Click to reveal answer
advanced
What does the Dependency Inversion Principle promote?
It promotes that high-level modules should not depend on low-level modules. Both should depend on abstractions. Also, abstractions should not depend on details; details should depend on abstractions.
Click to reveal answer
Which SOLID principle means a class should have only one reason to change?
ASingle Responsibility Principle
BOpen/Closed Principle
CLiskov Substitution Principle
DDependency Inversion Principle
What does the Open/Closed Principle encourage?
AClasses should be open for modification but closed for extension
BClasses should depend on concrete implementations
CClasses should have many responsibilities
DClasses should be open for extension but closed for modification
According to the Liskov Substitution Principle, a subclass should be able to replace its superclass without:
AUsing interfaces
BAdding new methods
CChanging the program's correctness
DChanging variable names
The Interface Segregation Principle suggests:
AUse many small, specific interfaces
BClients should depend on interfaces they do not use
CUse one large interface for all clients
DAvoid using interfaces
Dependency Inversion Principle states that:
AHigh-level modules depend on low-level modules
BBoth depend on abstractions
CLow-level modules depend on high-level modules
DAbstractions depend on details
Explain each of the SOLID principles in your own words and give a simple example for one of them.
Think about how each principle helps keep code easy to maintain and extend.
You got /6 concepts.
    Why are the SOLID principles important in software development? Describe how they help in real-life coding projects.
    Consider how following these principles affects teamwork and code quality.
    You got /5 concepts.