C1000-155 Sample Questions & Answers
Developing cloud-native microservices, including input validation, REST and GraphQL, is the biggest piece, alongside Liberty server concepts, MicroProfile standards, data persistence, security, adding telemetry, testing, and deploying with Kubernetes.
Launch the full C1000-155 simulator →Showing 10 of 20 free samples.
- Question 1Intermediate
Liberty concepts · Zero Migration Principle
True or False: The 'zero migration' feature of WebSphere Liberty guarantees that an application developed for Liberty using Jakarta EE 8 APIs will run without any code or configuration changes on a newer Liberty version that supports Jakarta EE 10.
Show answer & explanation
Correct answer: B
False. The 'zero migration' principle applies to the Liberty runtime itself, meaning you can update the runtime without changing your application or its configuration. However, it does not apply to major specification changes like the move from Jakarta EE 8 to Jakarta EE 10. This move involves a package name change from
javax.*tojakarta.*, which requires significant code changes. The application would need to be recompiled against the new Jakarta EE 10 APIs. - Question 2IntermediateSelect 2
Developer experience and tools · Liberty Dev Mode Troubleshooting
A developer is using Liberty dev mode (
mvn liberty:dev) for rapid application development. After making a code change in a JAX-RS resource class, they notice the change is not reflected when they test the endpoint. The console log shows no errors. What are the most likely causes for hot reload to fail in this scenario? (Select TWO)Show answer & explanation
Correct answers: B, D
Liberty dev mode relies on detecting changes to compiled
.classfiles. If the Integrated Development Environment (IDE) is not automatically compiling the Java source files upon saving, dev mode will not detect any changes and will not trigger a hot reload.If the code change introduced a compilation error, the
.classfile will not be updated. Since dev mode monitors the compiled output directory, it will not see a new file and therefore will not reload the application. The developer would need to check their IDE's problem view or run a manual build to see the error. - Question 3Beginner
Concepts of cloud-native Java and microservices · 12-Factor App Principles
A consultant is reviewing a microservice architecture and identifies that several services have hardcoded connection details for databases and external APIs within their
server.xmlfiles. This practice violates a key principle of the 12-Factor App methodology. Which factor is most directly violated by this approach?Show answer & explanation
Correct answer: B
Factor III, 'Config', states that configuration should be stored in the environment and strictly separated from the code. Hardcoding connection details in
server.xmlviolates this principle because the configuration is bundled with the deployable artifact. The correct approach is to externalize this configuration using environment variables or a configuration service, which can then be injected into the application at runtime via MicroProfile Config. - Question 4Intermediate
Develop cloud-native Java microservices · Jakarta Bean Validation
A developer needs to implement a JAX-RS resource that accepts a user registration payload. The
passwordfield in the payload must be at least 12 characters long and contain at least one uppercase letter, one lowercase letter, one number, and one special character. Which Jakarta EE technology is the most appropriate and standard way to enforce these validation rules declaratively at the model level?Show answer & explanation
Correct answer: C
Jakarta Bean Validation is the standard specification for this purpose. By annotating the fields of the payload model class (POJO) with constraints like
@Size(min=12)and@Pattern(regexp=...), the validation logic is kept declarative and separate from the business logic. When the JAX-RS method is annotated with@Valid, the Liberty runtime will automatically trigger the validation and return a 400 Bad Request if the constraints are violated. - Question 5Intermediate
Monitor and troubleshoot · Structured JSON Logging Configuration
An operations team is trying to integrate Open Liberty's logs with a centralized logging platform like Splunk or the ELK Stack. To make parsing efficient and reliable, they need the logs to be in a structured format. What is the simplest way to configure the Liberty
server.xmlto achieve this?Show answer & explanation
Correct answer: D
The correct and simplest method to enable structured JSON logging in Open Liberty is to add the attribute
messageSource="json"to theelement inserver.xml. This instructs Liberty to write log records formessages.logandtrace.login JSON format, which includes fields like timestamp, log level, message, thread ID, and other context, making them easily parsable by log aggregation tools. - Question 6Intermediate
Add telemetry/observability to microservices · MicroProfile Metrics Types
A developer is tasked with creating a custom metric to monitor the number of active user sessions in a web application. The value of this metric will increase as users log in and decrease as they log out. Which MicroProfile Metrics annotation is the most suitable for this use case?
Show answer & explanation
Correct answer: B
A
@Gaugeis the correct metric type for measuring a value that can arbitrarily go up and down, such as the number of active sessions, CPU temperature, or items in a queue. A@Countedmetric is a simple monotonically increasing counter, which is not suitable for this scenario as it cannot decrease.@Timedmeasures duration, and@Meteredmeasures the rate of events. - Question 7Intermediate
Security · OpenID Connect (OIDC) Configuration
To improve security, a company wants to implement Single Sign-On (SSO) for its suite of web applications running on Open Liberty. The company uses a third-party Identity Provider (IdP) that supports the OpenID Connect (OIDC) 1.0 standard. Which Liberty feature must be enabled in
server.xmlto allow the Liberty server to act as an OIDC Relying Party and delegate authentication to the external IdP?Show answer & explanation
Correct answer: C
The
openidConnectClient-1.0feature is specifically designed to configure Liberty as an OpenID Connect Relying Party (Client). Enabling this feature allows the server to redirect users to an external OIDC Provider for authentication and to process the resulting ID token to establish a security context.mpJwt-2.0is for validating JWTs for API security, not for handling the OIDC browser-based login flow.appSecurity-2.0is a prerequisite but does not provide the OIDC client capability itself. - Question 8Advanced
Develop cloud-native Java microservices · Asynchronous JAX-RS Client
A developer is writing an asynchronous JAX-RS client to invoke a long-running process on another microservice. To avoid blocking the calling thread, they want to receive the response via a
CompletionStage. Which code snippet correctly demonstrates how to make an asynchronous GET request using the JAX-RS client API?Show answer & explanation
Correct answer: B
The correct way to make an asynchronous call that returns a
CompletionStagewith the JAX-RS client API is to first invoke theasync()method on theInvocation.Builderinstance. This returns anAsyncInvoker, which has methods likeget(),post(), etc., that return aCompletionStage. The other options are either synchronous or use incorrect syntax. - Question 9Advanced
Data persistence and transactions · Distributed Session Caching
A team is managing a stateful application that stores user session data in memory. They need to deploy this application across multiple pods in Kubernetes for high availability. If a pod fails, users connected to it should be seamlessly failed over to another pod without losing their session. Which Liberty feature and configuration approach would solve this problem?
Show answer & explanation
Correct answer: C
The
sessionCache-1.0feature, which implements JCache (JSR 107), is the standard Liberty solution for distributed session management. By configuring it with a distributed in-memory data grid like Hazelcast or Infinispan, session data is replicated across the cluster. If one pod fails, another pod can retrieve the session data from the distributed cache, providing seamless failover. Session affinity does not provide failover, and database-backed sessions typically have higher latency. - Question 10Intermediate
Liberty concepts · Container Image Selection
When comparing Open Liberty's container image options, a developer needs to choose a base image for a production microservice. The primary requirements are the smallest possible image size and the lowest potential attack surface. The service only uses MicroProfile APIs. Which official Open Liberty image tag would be the best choice?
Show answer & explanation
Correct answer: C
The
kernel-slimimage is the minimal base image for Open Liberty. It contains only the server kernel and does not pre-install any features. The developer would then use a multi-stage Docker build to add only the specific features their application requires (in this case, MicroProfile features). This results in the smallest possible final image with the minimum number of libraries, significantly reducing the attack surface, which is ideal for production deployments.
Ready for the real thing?
The full C1000-155 simulator has every exam-style question, timed mode, and instant scoring.