C1000-155 IBM Certified Developer - Cloud Native Java with IBM Liberty Practice Questions
Prepare for C1000-155 with more than an answer.
- Exam fee
- $200 USD
- Level
- Developer
- Valid for
- 3 years
Domains covered on the exam 10
- Liberty concepts8%
- Concepts of cloud-native Java and microservices7%
- Developer experience and tools8%
- Develop cloud-native Java microservices25%
- Data persistence and transactions6%
- Security11%
- Add telemetry/observability to microservices16%
- Test microservices6%
- Containerize and deploy5%
- Monitor and troubleshoot8%
- 1
True or False: Using the Open Liberty Operator to deploy an application to Kubernetes eliminates the need to create a Dockerfile for the application.
Show answer details
Correct answer: B
False. The Open Liberty Operator manages the deployment and lifecycle of a Liberty application within Kubernetes. It automates tasks like creating Deployments, Services, and Routes based on a custom resource definition (
OpenLibertyApplication). However, it still requires a pre-built container image to deploy. The developer is responsible for creating the Dockerfile, building the image containing the application, and pushing it to a container registry that the Kubernetes cluster can access. - 2
A developer is using the typesafe MicroProfile Rest Client to call a remote service. They need to dynamically add an
Authorizationheader to every outgoing request without modifying the client interface. What is the standard MicroProfile approach to achieve this?Show answer details
Correct answer: B
The standard and most idiomatic MicroProfile approach is to implement the
ClientHeadersFactoryinterface. This interface allows you to programmatically generate or modify headers for outgoing requests. The factory can then be associated with a REST client interface using the@RegisterClientHeadersannotation. This separates the concern of header manipulation from the client definition and business logic. - 3
An e-commerce platform's
OrderServiceis experiencing intermittentOutOfMemoryErrorexceptions under heavy load. The service is running in a container with a 2GB memory limit. The operations team suspects a memory leak related to database connections. They have taken a thread dump and heap dump. What is the most effective next step to diagnose the root cause of the memory issue?Show answer details
Correct answer: D
For an
OutOfMemoryError, a heap dump is the most critical artifact. Loading it into a tool like Eclipse MAT allows the team to analyze object retention, identify large object graphs, and run automated leak suspect reports. This will pinpoint which objects are consuming the most memory and what is preventing them from being garbage collected, directly leading to the root cause of the leak. While thread dumps are useful for hangs and deadlocks, they are less effective for memory leaks. Increasing memory only postpones the problem. - 4
A developer is using Jakarta Persistence (JPA) in a JAX-RS resource to fetch data. To prevent the 'N+1 select' problem when loading a
Customerentity that has a collection ofOrderentities, what is the most efficient JPA fetching strategy to use?Show answer details
Correct answer: C
Using a
JOIN FETCHin a JPQL query (e.g.,SELECT c FROM Customer c JOIN FETCH c.orders WHERE c.id = :id) is the most effective way to solve the N+1 problem. It instructs the persistence provider to retrieve the associated collection (orders) in the same SQL query that retrieves the parent entity (Customer), thus avoiding the extra 'N' queries that would otherwise be executed when accessing the lazy-loaded collection. - 5
A developer needs to document a JAX-RS endpoint using MicroProfile OpenAPI. They want to provide a detailed example of the JSON response body. How can this be achieved using OpenAPI annotations?
sequenceDiagram participant Client participant Liberty as Liberty (OpenAPI) participant Endpoint as JAX-RS Endpoint Client->>Liberty: GET /openapi Liberty-->>Client: OpenAPI document Note over Liberty,Endpoint: Annotations generate this doc Client->>Endpoint: GET /my-resource Endpoint-->>Client: JSON ResponseShow answer details
Correct answer: B
The correct and most structured way to provide a detailed example is to use the
@APIResponseannotation on the method. Inside it, you define the media type using@Content, and within@Content, you provide one or more@ExampleObjectannotations. Thevalueattribute of@ExampleObjectcontains the string representation of the example JSON. - 6
A financial services application running on Open Liberty needs to consume a RESTful API from a partner. This partner API is known for intermittent latency spikes. To prevent cascading failures, the development team wants to implement a resilience pattern that stops calling the service for a short period after a certain number of consecutive failures. Which MicroProfile Fault Tolerance annotation is the most appropriate for this specific requirement?
Show answer details
Correct answer: C
The
@CircuitBreakerannotation is designed specifically for this use case. It follows the circuit breaker pattern, where after a configured number of consecutive failures (requestVolumeThreshold), the circuit 'opens' and subsequent calls fail immediately without attempting to contact the failing service. After a delay (delay), it enters a 'half-open' state to test if the service has recovered.@Retrywould repeatedly call the failing service, potentially worsening the problem.@Timeoutonly limits the duration of a single call, it does not prevent future calls.@Fallbackprovides an alternative execution path on failure but does not stop calls to the original service. - 7
A developer is configuring an Open Liberty server and needs to set a system property that must be available very early in the server startup process, even before the main server configuration (
server.xml) is parsed. The property value is sensitive and should not be checked into source control. Which file is the standard and most appropriate location to define this property?Show answer details
Correct answer: B
The
bootstrap.propertiesfile is specifically designed for setting properties that are needed before the mainserver.xmlconfiguration is processed. It has a higher precedence for system properties thanserver.xml. This makes it ideal for setting early-stage configuration, such as properties that control the configuration parsing itself or sensitive values that should be externalized from the main configuration file. - 8
A team is building a set of microservices on Open Liberty and wants to implement true-to-production integration tests. The
inventory-servicedepends on a PostgreSQL database and awarehouse-serviceREST API. Which testing framework is specifically designed to manage the lifecycle of these dependencies in Docker containers during the test run, providing a production-like environment?Show answer details
Correct answer: D
MicroShed Testing is a framework built on top of Testcontainers and JUnit 5, specifically for testing Jakarta EE and MicroProfile applications. It excels at starting the application in a Docker container alongside its dependencies (like databases or other services), creating a true-to-production test environment. Mockito is for mocking objects (unit tests), Pact is for contract testing, and JUnit 5 is a general testing framework that does not inherently manage containerized dependencies.
- 9
A cloud architect is designing a security model for internal microservices communication within a Kubernetes cluster. To achieve a zero-trust posture, the architect wants to ensure that when
Service-AcallsService-B, both services cryptographically verify each other's identity before any data is exchanged. Which security mechanism should be configured in Open Liberty on both services to fulfill this requirement?Show answer details
Correct answer: C
Mutual TLS (mTLS) is the correct mechanism for this scenario. In mTLS, not only does the client verify the server's certificate (standard one-way TLS), but the server also demands and verifies the client's certificate. This ensures both parties are who they claim to be, establishing a strong, mutually authenticated identity at the transport layer, which is a cornerstone of zero-trust network security. JWT is for application-level authentication/authorization, not transport-level identity verification. OpenID Connect is for user authentication.
- 10
A developer is creating a readiness health check for a microservice that depends on an external database. The goal is to prevent Kubernetes from routing traffic to the pod until the database connection is confirmed to be healthy. Which of the following code snippets correctly implements this
@Readinesscheck using the MicroProfile Health API? (Select TWO)Show answer details
Correct answer: A, C
This is a correct implementation. The class is annotated with
@Readinessto mark it as a readiness probe, it implements theHealthCheckinterface, and thecall()method returns aHealthCheckResponseindicating the status.This is also a correct implementation. It uses the
HealthCheckResponsebuilder pattern to construct the response, dynamically setting the status based on the result of thecheckDatabase()method. The@Readinessannotation correctly designates it for readiness checks.
