tezvyn:

Explain higher-order functions and implement filterAndTransform

Source: kotlinlang.orgintermediate

Tests whether you can define higher-order functions and use lambdas idiomatically in Kotlin. A strong answer defines HOFs as functions that take or return functions, then implements filterAndTransform with filter and map.

Tests fluency with Kotlin higher-order functions, function types, and lambda syntax. A strong answer defines a higher-order function as one that accepts or returns other functions, writes filterAndTransform by chaining list.filter(predicate).map(transform), and notes that Kotlin functions are first-class values with inferred lambda types. Red flag: using explicit for-loops and mutable lists instead of idiomatic filter/map, or failing to explain why the function is higher-order.

Read the original → kotlinlang.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Explain higher-order functions and implement filterAndTransform · Tezvyn