Skip to content
Sharp

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)

  1. Why is it important to avoid blocking operations on the Event Loop in a Reactive Streams application?Multiple choiceHard
  2. Which backpressure choice is usually most acceptable for a live price-ticker UI that only needs the newest value?Multiple choiceMedium
  3. Why can using onBackpressureDrop in a high-throughput system become a problem in production code?Multiple choiceHard
  4. In Reactive Streams, what does a Publisher do?Multiple choiceEasy
  5. How does Project Reactor's Flux handle backpressure by default?Multiple choiceHard
  6. How would you explain a key benefit of applying backpressure in a Reactive Streams system in an interview?Multiple choiceEasy
  7. 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
  8. In a non-blocking system using Reactive Streams, why is blocking the event loop a concern?Multiple choiceEasy
  9. Which of the following scenarios is best suited for using the request(n) mechanism in Reactive Streams?Multiple choiceHard
  10. Why does backpressure in Reactive Streams matter in practice?Multiple choiceEasy
  11. In Reactive Streams, what happens if a Subscriber requests more data than it can process?Multiple choiceMedium
  12. In Reactive Streams, which component is responsible for handling backpressure signaling?Multiple choiceEasy
  13. In which scenario is using Mono preferred over Flux in Project Reactor?Multiple choiceHard
  14. Why is dropping order-confirmation events usually a bad backpressure strategy?Multiple choiceEasy
  15. In the context of Reactive Streams, what does 'non-blocking' mean?Multiple choiceEasy
  16. Why is it essential to avoid legacy JDBC in a reactive WebFlux application?Multiple choiceEasy
  17. What would be the effect of calling request(Long.MAX_VALUE) on a Subscription?Multiple choiceMedium
  18. Why does a Subscriber in the Reactive Streams specification matter in this design?Multiple choiceMedium
  19. How would you explain a key difference between WebFlux and virtual threads for handling concurrency in an interview?Multiple choiceMedium
  20. Which method in a Subscriber handles the completion signal from a Publisher?Multiple choiceMedium
  21. How do Virtual Threads in Project Loom aim to simplify concurrent programming compared to WebFlux?Multiple choiceHard
  22. In a WebFlux application, why is it crucial to use non-blocking database drivers like R2DBC instead of traditional JDBC?Multiple choiceHard
  23. In the context of Reactive Streams, what is the role of a Publisher?Multiple choiceEasy
  24. What issue arises when a blocking database call is executed within a non-blocking event loop in WebFlux?Multiple choiceMedium
  25. Which scenario best illustrates a potential pitfall of using WebFlux in an e-commerce application?Multiple choiceHard
  26. What does the 'flatMap' method in Project Reactor help achieve that 'map' does not?Multiple choiceMedium
  27. How does flatMap differ from map in reactive streams?Multiple choiceMedium
  28. Why do teams use WebFlux over traditional Spring MVC in a high-concurrency environment in production code?Multiple choiceEasy
  29. How does backpressure control the data flow in Reactive Streams?Multiple choiceMedium
  30. How would you explain a critical consequence of using a blocking call, like Thread.sleep(), inside a WebFlux handler in an interview?Multiple choiceMedium
  31. 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
  32. How would you explain a potential consequence of not implementing proper backpressure in a reactive stream in an interview?Multiple choiceHard
  33. Why can using a functional pipeline in a reactive stream become a problem in production code?Multiple choiceHard
  34. In Project Reactor, what is the primary difference between Mono and Flux?Multiple choiceMedium
  35. What role does the 'Subscriber' interface play in the Reactive Streams Specification?Multiple choiceHard
  36. What role does the 'Subscriber' play in the Reactive Streams specification?Multiple choiceMedium
  37. In a WebFlux application, how can you ensure that a database query does not block the event loop?Multiple choiceHard
  38. How does Spring WebFlux's use of a non-blocking event loop increase scalability over a traditional thread-per-request model?Multiple choiceHard
  39. In a WebFlux application, what is the impact of a non-blocking event loop on scalability?Multiple choiceHard
  40. Which operator is the safer default when order must be preserved across asynchronous work?Multiple choiceMedium
  41. How does the flatMap operator differ from map in Project Reactor's Flux?Multiple choiceMedium
  42. Which statement correctly describes the role of backpressure in Reactive Streams?Multiple choiceMedium
  43. In the context of Reactive Streams, how does backpressure help manage the flow of data?Multiple choiceHard
  44. In Project Reactor, which class would you use to represent a single, possibly asynchronous, result?Multiple choiceEasy
  45. Which component in the Reactive Streams specification is responsible for emitting data?Multiple choiceEasy
  46. In WebFlux, what is the effect of calling 'subscribe()' on a Mono or Flux?Multiple choiceMedium
  47. Why do teams use a non-blocking event loop in a reactive web application in production code?Multiple choiceEasy
  48. In a reactive application using WebFlux, what is the primary advantage of using non-blocking database drivers like R2DBC?Multiple choiceEasy
  49. In what scenario might blocking the event loop in a WebFlux application lead to performance degradation?Multiple choiceHard
  50. Why does the difference between a Flux and a Mono in Project Reactor matter in practice?Multiple choiceMedium