Skip to content
Sharp

Reactive Streams · interview question

In a reactive application using WebFlux, what is the primary risk of calling Thread.sleep() inside the event loop?

Multiple choiceEasychapter-19-curatedpremiumreactive-streamsblocking-the-event-loop
Choose one answer
Answer and explanation

Correct answer

C. It blocks the event loop, causing latency and potential server crashes.

Why

Calling Thread.sleep() blocks the current thread, which is harmful in a non-blocking architecture like WebFlux. It can cause the event loop to stall, leading to increased latency and potentially crashing the server.

Test yourself on Reactive Streams

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

Start free test
All Reactive Streams questions →