Null safety, coroutines, data classes and Kotlin idioms on the JVM and Android.
A support dashboard shows which words customers use most in their
tickets. Write wordFrequencies(text: String): Map<String, Int>.
Rules:
A quiz app shows a leaderboard. Write
topScorers(scores: Map<String, Int>, n: Int): List<String> that returns
the names of the n players with the highest scores.
A fitness tracker smooths heart-rate samples with a moving average.
Write movingAverage(values: List<Int>, window: Int): List<Double>.
Rules:
A spelling contest stores names and scores in two parallel lists.
Write bestScores(names: List<String>, scores: List<Int>): Map<String, Int>
that pairs them up by position and returns each name's best score.
In Kotlin, what is the difference between List<T> and MutableList<T>?
If a function returns List<String>, does that guarantee nobody can
ever change the list's contents?
You have val users: List<User> where User has id and country.
What do users.associateBy { it.id } and users.groupBy { it.country }
return, and what happens with duplicate keys in each case?