Reactive Streams interview questions
Backpressure Strategies, Blocking the Event Loop, Functional Pipelines (flatMap), Non-Blocking I/O (Event Loops), Publisher and Subscriber, Thread-Per-Request Bottleneck
120 questions with answers and explanations · 120 flashcards
Questions (page 1 of 3)
- Why is it important to avoid blocking operations on the Event Loop in a Reactive Streams application?Multiple choiceHard
- Which backpressure choice is usually most acceptable for a live price-ticker UI that only needs the newest value?Multiple choiceMedium
- Why can using onBackpressureDrop in a high-throughput system become a problem in production code?Multiple choiceHard
- In Reactive Streams, what does a Publisher do?Multiple choiceEasy
- How does Project Reactor's Flux handle backpressure by default?Multiple choiceHard
- How would you explain a key benefit of applying backpressure in a Reactive Streams system in an interview?Multiple choiceEasy
- When using Project Reactor's Flux, which method can be used to handle a scenario where data production exceeds the subscriber's consumption rate?Multiple choiceHard
- In a non-blocking system using Reactive Streams, why is blocking the event loop a concern?Multiple choiceEasy
- Which of the following scenarios is best suited for using the request(n) mechanism in Reactive Streams?Multiple choiceHard
- Why does backpressure in Reactive Streams matter in practice?Multiple choiceEasy
- In Reactive Streams, what happens if a Subscriber requests more data than it can process?Multiple choiceMedium
- In Reactive Streams, which component is responsible for handling backpressure signaling?Multiple choiceEasy
- In which scenario is using Mono preferred over Flux in Project Reactor?Multiple choiceHard
- Why is dropping order-confirmation events usually a bad backpressure strategy?Multiple choiceEasy
- In the context of Reactive Streams, what does 'non-blocking' mean?Multiple choiceEasy
- Why is it essential to avoid legacy JDBC in a reactive WebFlux application?Multiple choiceEasy
- What would be the effect of calling request(Long.MAX_VALUE) on a Subscription?Multiple choiceMedium
- Why does a Subscriber in the Reactive Streams specification matter in this design?Multiple choiceMedium
- How would you explain a key difference between WebFlux and virtual threads for handling concurrency in an interview?Multiple choiceMedium
- Which method in a Subscriber handles the completion signal from a Publisher?Multiple choiceMedium
- How do Virtual Threads in Project Loom aim to simplify concurrent programming compared to WebFlux?Multiple choiceHard
- In a WebFlux application, why is it crucial to use non-blocking database drivers like R2DBC instead of traditional JDBC?Multiple choiceHard
- In the context of Reactive Streams, what is the role of a Publisher?Multiple choiceEasy
- What issue arises when a blocking database call is executed within a non-blocking event loop in WebFlux?Multiple choiceMedium
- Which scenario best illustrates a potential pitfall of using WebFlux in an e-commerce application?Multiple choiceHard
- What does the 'flatMap' method in Project Reactor help achieve that 'map' does not?Multiple choiceMedium
- How does flatMap differ from map in reactive streams?Multiple choiceMedium
- Why do teams use WebFlux over traditional Spring MVC in a high-concurrency environment in production code?Multiple choiceEasy
- How does backpressure control the data flow in Reactive Streams?Multiple choiceMedium
- How would you explain a critical consequence of using a blocking call, like Thread.sleep(), inside a WebFlux handler in an interview?Multiple choiceMedium
- In the context of Reactive Streams, what is the primary advantage of using a non-blocking event loop over a thread-per-request model?Multiple choiceEasy
- How would you explain a potential consequence of not implementing proper backpressure in a reactive stream in an interview?Multiple choiceHard
- Why can using a functional pipeline in a reactive stream become a problem in production code?Multiple choiceHard
- In Project Reactor, what is the primary difference between Mono and Flux?Multiple choiceMedium
- What role does the 'Subscriber' interface play in the Reactive Streams Specification?Multiple choiceHard
- What role does the 'Subscriber' play in the Reactive Streams specification?Multiple choiceMedium
- In a WebFlux application, how can you ensure that a database query does not block the event loop?Multiple choiceHard
- How does Spring WebFlux's use of a non-blocking event loop increase scalability over a traditional thread-per-request model?Multiple choiceHard
- In a WebFlux application, what is the impact of a non-blocking event loop on scalability?Multiple choiceHard
- Which operator is the safer default when order must be preserved across asynchronous work?Multiple choiceMedium
- How does the flatMap operator differ from map in Project Reactor's Flux?Multiple choiceMedium
- Which statement correctly describes the role of backpressure in Reactive Streams?Multiple choiceMedium
- In the context of Reactive Streams, how does backpressure help manage the flow of data?Multiple choiceHard
- In Project Reactor, which class would you use to represent a single, possibly asynchronous, result?Multiple choiceEasy
- Which component in the Reactive Streams specification is responsible for emitting data?Multiple choiceEasy
- In WebFlux, what is the effect of calling 'subscribe()' on a Mono or Flux?Multiple choiceMedium
- Why do teams use a non-blocking event loop in a reactive web application in production code?Multiple choiceEasy
- In a reactive application using WebFlux, what is the primary advantage of using non-blocking database drivers like R2DBC?Multiple choiceEasy
- In what scenario might blocking the event loop in a WebFlux application lead to performance degradation?Multiple choiceHard
- Why does the difference between a Flux and a Mono in Project Reactor matter in practice?Multiple choiceMedium