Salesforce MuleSoft Developer II Practice Questions with Explanations

Free Salesforce MuleSoft Developer II practice questions. 16 of them, each with the correct answer, a full explanation, and the reason every other option is wrong.

MuleSoft Developer II practice questions

Question 1

A system API that communicates to an underlying MySQL database is deployed to CloudHub. The DevOps team requires a readiness endpoint to monitor all system APIs.

Which strategy should be used to implement this endpoint?

  • A. Create a dedicated endpoint that responds with the API status only
  • B. Create a dedicated endpoint that responds with the API status and health of the server
  • C. Create a dedicated endpoint that responds with the API status and reachability of the underlying systems
  • D. Use an existing resource endpoint of the API
Show answer and explanation ▾

Correct answer: C

A readiness endpoint should tell the DevOps team whether the API can really serve requests. That needs the API status and the reachability of the systems behind it, here the MySQL database.

Why the other options are wrong:

  • A. A status-only endpoint says nothing about whether the underlying system can be reached.
  • B. Server health alone does not show whether the database behind the API is reachable.
  • D. An existing resource endpoint is not a dedicated readiness check.

Question 2

A Mule API receives a JSON payload and updates the target system with the payload. The developer uses JSON schemas to ensure the data is valid.

How can the data be validated before posting to the target system?

  • A. Apply the JSON Schema policy in API Manager and reference the correct schema in the policy configuration
  • B. Use a DataWeave 2.0 transform operation, and at the top of the DataWeave script, add: %dw 2.0 import json-module
  • C. Add the JSON module dependency and add the validate-schema operation in the flow, configured to reference the schema
  • D. Using the DataWeave If Else condition, test the values of the payload against the examples included in the schema
Show answer and explanation ▾

Correct answer: C

The JSON module's validate-schema operation checks the payload against the schema inside the flow, before the data is posted to the target system.

Why the other options are wrong:

  • A. A JSON Schema policy in API Manager is not how a flow validates a payload before posting.
  • B. Importing a module at the top of a DataWeave script does not validate against a schema.
  • D. Testing values against schema examples with if/else is manual and does not apply the schema.

Question 3

Which pattern can a web API use to notify its client of state changes as soon as they occur?

  • A. Schedule Event Publisher
  • B. Shared database trigger
  • C. HTTP Webhook
  • D. ETL data load
Show answer and explanation ▾

Correct answer: C

An HTTP webhook lets the API call the client as soon as a state change occurs, instead of waiting for the client to ask.

Why the other options are wrong:

  • A. A scheduled publisher sends on a timer, not as soon as changes occur.
  • B. A shared database trigger couples the systems and is not a web API notification pattern.
  • D. An ETL data load moves data in batches.

Question 4

When implementing a synchronous API where the event source is an HTTP Listener, a developer needs to return the same correlation ID back to the caller in the HTTP response header.

How can this be achieved?

  • A. No action is needed as the correlation ID is returned to the caller in the response header by default
  • B. Enable the CorrelationID checkbox in the HTTP Listener configuration
  • C. Configure a custom correlation policy
  • D. Enable the auto-generate CorrelationID option when scaffolding the flow
Show answer and explanation ▾

Correct answer: A

Mule assigns every event a correlation ID, taking it from the incoming request when one is sent, and the HTTP Listener returns it to the caller in the response header by default. No extra configuration is needed.

Why the other options are wrong:

  • B. The HTTP Listener configuration has no CorrelationID checkbox that must be enabled for this.
  • C. A custom policy is not needed to return the correlation ID.
  • D. Scaffolding a flow has no option that controls returning the correlation ID.

Question 5

An order processing system is composed of multiple Mule applications responsible for warehouse, sales, and shipping. Each application communicates using Anypoint MQ. Each message must be correlated against the original order ID for observability and tracing.

