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)
- Why does the Publisher in the Reactive Streams Specification matter in this design?Multiple choiceMedium
- What happens if a Publisher emits more data than a Subscriber has requested in a Reactive Streams implementation?Multiple choiceHard
- Why do teams use functional pipelines in Project Reactor in production code?Multiple choiceMedium
- What is backpressure in the context of Reactive Streams?Multiple choiceEasy
- How does the 'request(n)' method in Reactive Streams help manage backpressure?Multiple choiceMedium
- When using Project Reactor, which method would you use to transform items in a Flux?Multiple choiceMedium
- When transitioning from Spring MVC to WebFlux, what is a key consideration regarding existing blocking database calls?Multiple choiceHard
- In Project Reactor, what is a potential risk when using flatMap() in a reactive pipeline?Multiple choiceHard
- In Reactive Streams, which method is used by the Publisher to signal the completion of data emission to the Subscriber?Multiple choiceEasy
- How does the 'flatMap' method in Project Reactor differ from 'map' in terms of handling asynchronous operations?Multiple choiceMedium
- When transitioning an e-commerce server from Spring MVC to WebFlux, what must be avoided to prevent server bottlenecks?Multiple choiceHard
- In a reactive system, what is the role of the 'Publisher' in the Reactive Streams specification?Multiple choiceMedium
- How would you explain a key advantage of using functional pipelines such as map() and flatMap() in reactive programming in an interview?Multiple choiceMedium
- Why do teams use non-blocking event loops in reactive programming in production code?Multiple choiceEasy
- In the context of Reactive Streams, what does 'Backpressure' refer to?Multiple choiceMedium
- In the context of reactive programming, what does backpressure solve?Multiple choiceMedium
- What important behavior can flatMap() introduce into a Reactor pipeline?Multiple choiceMedium
- What does the method subscribe() do in the context of a reactive stream?Multiple choiceEasy
- When using Project Reactor, how does the 'map' operator differ from 'flatMap'?Multiple choiceMedium
- How does a Subscriber signal its demand for data in a Reactive Streams system?Multiple choiceMedium
- Which of the following describes a Mono in Project Reactor?Multiple choiceEasy
- In the Reactive Streams API, what does the onError() method do?Multiple choiceEasy
- How does the 'Flux' type in Project Reactor differ from 'Mono'?Multiple choiceMedium
- In a non-blocking architecture using Reactive Streams, what happens when a Subscriber requests more data than the Publisher can handle?Multiple choiceMedium
- In a reactive application using WebFlux, what is the primary risk of calling Thread.sleep() inside the event loop?Multiple choiceEasy
- How does WebFlux differ from Virtual Threads in handling concurrency?Multiple choiceHard
- What does the request(n) method in the Subscriber interface indicate?Multiple choiceEasy
- In a reactive system, what is the impact of blocking an asynchronous call?Multiple choiceMedium
- 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
- 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
- Which of the following best describes the lazy nature of a reactive stream?Multiple choiceMedium
- What potential issue arises from blocking operations within a WebFlux event loop?Multiple choiceHard
- Why is it dangerous to block an event loop when using a non-blocking framework like WebFlux?Multiple choiceHard
- How would you explain a key characteristic of a non-blocking I/O operation in a reactive system in an interview?Multiple choiceEasy
- In a reactive system using Spring WebFlux, how is the HTTP request handling different from a traditional server model?Multiple choiceEasy
- For an internal CRUD service that mostly calls blocking libraries, which choice is often the simpler scalable default in modern Java?Multiple choiceHard
- When is Spring WebFlux usually a better fit than plain blocking code on virtual threads?Multiple choiceEasy
- In a Reactive Streams setup, which component is responsible for invoking the request(n) method?Multiple choiceMedium
- What type of transformation does flatMap() provide in a reactive stream?Multiple choiceMedium
- Why is it important for a reactive system to decouple the HTTP connection from the execution thread?Multiple choiceMedium
- Which method in Project Reactor can transform a stream of data items into another stream?Multiple choiceMedium
- Which of the following is a valid approach to handle backpressure in Project Reactor?Multiple choiceMedium
- In a WebFlux application, what is a potential consequence of blocking the event loop with a synchronous operation?Multiple choiceHard
- What does a Publisher in the Reactive Streams specification mainly do?Multiple choiceEasy
- How do WebFlux and Virtual Threads differ in handling concurrency for a high-load e-commerce server?Multiple choiceHard
- Which Project Reactor operator would you use to transform elements within a stream without altering the sequence flow?Multiple choiceMedium
- How would you explain the danger of blocking the event loop in a Reactive Streams application in an interview?Multiple choiceHard
- Which method in Project Reactor's Flux can be used to handle scenarios where the Subscriber is slower than the Publisher?Multiple choiceMedium
- How does WebFlux differ from Virtual Threads in terms of handling blocking I/O operations?Multiple choiceEasy
- How does Spring WebFlux ensure efficient use of CPU resources?Multiple choiceMedium