What is the difference between an abstract class and an interface in LLD?
Fast recall
Quick revision
Core answer
Understanding of when to use inheritance versus interface contracts in object-oriented design — a core LLD decision point.
Using abstract classes everywhere or not knowing Java 8+ allows default methods in interfaces, blurring the distinction.
Mention that Java allows multiple interfaces but only single inheritance, so interfaces are preferred for flexibility.
Interview-ready guide
Interview answer
Both an abstract class and an interface define a contract, but they answer different questions, and that's how I decide between them. An abstract class models an is-a relationship and lets subtypes share both state and code. So Vehicle as an abstract class can hold common fields like the license plate and a concrete start method that every vehicle reuses, plus an abstract method like requiredSize that each subclass must define. The key thing is it carries implementation and instance state.
An interface is a pure capability — a can-do. Something like Parkable or Comparable says any class that implements me can do this thing, and those classes don't have to be related at all. A Car and a Bicycle might both be Parkable without sharing a base class. Interfaces hold no instance state; even with Java 8 default methods, which let you add behaviour, there are still no instance fields.
So my rule of thumb is simple: use an abstract class when your subtypes genuinely share implementation and you want to avoid duplicating it, and use an interface when otherwise-unrelated classes need to share a capability. And because Java only allows extending one class but implementing many interfaces, you often combine them — a Car extends the Vehicle abstract class for shared code and implements Parkable and maybe Insurable for orthogonal capabilities. Reaching for an interface when there's real shared code just leads to copy-pasted logic across every implementation.
What is the difference between an abstract class and an interface in LLD
Direct Answer
Abstract class provides partial implementation with fields and concrete methods for IS-A relationships with shared code (Vehicle with common fields). Interface is a pure contract with no state for CAN-DO relationships (Payable, Parkable). Use interface for type hierarchy, abstract class for shared implementation.
Common Mistakes & Pitfalls
Using abstract classes everywhere or not knowing Java 8+ allows default methods in interfaces, blurring the distinction.
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.