How should a developer propagate the order ID as the correlation ID across each message?

  • A. Use the underlying HTTP request of Anypoint MQ to set the "X-CORRELATION-ID" header to the order ID
  • B. Wrap all Anypoint MQ Publish operations within a With CorrelationID scope from the Tracing module, setting the correlation ID to the order ID
  • C. Set a custom Anypoint MQ user property to propagate the order ID and set the correlation ID in the receiving applications
  • D. Use the default correlation ID; Anypoint MQ will automatically propagate it
Show answer and explanation ▾

Correct answer: C

Anypoint MQ messages can carry custom user properties. Publishing the order ID as a user property lets each receiving application read it and set it as the correlation ID for its own processing, so every message traces back to the original order.

Why the other options are wrong:

  • A. Messages are published through the Anypoint MQ connector, not by setting an HTTP header on an underlying request.
  • B. Wrapping the publish operations in a tracing scope does not carry the order ID to the receiving applications.
  • D. The default correlation ID is generated by Mule and is not the order ID.

Question 6

A scatter-gather router is configured with four routes: Route A, B, C and D.

Route C fails.

Which expression allows access to the failing route so that it can be compensated?

  • A. payload['2']
  • B. error.errorMessage.payload.failures['2']
  • C. error.errorMessage.payload.results['2']
  • D. payload.failures['2']
Show answer and explanation ▾

Correct answer: B

When a route fails, Scatter-Gather raises MULE:COMPOSITE_ROUTING, and the error message payload holds the failures and results by route index, starting at 0. Route C is the third route, so error.errorMessage.payload.failures['2'] returns its error.

Why the other options are wrong:

  • A. payload['2'] reads the event payload, which does not hold the failed route's error.
  • C. results holds the routes that completed successfully, not the failed route.
  • D. The failures are reached through error.errorMessage.payload, not directly on the event payload.

Question 7

Which configurations are required for HTTP Listener to enable mTLS authentication?

  • A. Set an appropriate keystore configuration and use persistent connections for the listener
  • B. Set an appropriate keystore and truststore configuration for the listener
  • C. Set an appropriate reconnection strategy and use persistent connections for the listener
  • D. Set an appropriate truststore configuration and reconnection strategy for the listener
Show answer and explanation ▾

Correct answer: B

Mutual TLS has both sides present a certificate. The listener needs a keystore holding its own certificate to identify itself, and a truststore holding the certificates it accepts from clients.

Why the other options are wrong:

  • A. Persistent connections have nothing to do with authenticating the client certificate.
  • C. A reconnection strategy and persistent connections do not configure any TLS authentication.
  • D. A reconnection strategy does not supply the listener's own certificate, which needs a keystore.

Question 8

A healthcare customer wants to use hospital system data, which includes code that was developed using legacy tools and methods. The customer has created reusable Java libraries in order to read the data from the system.

What is the most effective way to develop an API to retrieve the data from the hospital system?

  • A. Refer to JAR files in the code
  • B. Install the libraries in a local repository and refer to it in the pom.xml file
  • C. Create the Java code in your project and invoke the data from the code
  • D. Include the libraries while deploying the code into the runtime
Show answer and explanation ▾

Correct answer: B

Mule projects are built with Maven, so existing Java libraries are best installed in a repository and declared as dependencies in pom.xml. The build then packages them with the application and they can be reused across projects.

Why the other options are wrong:

  • A. Referring to loose JAR files bypasses Maven dependency management and makes builds hard to reproduce.
  • C. Rewriting the Java code in the project discards the reusable libraries that already exist.
  • D. Adding libraries only at deployment leaves them outside the project build and its dependency management.

Question 9

Which properties are mandatory on the HTTP Connector configuration in order to use the OAuth 2.0 Authorization Code grant type for authentication?

  • A. External callback URL, access token URL, client ID, response refresh token
  • B. External callback URL, access token URL, local authorization URL, authorization URL, client ID, client secret
  • C. Token URL, authorization URL, client ID, client secret, local callback URL
  • D. External callback URL, access token URL, client ID, response access token
