map, flatMap, combineLatest — what do they do?
The essence
map— synchronously transforms every value:Publisher<A>→Publisher<B>. Adds no errors; for a throwing transform there istryMap.flatMap— for every value creates a new Publisher and merges their outputs into one stream (e.g. id → network request). The inner publishers run in parallel;maxPublishers:limits their number. An error from any inner publisher terminates the whole stream — handle it inside (catch,replaceError).combineLatest— joins several publishers: on every new value from any of them it emits a tuple of the latest values of all. It emits nothing until every source has produced at least one value. Typical for form validation (email + password → button enabled).
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep