Problem Statement
Why prefer interface in some cases?
Explanation
Interfaces are easy to extend, merge, and use with classes. Use types when you need unions, intersections, or advanced mapped/conditional types.
Code Solution
SolutionRead Only
interface Animal { speak(): void }
class Dog implements Animal { speak() { /* ... */ } }