Show answer and explanation ▾

Correct answer: C

The authorization code grant sends the user to the authorization URL, receives the code on a local callback, and exchanges it at the token URL using the client ID and client secret. All of these must be set on the HTTP connector configuration.

Why the other options are wrong:

  • A. This list leaves out the client secret and the authorization URL, which the grant needs.
  • B. A local authorization URL is not part of the mandatory set, and the list is not the required combination.
  • D. This list leaves out the client secret and the authorization URL, which the grant needs.

Question 10

What is the MuleSoft recommended method to encrypt sensitive property data?

  • A. The encryption key should be different for each environment and the sensitive data should be the same for all environments
  • B. The encryption key should be identical for all environments and the sensitive data should be different for each environment
  • C. The encryption key and sensitive data should be different for each environment
  • D. The encryption key and sensitive data should be the same for all environments
Show answer and explanation ▾

Correct answer: C

Each environment should have its own encryption secret and its own sensitive values, such as passwords. A leak in one environment then exposes nothing that works in another.

Why the other options are wrong:

  • A. Using the same sensitive data in every environment means a leak in a lower environment exposes production.
  • B. An identical encryption secret for all environments lets one leak decrypt every environment's properties.
  • D. Sharing both across environments gives no isolation between them at all.

Question 11

A Mule application deployed to multiple Cloudhub 2.0 replicas needs to temporarily persist large files over 10MB between flow executions, and routinely needs to query whether the file data exists on separate executions.

How can this be achieved?

  • A. Use the file connector to store and read the file, caching the filename and location between requests
  • B. Store the contents of the file on separate storage, and store the key and location of the file using object Store v2
  • C. Store the key and full contents of the file in an Object Store
  • D. Use an in-memory Object Store
Show answer and explanation ▾

Correct answer: B

Object Store v2 is shared by all replicas of the application but limits each value to 10 MB. The file contents go to separate storage, and Object Store v2 holds only the file's identifier and location, which later executions can query.

Why the other options are wrong:

  • A. A replica's local file system is not shared with the other replicas and does not persist.
  • C. Files over 10 MB exceed the maximum value size of the Object Store.
  • D. An in-memory Object Store is not shared across replicas and is lost on restart.

Question 12

Which pattern should be used to invoke multiple HTTP APIs in parallel and roll back any failed requests in sequence?

  • A. Scatter-Gather as central Saga orchestrator for all API requests with compensating actions for failing routes
  • B. VM queues as a reliability pattern with error handlers to roll back any requests
  • C. A Parallel For Each scope with each HTTP request wrapped in a Try scope
  • D. A database as a transactional outbox and an Until Successful router to retry any requests
Show answer and explanation ▾

Correct answer: A

Scatter-Gather sends the requests in parallel and reports which routes failed and which succeeded. Acting as the Saga orchestrator, the flow can then run compensating actions in sequence to undo the work tied to failed requests.

Why the other options are wrong:

  • B. VM queues add reliability to message hand-off but do not invoke the APIs in parallel.
  • C. A Try scope around each request handles its own error but does not orchestrate compensation across the requests.
  • D. A transactional outbox with Until Successful retries requests, it does not call them in parallel and roll them back.

Question 13

A Mule implementation uses an HTTP Request within an Until Successful scope to connect to an API.

How should a permanent error response like HTTP:UNAUTHORIZED be handled inside Until Successful to reduce latency?

  • A. In Until Successful configuration, set the retry count to 1 for error type HTTP:UNAUTHORIZED.
  • B. Put the HTTP Request inside a try scope in Until Successful. In the error handler, use On Error Continue to catch permanent errors like HTTP:UNAUTHORIZED.
  • C. Put the HTTP Request inside a try scope in Until Successful. In the error handler, use On Error Propagate to catch permanent errors like HTTP:UNAUTHORIZED.
  • D. Continue retrying until a MULE:RETRY_EXHAUSTED error is raised or the API responds back with a successful response.
