Skip to content
Sharp

Project Reactor · interview question

Why does the difference between map() and flatMap() in the context of a Mono matter in practice?

Multiple choiceMediumchapter-19-curatedpremiumproject-reactorproject-reactor-mono
Choose one answer
Answer and explanation

Correct answer

C. Map() transforms the item, while flatMap() can return a new Mono.

Why

The map() function is used to transform the item within the same Mono, while flatMap() can transform the item into a new Mono, allowing for further asynchronous operations on the result.

Test yourself on Project Reactor

A free test with instant, explained results. No account needed.

Start free test
All Project Reactor questions →