Kotlin Interview Questions for Generics

1. What are generics in Kotlin, and why are they important?

2. What is variance in Kotlin generics, and how does it improve type safety?

3. What is the difference between `reified` and non-reified type parameters in Kotlin?

4. What is the `where` keyword in Kotlin generics, and how is it used?

5. How do Kotlin’s generic functions differ from generic classes?

6. How does Kotlin handle generic type erasure, and what are the implications?

7. What are star projections (`*`) in Kotlin generics, and when are they used?

8. What are bounded type parameters in Kotlin generics?

9. What are generic type aliases in Kotlin, and how do they simplify complex generics?

10. What are generic type constraints, and how do they work with interfaces?

11. What is the difference between `List<T>` and `List<out T>` in Kotlin?

12. How do generics work with inline functions in Kotlin?

13. What is the purpose of generic constraints on class declarations in Kotlin?

14. What are the limitations of generics in Kotlin?

15. How does Kotlin handle multiple constraints on generic types?