Java / Quarkus Interview questions
What is the difference between imperative and reactive programming in Quarkus?
Quarkus deliberately supports both styles under one roof, and the choice affects how a method handles waiting on I/O — a database call, an HTTP call to another service — while a request is being processed.
| Imperative | Reactive |
| Method returns a plain value; execution blocks the calling thread while waiting. | Method returns Uni/Multi; execution doesn't block the calling thread while waiting. |
| Runs on a worker thread pool, one thread tied up per in-flight request. | Runs on Vert.x's event loop, one thread handling many concurrent requests. |
| Simpler to read and debug; familiar to most Java developers. | More scalable under high I/O-bound concurrency; steeper learning curve. |
| Good default for CPU-bound or straightforward CRUD logic. | Good for high-throughput, I/O-heavy services like gateways or streaming. |
Because both styles are first-class in Quarkus, a single application commonly mixes them — a simple internal admin endpoint written imperatively for readability, alongside a high-traffic public API written reactively for throughput — without needing two separate frameworks or runtimes.
More Related questions...