Skip to content
Sharp

Reactive Streams · interview question

What does the 'flatMap' method in Project Reactor help achieve that 'map' does not?

Multiple choiceMediumchapter-19-curatedpremiumreactive-streamswebflux-vs-virtual-threads
Choose one answer
Answer and explanation

Correct answer

D. It allows asynchronous transformations that return a Publisher.

Why

The 'flatMap' method is used for asynchronous transformations where each element is transformed into a Publisher, which is then flattened into a single stream, allowing for complex asynchronous operations.

Test yourself on Reactive Streams

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

Start free test
All Reactive Streams questions →