Introduction
Interfaces let us write flexible code that works with different types without knowing their exact details.
When you want different types to share common behavior.
When you want to write functions that accept many types.
When you want to change parts of your program easily without rewriting everything.
When you want to test your code by replacing real parts with fake ones.
When you want to design clear contracts for what types should do.