Interview Q&A / Object-Oriented Programming

IntermediateQuick answer1 min readUpdated 3 Oct 2026

How is the Interface Segregation Principle different from the Single Responsibility Principle?

SHORT ANSWER

SRP is about a class having one reason to change. ISP is about the interface a client sees: it should be small and fit that client's needs. One is about implementation, the other about the contract.

Explain it simply

A multi-function printer can be one well-built machine (it has a single job: producing paper output from your files). But a student who only wants to print should see a "Print" button, not scan, fax and staple. The machine's internal organisation is the SRP question; what each person sees on screen is the ISP question.

A class may well implement several small interfaces, each used by a different client.

Example

java
interface Printer { void print(Doc d); }
interface Scanner { Doc scan(); }

class AllInOne implements Printer, Scanner {     // one class, two narrow contracts
    public void print(Doc d) { ... }
    public Doc scan() { ... }
}

void submitAssignment(Printer p, Doc d) {        // sees only print()
    p.print(d);
}

submitAssignment can be tested with a trivial fake Printer and does not break if Scanner changes.

What to say in the interview

"SRP limits why a class changes; ISP limits what a client has to know about it. A class can implement several narrow interfaces, and each client depends only on the one it needs. They work together but are not the same."

Common mistakes

  • Treating ISP as a rule about class size.

#solid#isp#srp

Related questions

Practise more Object-Oriented Programming questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Object-Oriented Programming quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.