A Non-Obvious Variance Question You Might Encounter in a Scala Developer Interview
Briefly

Variance is a property of types in Scala that controls how subtypes and supertypes relate in generics, ensuring type safety across containers.
Covariance allows for safe substitution of container types, where a container of a subtype can be used as a container of its supertype.
Contravariance enables containers of a supertype to be utilized as containers of a subtype, offering flexibility in how types can be processed.
Invariance prevents any type substitution between containers, even with an inheritance relationship, ensuring strict type safety.
Read at Medium
[
|
]