Project Reactor interview questions
Functional Pipelines (flatMap), Project Reactor: Flux, Project Reactor: Mono
62 questions with answers and explanations · 61 flashcards
Questions (page 1 of 2)
- What does the Mono.just(T data) method do?Multiple choiceEasy
- In the context of Reactive Streams, what role does a Subscriber play?Multiple choiceEasy
- If a Mono completes empty, which of the following methods can be used to provide a default value?Multiple choiceHard
- When transitioning from Spring MVC to WebFlux, what is a key advantage concerning server performance?Multiple choiceMedium
- When using Mono<User> in a reactive system, how should you handle a database call to ensure it remains non-blocking?Multiple choiceMedium
- What does the Publisher interface in the Reactive Streams specification do?Multiple choiceEasy
- Which of the following statements about the Event Loop in a non-blocking reactive system is true?Multiple choiceHard
- What does a Mono in Project Reactor mainly do?Multiple choiceEasy
- In Project Reactor, which operator would you use to transform each element of a Flux by applying a function to it?Multiple choiceEasy
- In a Project Reactor pipeline, why would you use flatMap() instead of map() to handle a stream of product IDs that need to be fetched from a remote service?Multiple choiceMedium
- How does backpressure relate to a Mono in Project Reactor?Multiple choiceHard
- Which of the following is a common use case for using Flux in an e-commerce application?Multiple choiceEasy
- What potential issue could arise from improperly handling backpressure in a live price data Flux?Multiple choiceHard
- What role does the Publisher interface play in the Reactive Streams Specification?Multiple choiceMedium
- Which Project Reactor class would you use to handle a single asynchronous result?Multiple choiceEasy
- In Reactive Streams, how can backpressure be applied effectively to prevent overwhelming a Subscriber?Multiple choiceMedium
- Why is it important to avoid blocking the event loop in a non-blocking reactive system?Multiple choiceHard
- In Project Reactor, what is the main purpose of the flatMap() operator in a Flux?Multiple choiceMedium
- Given a Flux of Order objects in a non-blocking system, which transformation would you use to fetch and process order details asynchronously?Multiple choiceHard
- When applying backpressure in a reactive stream, which strategy can be used to control the rate at which a Subscriber processes data?Multiple choiceHard
- What does backpressure in a Flux help mitigate in a reactive system?Multiple choiceMedium
- What happens if you block the event loop in a reactive application?Multiple choiceHard
- In a reactive system, what is a potential danger of using a blocking call inside a flatMap() operation?Multiple choiceMedium
- When using Project Reactor's Flux to handle a live websocket feed, what is a key consideration?Multiple choiceMedium
- In Project Reactor, which operator would you use to transform each element of a Flux into another Flux and then flatten the results into a single Flux?Multiple choiceMedium
- How would you explain a key characteristic of a Flux in Project Reactor in an interview?Multiple choiceEasy
- In a reactive system, why is blocking the event loop considered a severe issue?Multiple choiceHard
- How can a Flux be created to simulate an infinite stream of data for testing purposes?Multiple choiceMedium
- Why does the difference between map() and flatMap() in the context of a Mono matter in practice?Multiple choiceMedium
- How does using Flux help in processing large datasets without crashing due to OutOfMemory errors?Multiple choiceMedium
- What does the subscribe() method do in a Flux?Multiple choiceEasy
- Which of the following best describes backpressure in the context of Reactive Streams?Multiple choiceMedium
- Which method should you use to convert a blocking call into a non-blocking Mono in a reactive application?Multiple choiceHard
- How would you explain the key difference between Mono and Flux in Project Reactor in an interview?Multiple choiceMedium
- In the context of Flux, what does the term 'infinite stream' imply?Multiple choiceEasy
- How does Project Reactor's Flux help avoid OutOfMemory errors when processing large datasets?Multiple choiceMedium
- How would you explain a key feature of backpressure in reactive streams in an interview?Multiple choiceMedium
- In Project Reactor, what does the flatMap() method do?Multiple choiceEasy
- When using WebFlux with Virtual Threads, what is the main advantage over traditional thread-per-request models?Multiple choiceHard
- In the context of Project Reactor, which operation would you use to ensure that each item in a Flux is processed sequentially before the next item is processed?Multiple choiceMedium
- Why is flatMap() often preferred in reactive programming for handling I/O operations?Multiple choiceEasy
- In a reactive system, why might using map() instead of flatMap() lead to a bottleneck?Multiple choiceMedium
- Why does the difference between Mono and Flux in Project Reactor matter in practice?Multiple choiceMedium
- Why is flatMap() preferred over map() for handling network calls in a reactive system?Multiple choiceMedium
- What does the Project Reactor Mono type represent in a reactive stream?Multiple choiceEasy
- In a reactive system, why should blocking the event loop be avoided?Multiple choiceMedium
- Why does blocking the Event Loop in a WebFlux application change runtime behavior?Multiple choiceHard
- Why does the subscribe() method in a Mono matter in practice?Multiple choiceEasy
- What type of object does the flatMap() method return in Project Reactor?Multiple choiceEasy
- In Project Reactor, what is a primary benefit of using flatMap() over map() when dealing with asynchronous data streams?Multiple choiceEasy