Show answer and explanation ▾

Correct answer: B

Until Successful retries whenever its content raises an error. A Try scope with On Error Continue around the HTTP Request catches permanent errors such as HTTP:UNAUTHORIZED, so the scope completes at once instead of spending time on retries that cannot succeed.

Why the other options are wrong:

  • A. Until Successful has no retry count setting per error type.
  • C. On Error Propagate rethrows the error, so Until Successful still retries.
  • D. Retrying a permanent error until retries are exhausted adds latency for no benefit.

Question 14

A company deploys 10 public APIs to CloudHub. Each API has its own individual health endpoint defined. The platform operation team wants to configure API Functional Monitoring to monitor the health of the APIs periodically while minimizing operational overhead and cost.

How should API Functional Monitoring be configured?

  • A. From 10 public locations with each API in its own schedule
  • B. From one private location with all 10 APIs in a single schedule
  • C. From one public location with all 10 APIs in a single schedule
  • D. From one public location with each API in its own schedule
Show answer and explanation ▾

Correct answer: C

The APIs are public, so a public location can reach them without a private location being set up. Putting all 10 health checks in one schedule from one location keeps both the management effort and the cost lowest.

Why the other options are wrong:

  • A. Ten locations and ten schedules multiply both the overhead and the cost.
  • B. A private location is extra infrastructure that public APIs do not need.
  • D. A separate schedule for each API adds overhead and cost compared with one shared schedule.

Question 15

A healthcare portal needs to validate the token that it sends to a Mule API. The developer plans to implement a custom policy using the HTTP Policy Transform Extension to match the token received in the header from the healthcare portal.

Which files does the developer need to create in order to package the custom policy?

  • A. JSON properties file, XML template file
  • B. XML template file, YAML configuration file
  • C. Deployable ZIP file, YAML configuration file
  • D. JSON properties file, YAML configuration file
Show answer and explanation ▾

Correct answer: B

A custom Mule 4 policy is built from an XML template file that holds the policy logic and a YAML configuration file that defines its parameters for API Manager. These are packaged together with the project's POM.

Why the other options are wrong:

  • A. The policy parameters are defined in a YAML file, not a JSON properties file.
  • C. The policy logic lives in an XML template, and a deployable ZIP file is not one of the files the developer creates.
  • D. A JSON properties file is not part of the package, and the XML template holding the logic is missing.

Question 16

A Mule application needs to invoke an API hosted by an external system to initiate a process. The external API takes anywhere between one minute and 24 hours to complete its process.

Which implementation should be used to get response data from the external API after it completes processing?

  • A. Use an HTTP Connector to invoke the API and wait for a response
  • B. Use a Scheduler to check for a response every minute
  • C. Use an HTTP Connector inside Async scope to invoke the API and wait for a response
  • D. Expose an HTTP callback API in Mule and register it with the external system
Show answer and explanation ▾

Correct answer: D

For a process that can take up to 24 hours, the Mule application should not wait or poll. It exposes an HTTP callback endpoint and registers it with the external system, which calls it with the result when processing completes.

Why the other options are wrong:

  • A. Holding an HTTP connection open for up to 24 hours will time out.
  • B. Polling every minute for up to 24 hours wastes resources compared with a callback.
  • C. An Async scope still leaves the HTTP request waiting for a response for hours.

Get the complete MuleSoft Developer II bank

These 16 questions are roughly 28% of the bank. The full pack has 57 real exam questions, each with the same depth of explanation, plus a questions-only PDF for timed practice and free updates forever.

View the full Salesforce MuleSoft Developer II question bank →

About the MuleSoft Developer II exam

These 16 Salesforce MuleSoft Developer II questions are free here. The free sample PDF has 20.

Back to blog