I started with the easy stuff, what each can hold.
Start by defining both concepts clearly, then compare them across key dimensions like inheritance, state, and method implementation. Finally, explain when to use each based on design goals such as code reuse, contract definition, and multiple inheritance.
Pro tip: Mention that modern languages like Java 8+ and C# have blurred the lines with default methods, but the core distinction remains: interfaces define capabilities, abstract classes define identity. Also, relate your choice to real-world scenarios like API design or framework development.
Briefly explain that an interface is a contract with no state (traditionally) and an abstract class is a partial implementation that can have state and behavior.
Highlight differences in inheritance (multiple vs single), state (fields), constructors, and method access modifiers.
Mention that some languages (e.g., Java 8+, C#) allow default methods in interfaces, but abstract classes still support state and constructors.
Use interfaces to define a role or capability that multiple unrelated classes can implement; use abstract classes to share code among closely related classes.
Give a real-world example, such as using an interface for a 'Comparable' contract and an abstract class for a 'Vehicle' base class.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.