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 2 of 3)

  1. Why does the Publisher in the Reactive Streams Specification matter in this design?Multiple choiceMedium
  2. What happens if a Publisher emits more data than a Subscriber has requested in a Reactive Streams implementation?Multiple choiceHard
  3. Why do teams use functional pipelines in Project Reactor in production code?Multiple choiceMedium
  4. What is backpressure in the context of Reactive Streams?Multiple choiceEasy
  5. How does the 'request(n)' method in Reactive Streams help manage backpressure?Multiple choiceMedium
  6. When using Project Reactor, which method would you use to transform items in a Flux?Multiple choiceMedium
  7. When transitioning from Spring MVC to WebFlux, what is a key consideration regarding existing blocking database calls?Multiple choiceHard
  8. In Project Reactor, what is a potential risk when using flatMap() in a reactive pipeline?Multiple choiceHard
  9. In Reactive Streams, which method is used by the Publisher to signal the completion of data emission to the Subscriber?Multiple choiceEasy
  10. How does the 'flatMap' method in Project Reactor differ from 'map' in terms of handling asynchronous operations?Multiple choiceMedium
  11. When transitioning an e-commerce server from Spring MVC to WebFlux, what must be avoided to prevent server bottlenecks?Multiple choiceHard
  12. In a reactive system, what is the role of the 'Publisher' in the Reactive Streams specification?Multiple choiceMedium
  13. How would you explain a key advantage of using functional pipelines such as map() and flatMap() in reactive programming in an interview?Multiple choiceMedium
  14. Why do teams use non-blocking event loops in reactive programming in production code?Multiple choiceEasy
  15. In the context of Reactive Streams, what does 'Backpressure' refer to?Multiple choiceMedium
  16. In the context of reactive programming, what does backpressure solve?Multiple choiceMedium
  17. What important behavior can flatMap() introduce into a Reactor pipeline?Multiple choiceMedium
  18. What does the method subscribe() do in the context of a reactive stream?Multiple choiceEasy
  19. When using Project Reactor, how does the 'map' operator differ from 'flatMap'?Multiple choiceMedium
  20. How does a Subscriber signal its demand for data in a Reactive Streams system?Multiple choiceMedium
  21. Which of the following describes a Mono in Project Reactor?Multiple choiceEasy
  22. In the Reactive Streams API, what does the onError() method do?Multiple choiceEasy
  23. How does the 'Flux' type in Project Reactor differ from 'Mono'?Multiple choiceMedium
  24. In a non-blocking architecture using Reactive Streams, what happens when a Subscriber requests more data than the Publisher can handle?Multiple choiceMedium
  25. In a reactive application using WebFlux, what is the primary risk of calling Thread.sleep() inside the event loop?Multiple choiceEasy
  26. How does WebFlux differ from Virtual Threads in handling concurrency?Multiple choiceHard
  27. What does the request(n) method in the Subscriber interface indicate?Multiple choiceEasy
  28. In a reactive system, what is the impact of blocking an asynchronous call?Multiple choiceMedium
  29. How would you explain a key advantage of using Virtual Threads over WebFlux when transitioning an application to support high concurrency in an interview?Multiple choiceMedium
  30. In the context of Reactive Streams, why is it important for a Publisher to adhere to the rule of signaling onComplete() or onError() only once?Multiple choiceMedium
  31. Which of the following best describes the lazy nature of a reactive stream?Multiple choiceMedium
  32. What potential issue arises from blocking operations within a WebFlux event loop?Multiple choiceHard
  33. Why is it dangerous to block an event loop when using a non-blocking framework like WebFlux?Multiple choiceHard
  34. How would you explain a key characteristic of a non-blocking I/O operation in a reactive system in an interview?Multiple choiceEasy
  35. In a reactive system using Spring WebFlux, how is the HTTP request handling different from a traditional server model?Multiple choiceEasy
  36. For an internal CRUD service that mostly calls blocking libraries, which choice is often the simpler scalable default in modern Java?Multiple choiceHard
  37. When is Spring WebFlux usually a better fit than plain blocking code on virtual threads?Multiple choiceEasy
  38. In a Reactive Streams setup, which component is responsible for invoking the request(n) method?Multiple choiceMedium
  39. What type of transformation does flatMap() provide in a reactive stream?Multiple choiceMedium
  40. Why is it important for a reactive system to decouple the HTTP connection from the execution thread?Multiple choiceMedium
  41. Which method in Project Reactor can transform a stream of data items into another stream?Multiple choiceMedium
  42. Which of the following is a valid approach to handle backpressure in Project Reactor?Multiple choiceMedium
  43. In a WebFlux application, what is a potential consequence of blocking the event loop with a synchronous operation?Multiple choiceHard
  44. What does a Publisher in the Reactive Streams specification mainly do?Multiple choiceEasy
  45. How do WebFlux and Virtual Threads differ in handling concurrency for a high-load e-commerce server?Multiple choiceHard
  46. Which Project Reactor operator would you use to transform elements within a stream without altering the sequence flow?Multiple choiceMedium
  47. How would you explain the danger of blocking the event loop in a Reactive Streams application in an interview?Multiple choiceHard
  48. Which method in Project Reactor's Flux can be used to handle scenarios where the Subscriber is slower than the Publisher?Multiple choiceMedium
  49. How does WebFlux differ from Virtual Threads in terms of handling blocking I/O operations?Multiple choiceEasy
  50. How does Spring WebFlux ensure efficient use of CPU resources?Multiple choiceMedium