78 questions for “Interfaces & Abstract Classes”

Found in 1 field. Select a question to see its full answer.

Information Technology

78 questions in 4 technologies

#QuestionTechnologyTopicLevel
1Can an interface extend multiple other interfaces simultaneously, and how does this differ from a class's single-inheritance restriction for abstract/concrete classes? Java › Interfaces & Abstract ClassesJavaInterfaces & Abstract ClassesIntermediate
2How does the Liskov Substitution Principle relate to properly designing interfaces and abstract classes so that subclasses can genuinely be substituted for their parent type without breaking expected behavior? PHP › Interfaces & Abstract ClassesPHPInterfaces & Abstract ClassesAdvanced
3How would you use an abstract class to implement the Template Method pattern, defining a fixed algorithm skeleton with some steps left abstract for subclasses to fill in? Java › Interfaces & Abstract ClassesJavaInterfaces & Abstract ClassesIntermediate
4How do you decide whether to use an interface or an abstract class when designing a set of related classes that share common behavior? PHP › Interfaces & Abstract ClassesPHPInterfaces & Abstract ClassesIntermediate
5How does PHP's type system use interfaces to enable polymorphism, allowing different concrete classes to be used interchangeably wherever the interface type is expected? PHP › Interfaces & Abstract ClassesPHPInterfaces & Abstract ClassesIntermediate
6How would you design a class hierarchy combining an abstract base class WITH multiple interfaces to model both shared implementation AND multiple independent capabilities? C# › Interfaces & Abstract ClassesC#Interfaces & Abstract ClassesAdvanced
7How does the 'sealed' modifier interact with abstract classes and interface method overrides to control further extensibility? C# › Interfaces & Abstract ClassesC#Interfaces & Abstract ClassesAdvanced
8How would you use an abstract class combined with the Non-Virtual Interface (NVI) idiom to enforce that certain methods are always called in a specific pattern, even when subclasses override customizable parts? Java › Interfaces & Abstract ClassesJavaInterfaces & Abstract ClassesAdvanced
9How can PHP's interface based type hinting combined with abstract classes support building a genuinely extensible plugin architecture within an application? PHP › Interfaces & Abstract ClassesPHPInterfaces & Abstract ClassesAdvanced
10What is the difference between an interface and an abstract class in C#, and when should you choose one over the other? C# › Interfaces & Abstract ClassesC#Interfaces & Abstract ClassesBeginner