Skip to content
Sharp

Project Reactor · interview question

Why is flatMap() preferred over map() for handling network calls in a reactive system?

Multiple choiceMediumchapter-19-curatedpremiumproject-reactorfunctional-pipelines-flatmap
Choose one answer
Answer and explanation

Correct answer

C. FlatMap() can handle multiple asynchronous responses.

Why

flatMap() is preferred for network calls as it can handle multiple asynchronous responses simultaneously, allowing non-blocking and efficient processing of I/O-bound operations.

Test yourself on Project Reactor

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

Start free test
All Project Reactor questions →