Question 1
EasyWhat does the S in SOLID stand for?
- A.
Static Responsibility Principle
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Object-Oriented Programming
What does the S in SOLID stand for?
Static Responsibility Principle
Single Responsibility Principle
Single Response Principle
Simple Responsibility Principle
Answer: B
A class should have only one reason to change.
What does the O in SOLID stand for?
Optional Principle
Open/Closed Principle
Object Principle
Overriding Principle
Answer: B
Software entities should be open for extension but closed for modification.
What does the L in SOLID stand for?
Liskov Substitution Principle
Logic Principle
Layered Design Principle
Loose Coupling Principle
Answer: A
Objects of a subclass should be usable wherever the parent class is expected, without breaking correctness.
What does the I in SOLID stand for?
Instance Principle
Inheritance Principle
Interface Segregation Principle
Inversion Principle
Answer: C
Clients shouldn't be forced to depend on methods they don't use.
What does the D in SOLID stand for?
Dynamic Binding Principle
Data Hiding Principle
Design Principle
Dependency Inversion Principle
Answer: D
High-level modules should depend on abstractions, not on low-level details.
What does the DRY principle say?
Don't Repeat Yourself: each piece of knowledge should live in one place
Do Repeat Yourself
Design Rarely Yourself
Delete Redundant Years
Answer: A
Duplicated logic tends to drift apart when only one copy is updated.
What does the KISS principle advise?
Keep inheritance shallow
Keep interfaces separate
Kill idle software
Keep it simple: avoid unnecessary complexity
Answer: D
Simple designs are easier to understand, test and change.
Who popularised the SOLID principles?
James Gosling
Guido van Rossum
Bjarne Stroustrup
Robert C. Martin ('Uncle Bob')
Answer: D
Martin collected the five principles; the acronym was coined by Michael Feathers.
What does the Single Responsibility Principle say about a class?
It should have only one method
It should have one object
It should be used only once
It should have only one reason to change
Answer: D
Each class should focus on one job.
What does the Open/Closed Principle say?
Classes should be public
Files should be opened and closed properly
Code should be open for extension but closed for modification
Every method should be overridable
Answer: C
New behaviour should be added by adding code, not by editing tested code.