Question 11
EasyWhat does the Liskov Substitution Principle say?
- A.
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 Liskov Substitution Principle say?
Objects of a subclass should work wherever the base class is expected, without breaking the program
Base classes must be abstract
A subclass must have more methods
Subclasses cannot override methods
Sign up free to see the answer and a step-by-step explanation.
What does the Interface Segregation Principle say?
Every class should have one interface
Interfaces should be as large as possible
Interfaces must have no methods
Clients should not be forced to depend on methods they don't use
Sign up free to see the answer and a step-by-step explanation.
What does the Dependency Inversion Principle say?
Classes should depend on each other in a cycle
High-level code should depend on abstractions, not on concrete implementations
Low-level code should control high-level code
Dependencies should be avoided entirely
Sign up free to see the answer and a step-by-step explanation.
In software design, what is coupling?
How fast a program runs
How many lines a class has
How classes are named
How much one class or module depends on another
Sign up free to see the answer and a step-by-step explanation.
In software design, what is cohesion?
How closely related the responsibilities inside one class or module are
How many classes there are
How often code is reused
How classes depend on each other
Sign up free to see the answer and a step-by-step explanation.
What is a design pattern?
A type of UML diagram
A finished library of code
A general, reusable solution to a commonly occurring design problem
A colour scheme for an app
Sign up free to see the answer and a step-by-step explanation.
Which design pattern makes sure a class has only one instance and gives a global way to reach it?
Singleton
Factory Method
Decorator
Observer
Sign up free to see the answer and a step-by-step explanation.
Which design pattern lets a method decide which concrete class to instantiate, so the caller works only with an interface?
Adapter
Factory Method
Facade
Singleton
Sign up free to see the answer and a step-by-step explanation.
Which design pattern gives a simple, unified interface to a complex set of classes?
Observer
Prototype
Facade
Strategy
Sign up free to see the answer and a step-by-step explanation.
Which design pattern builds a complex object step by step?
Iterator
Singleton
Adapter
Builder
Sign up free to see the answer and a step-by-step explanation.