The Kotlin standard library is your daily toolkit: scope functions (let, run, apply, also, with), collections, strings, and timing helpers—often more expressive than hand-rolled Java utilities.
Scope functions
let— transform nullable or pass result:user?.let { send(it) }apply— configure receiver, return receiveralso— side effect, return receiverrun/with— block with receiver or context object
Collections and strings
groupBy, associateBy, partition, chunked, and buildString replace many manual loops—read stdlib docs when tempted to write ten-line loops.
Important interview questions and answers
- Q: let vs apply?
A:letpasses receiver asitand returns lambda result;applyreturns the receiver after configuration. - Q: takeIf / takeUnless?
A: Return the receiver or null based on a predicate—pairs well with Elvis and safe calls.
Self-check
- Which scope function returns the receiver after setup?
- Name one collection grouping function.
Tip: also for side effects, apply for configuration—read stdlib docs for scope function cheat sheet.
Interview prep
- let vs apply?
let passes receiver as it; apply returns configured receiver.
- require vs check?
require for arguments; check for internal invariants.