Skip to content
Sharp

Project Reactor · interview question

In Project Reactor, what is the main purpose of the flatMap() operator in a Flux?

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

Correct answer

D. To transform each element into a Publisher and flatten the result

Why

The flatMap() operator transforms each element into a Publisher and then flattens the emitted items into a single Flux. It is used for asynchronous operations that return a Flux or Mono.

Test yourself on Project Reactor

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

Start free test
All Project Reactor questions →