Collection based Kotlin interview questions and answers
What is the difference between List and Array types? What is the difference between List and Array types? Mid Answer The major difference from usage side is that Arrays have a fixed size while (Mutable)List can adjust their size dynamically. Moreover Array is mutable whereas List is not. Furthermore kotlin.collections.List is an interface implemented among others by java.util.ArrayList . It's also extended by kotlin.collections.MutableList to be used when a collections that allows for item modification is needed. On the jvm level Array is represented by arrays. List on the other hand is represented by java.util.List since there are no immutable collections equivalents available in Java. What is basic difference between fold and reduce in Kotlin? When to use which? What is basic difference between fold and reduce in Kotlin? When to use which? Junior Answer fold takes an...