TypeScript·Advanced·Conceptual·1 min read
What is variance?
Short interview answer
Variance describes how assignability between generic instantiations follows relationships between their type arguments. Producers tend toward covariance and consumers toward contravariance under sound checking.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.