What is "interface pollution" and which principle prevents it?

Answer

Interface pollution occurs when a single interface accumulates too many methods, forcing implementors to provide methods that are irrelevant to their actual role. This happens when interfaces grow over time without discipline, often because developers keep adding methods to a convenient existing interface. For example, an Animal interface that starts with eat() and breathe() and gradually gains fly(), swim(), and burrow() becomes polluted — most animals implement only a subset of these behaviors but are forced to provide empty or exception-throwing implementations for the rest. ISP directly prevents interface pollution by mandating that interfaces be client-specific. The solution is to split the fat interface into Flyable, Swimmable, and Burrowable interfaces that animals selectively implement.