Kotlin & Coroutines (50 Qs)•Part 3: K2 Compiler, KMP, Advanced Metaprogramming & Optimization (25 - 35)
Scope Functions Matrix: `let`, `run`, `with`, `apply`, `also`.
senior LevelPerformance
In Simple Words:
| Function | Context Object | Return Value | Primary Use Case |
|---|---|---|---|
let | it | Lambda result | Null-check safety (user?.let { ... }) and transformation |
run | this | Lambda result | Object configuration and computing a result |
with | this | Lambda result | Grouping multiple method calls on a non-null object |
apply | this | Context object | Object initialization (configuring builders/views) |
also | it | Context object | Additional side effects (logging, debugging intermediate steps) |