Java / Quarkus Interview questions
1. What is Quarkus?
Quarkus is an open-source Java framework built specifically for running well in containers and on Kubernetes, with a design goal of very fast startup time and low memory usage compared to traditional Java EE or Spring-style stacks. It was created by Red Hat and combines familiar Java standards &m...
2. What is the purpose of Quarkus?
Quarkus exists to solve a specific mismatch: traditional Java frameworks were designed for long-running application servers, but cloud-native workloads increasingly need to start in milliseconds, scale to zero, and use minimal memory per instance — something the JVM's traditional startup pa...
3. What are the key features of Quarkus?
Quarkus bundles together a set of features aimed squarely at cloud-native Java development, distinguishing it from older application-server-centric frameworks. Feature What it Provides Fast startup Milliseconds in native mode, well under a second in JVM mode Low memory footprint Smaller RSS per i...
4. What is GraalVM in the context of Quarkus?
GraalVM is a high-performance JDK distribution that includes a native-image tool capable of ahead-of-time (AOT) compiling a Java application into a standalone native executable, and Quarkus uses it as the engine behind its native compilation mode. Instead of the traditional JVM approach — l...
5. What is Supersonic Subatomic Java?
"Supersonic Subatomic Java" is Quarkus's own tagline for its design philosophy: supersonic referring to extremely fast startup and turnaround time, and subatomic referring to a drastically reduced memory footprint and application size compared to conventional Java frameworks. It's not a separate ...
6. What are the two runtime modes of Quarkus?
Quarkus applications can run in two distinct modes, and the choice between them is mainly a trade-off between build simplicity/portability and raw startup performance. JVM Mode Native Mode Runs as a standard executable JAR on any JVM. Compiled ahead-of-time into a platform-specific native binary ...
7. What is a native executable in Quarkus?
A native executable is a standalone binary produced by compiling a Quarkus application ahead-of-time with GraalVM's native-image tool, bundling the application code, a minimal runtime, and only the JDK classes actually reachable by that specific application into one self-contained file. Unlike a ...
8. What is Quarkus Dev Mode?
Dev Mode is a local development mode, started with quarkus:dev (or ./mvnw quarkus:dev ), that runs the application while watching your source files and automatically recompiling and redeploying changed code as soon as you save, without requiring a manual restart. ./mvnw quarkus:dev # or quarkus d...
9. What are Quarkus extensions?
Extensions are Quarkus's mechanism for adding capability — a database driver, a messaging client, security, metrics, and hundreds of other integrations — while keeping both build-time processing and native-image compatibility in mind, unlike a typical library you'd just drop onto the ...
10. How do you create a new Quarkus project?
The most common way to scaffold a new Quarkus project is through the Quarkus Maven plugin's create goal, or equivalently through the code.quarkus.io web-based project generator, both of which let you pick a group/artifact ID and a starting set of extensions. mvn io.quarkus.platform:quarkus-maven-...
11. What is the Mutiny library used for in Quarkus?
Mutiny is Quarkus's reactive programming library, providing the Uni and Multi types used to represent asynchronous operations — a single eventual result, or a stream of multiple results, respectively — as an alternative to writing blocking, thread-per-request code. Type Represents Uni...
12. What is Panache in Quarkus?
Panache is Quarkus's simplification layer on top of Hibernate (for relational data via Hibernate ORM with Panache) and MongoDB (via Hibernate Reactive/MongoDB with Panache), designed to cut down the boilerplate typically needed to write basic CRUD data-access code. Instead of writing a full repos...
13. What are the types of Panache entity patterns available?
Panache supports two different styles for structuring data access, and picking between them is mostly a matter of team preference rather than one being strictly more capable than the other. Active Record Repository Entity extends PanacheEntity; methods called directly on the entity class/instance...
14. What is CDI in Quarkus?
CDI (Contexts and Dependency Injection) is the Jakarta EE standard Quarkus uses as its core dependency-injection model, letting classes declare what they need via annotations like @Inject rather than constructing their own dependencies manually. Quarkus doesn't use the full, general-purpose CDI i...
15. What is the purpose of the @ApplicationScoped annotation?
@ApplicationScoped is a CDI scope annotation that marks a bean to be created once and shared as a single instance for the lifetime of the entire application, which is the standard choice for stateless services, repositories, and clients that don't need per-request state. @ApplicationScoped public...
16. What is RESTEasy Reactive in Quarkus?
RESTEasy Reactive is Quarkus's default JAX-RS implementation, built directly on top of the Vert.x reactive engine rather than on a traditional blocking Servlet container, letting the same annotated resource methods handle requests either in a blocking or non-blocking (reactive) style depending on...
17. Define Quarkus configuration profiles?
Configuration profiles let a single Quarkus application define different sets of configuration values for different environments — development, testing, and production — without maintaining entirely separate configuration files or code branches. %dev.quarkus.datasource.jdbc.url=jdbc:h...
18. What is application.properties used for in Quarkus?
application.properties , located under src/main/resources , is the default place Quarkus applications store configuration — datasource URLs, HTTP port, logging levels, and extension-specific settings — using simple key-value pairs rather than XML or annotations. quarkus.http.port=8080...
19. List the build tools supported by Quarkus?
Quarkus supports the two build tools most Java teams already use day to day, rather than requiring a new or proprietary build system. Maven: the most common choice, using the quarkus-maven-plugin for project scaffolding, dev mode, and native builds via profiles or plugin goals. Gradle: supported ...
20. What is a Quarkus BuildItem?
A BuildItem is the fundamental unit of data passed between build steps in Quarkus's build-time augmentation pipeline — an immutable object representing one discrete piece of information, such as "this class needs to be registered for reflection" or "this bean was discovered as a CDI candida...
21. What is the difference between Quarkus and Spring Boot?
Both are popular frameworks for building Java microservices, but they differ fundamentally in when the bulk of application wiring happens and what that means for startup performance and native-image compatibility. Quarkus Spring Boot Most wiring (DI graph, annotation scanning) resolved at build t...
22. Why does Quarkus have faster startup time than traditional Java frameworks?
Quarkus's startup speed advantage comes from deliberately moving the expensive parts of application bootstrap — the parts that traditionally happen every single time the JVM starts — to build time instead, so there's simply less work left for the runtime to do. Build-time annotation s...
23. How does Quarkus achieve low memory footprint?
Quarkus reduces memory usage through the same build-time philosophy that drives its fast startup: by resolving as much as possible ahead of time, it avoids keeping large amounts of metadata, reflection caches, and unused code in memory at runtime that a traditional framework would otherwise load....
24. Explain the build-time vs runtime processing model in Quarkus?
Quarkus's core architectural idea is splitting application processing into two clearly separated phases: an augmentation phase that happens once during the build, and a runtime phase that happens every time the application actually starts and serves traffic. flowchart TD A[Source code + annotatio...
25. What is the difference between JVM mode and native mode in Quarkus?
These are the two ways a built Quarkus application can actually be packaged and run, and the difference goes beyond just speed — it affects the build pipeline, deployment artifact, and even which dynamic Java features are safely usable. JVM Mode Native Mode Packaged as a runnable JAR, execu...
26. How does Quarkus support GraalVM native image compilation?
Quarkus supports native compilation by handing GraalVM's native-image tool an already fully-augmented application — one where CDI beans are wired, reflection needs are known, and resources are identified — rather than expecting GraalVM to statically analyze a completely generic, unpro...
27. Explain the lifecycle of a Quarkus application build?
A Quarkus build moves through a defined sequence of phases, each building on the output of the last, whether the final target is a JAR for JVM mode or a binary for native mode. flowchart TD A[Source compilation - javac] --> B[Augmentation phase begins] B --> C[Extension build steps run in depende...
28. What happens when you run "quarkus dev"?
Running quarkus dev starts the application in Dev Mode, but the sequence of what actually happens under the hood is more involved than a normal application launch, which is why it can offer live reload without a manual restart. Quarkus performs an initial build-time augmentation, same as any othe...
29. How do you configure a Quarkus application for different environments using profiles?
Environment-specific configuration in Quarkus is handled by combining the built-in dev , test , and prod profiles (or custom ones) with the %profile. property prefix, so one properties file can serve every environment without duplicating unrelated settings. quarkus.datasource.db-kind=postgresql %...
30. What is the difference between @Inject and @ConfigProperty in Quarkus?
Both annotations request something be supplied to a field or constructor parameter, but they pull from fundamentally different sources: one resolves a CDI bean, the other resolves a configuration value. @Inject @ConfigProperty Resolves a CDI-managed bean instance. Resolves a value from applicatio...
31. How does dependency injection work in Quarkus vs traditional CDI containers?
Both use the same CDI programming model on the surface, but they resolve the dependency graph at fundamentally different times, which is the root cause of most of the practical differences in behavior and performance. A traditional CDI container (as found in a full Jakarta EE application server) ...
32. Explain the internal working of Quarkus extensions?
An extension is really two coordinated artifacts published together: a runtime module containing the classes actually used while the application executes, and a deployment module containing build-time-only logic that never ships in the final artifact. flowchart TD A[Extension: deployment module] ...
33. 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 ...
34. How does Quarkus handle reactive messaging with Kafka?
Quarkus integrates Kafka through the SmallRye Reactive Messaging extension, which implements the MicroProfile Reactive Messaging specification and lets a method be wired to a Kafka topic declaratively, using annotations rather than manually managing a Kafka consumer/producer client. @Incoming ( "...
35. When should you use Quarkus over a traditional Spring application?
Quarkus tends to be the stronger fit specifically when startup time, memory footprint, or native-image deployment are decision-driving requirements, rather than in every microservice scenario universally. Serverless / FaaS deployments: cold-start latency directly affects cost and user-perceived l...
36. What is the difference between Panache Active Record and Repository pattern?
Both patterns provide the same Panache query capabilities, but they differ in where that logic physically lives in the codebase, which affects testability and how naturally the code reads for different team preferences. // Active Record @Entity public class Person extends PanacheEntity { public S...
37. How do you write integration tests in Quarkus using @QuarkusTest?
@QuarkusTest is the core annotation for writing tests that run against a real, started instance of the Quarkus application — CDI container active, extensions initialized — rather than mocking the framework away, which is what makes these true integration tests instead of isolated unit...
38. Explain the execution flow of a REST request in Quarkus using RESTEasy Reactive?
A request handled by RESTEasy Reactive takes a different path depending on whether the matched resource method is blocking or reactive, and understanding that fork is key to understanding Quarkus's concurrency model. sequenceDiagram participant Client participant VertxEL as Vert.x Event Loop part...
39. How does Quarkus support GraalVM substitutions for native compilation issues?
A substitution is a mechanism GraalVM provides for swapping out a piece of a class's implementation specifically for the native-image build, used when some existing code does something the static AOT compiler can't safely analyze or support — certain JNI calls, OS-specific behavior, or code...
40. What is the difference between Quarkus and Micronaut?
Quarkus and Micronaut share a similar high-level goal — fast-starting, low-memory Java microservices with native-image support — and both avoid runtime reflection-heavy bootstrap, but they differ in ecosystem backing, standards alignment, and some implementation details. Quarkus Micro...
41. How do you troubleshoot a native image build failure in Quarkus?
Native-image build failures usually trace back to one of a small set of recurring causes, and working through them systematically is faster than guessing. Read the actual GraalVM error output first: messages about "ClassNotFoundException at runtime" or missing resources point directly at a reflec...
42. Explain the lifecycle of application startup in native mode vs JVM mode?
Both modes run an application that was already fully augmented at build time, but what actually happens between "process launched" and "ready to serve requests" differs meaningfully between the two. flowchart LR subgraph JVM Mode A1[JVM process starts] --> A2[Class loading begins] A2 --> A3[JIT c...
43. How does Quarkus achieve ahead-of-time (AOT) compilation benefits?
AOT compilation in Quarkus operates on two levels: Quarkus's own build-time augmentation is a form of AOT processing for the framework layer, while GraalVM's native-image tool provides true AOT machine-code compilation for the whole application when native mode is used. At the framework level, au...
44. What is the role of the Quarkus Arc container?
ArC is Quarkus's own CDI-compliant dependency injection container, purpose-built to resolve as much of the bean discovery and wiring process as possible during build-time augmentation instead of through runtime classpath scanning like a traditional CDI implementation. Its role spans the whole DI ...
45. How do you secure a Quarkus application with OIDC?
Quarkus secures applications against an OpenID Connect provider (Keycloak, Auth0, or any compliant provider) through the quarkus-oidc extension, which handles validating bearer tokens on incoming requests without the application needing to implement token validation logic itself. quarkus.oidc.aut...
46. Explain the internal working of Quarkus's build-time class initialization?
Quarkus and GraalVM distinguish between classes initialized at build time (their static initializers run once during the native-image build, and the resulting state is baked directly into the binary) and classes initialized at runtime (static initializers run fresh each time the application proce...
47. How does Quarkus support Kubernetes-native deployments?
Quarkus treats Kubernetes as a first-class deployment target through the quarkus-kubernetes extension (and related extensions for OpenShift, Knative, and Docker), which generates deployment manifests directly from the application's own configuration rather than requiring them to be hand-written a...
48. What is the difference between Quarkus's Vert.x-based reactive engine and traditional servlet-based engines?
The two models differ in how they map incoming connections to threads, which is the root cause of their different scalability characteristics under high concurrency. Traditional Servlet Engine Vert.x Reactive Engine Typically one thread dedicated per in-flight request. A small pool of event-loop ...
49. How do you optimize Quarkus native image build times?
Native-image builds are inherently slower than a normal compile because of the static analysis GraalVM performs, but several concrete levers reduce build time without giving up the benefits of native compilation in production. Use Dev Mode / JVM mode for daily development: only build natively for...
50. Explain the execution flow of a reactive messaging pipeline using SmallRye Reactive Messaging in Quarkus?
A reactive messaging pipeline in Quarkus is built from channels connected by @Incoming / @Outgoing -annotated methods, and SmallRye Reactive Messaging wires those methods together into one continuous reactive stream, whether the endpoints are external systems like Kafka or purely in-memory channe...
