Kotlin Collections Interview Questions

1. What are the main types of collections in Kotlin, and how do they differ?

2. How do `filter`, `map`, and `reduce` operations work in Kotlin collections?

3. What is the difference between `forEach` and `map` in Kotlin collections?

4. How does `groupBy` work in Kotlin collections?

5. What is the difference between `flatMap` and `map` in Kotlin?

6. How does the `partition` function work in Kotlin collections?

7. What is the purpose of the `associate` and `associateBy` functions in Kotlin?

8. What is the difference between `toList` and `toMutableList` in Kotlin?

9. What is the difference between `setOf`, `mutableSetOf`, and `hashSetOf` in Kotlin?

10. How does the `zip` function work in Kotlin collections?

11. What is the purpose of `sortedBy` and `sortedWith` in Kotlin?

12. How do `take` and `drop` functions work in Kotlin collections?