SOLID Interview Questions

1. What is Single Responsibility Principle?

A class should have only one reason to change.

2. What is Open/Closed Principle?

Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.

Changing by adding new code rather than by changing existing code.

Keep the things that change frequently away from things that don't change.

3. What is Liskov Substitution Principle?

Subtypes must be substitutable for their base types.

4. What is Interface Segregation Principle?

Clients should not be forced to depend on methods they do not use.

5. What is Dependency Inversion Principle?

High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend upon details. Details should depend upon abstractions.

Không có nhận xét nào :

Đăng nhận xét