# Free MSMDI practice questions

> 10 free MSMDI practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/salesforce-mulesoft-dev-i/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/salesforce-mulesoft-dev-i/

### Question 1 of 10

A retailer exposes its SAP inventory data through an API that hides SAP-specific details and returns a canonical product structure. Several business processes will reuse this API. In API-led connectivity, which layer does this API belong to?

- A. Integration layer, because it moves SAP records into other systems on a scheduled synchronisation basis
- B. Process layer, because it combines inventory data with business rules before other APIs consume it
- C. System layer, because it unlocks a core system of record and insulates consumers from its complexity
- D. Experience layer, because it reshapes data into the format that a specific channel or device needs

**Answer:** C

**Explanation:** System APIs unlock systems of record such as SAP and hide their data models behind a reusable interface. Process APIs orchestrate several system APIs and apply business logic, which this API does not do. Experience APIs tailor data for a specific consumer channel. API-led connectivity defines no separate 'integration layer'; scheduled synchronisation describes a point-to-point pattern rather than a layer.

### Question 2 of 10

A team has published a RAML specification to Anypoint Exchange. Front-end developers want to try the API's endpoints and see example responses before any implementation exists. What should the API designer enable?

- A. An API proxy in API Manager pointing to the specification so that requests return the documented example payloads
- B. A CloudHub 2.0 deployment of the scaffolded APIkit project with every flow left empty so requests succeed with HTTP 200
- C. A Flex Gateway instance in local mode that serves the specification file to developers as a browsable HTML page
- D. The mocking service in API Designer or Exchange, which returns responses based on the examples in the specification

**Answer:** D

**Explanation:** The mocking service simulates the API from its specification and returns the defined examples, so consumers can test before implementation. A proxy forwards to a real implementation and does not fabricate responses. Deploying empty scaffolded flows returns placeholder content, not the spec examples, and Flex Gateway enforces policies on traffic rather than mocking.

### Question 3 of 10

An HTTP Listener receives a JSON order. A developer must read the request's Content-Type header later in the flow, after several HTTP Request operations have run. What should be done at the start of the flow?

- A. Set the HTTP Request operations to propagate inbound headers so the value stays in attributes
- B. Store attributes.headers.'content-type' in a variable, because later operations replace the attributes
- C. Do nothing, because listener attributes remain available as long as the flow keeps running
- D. Read the header later with attributes.originalHeaders, which keeps the listener headers

**Answer:** B

**Explanation:** Each HTTP Request replaces the message attributes with its own response attributes, so the listener header must be saved to a variable first. Listener attributes are not retained, there is no originalHeaders attribute, and HTTP Request has no setting that preserves the listener's inbound headers in attributes.

### Question 4 of 10

A Mule application must connect to different database hosts in dev, test, and prod without rebuilding the deployable JAR. Which approach follows MuleSoft best practice?

- A. Create dev.yaml, test.yaml and prod.yaml property files, load ${env}.yaml in a Configuration properties element, and set env per deployment
- B. Store the host names in an Object Store at startup and read them with a DataWeave lookup each time a Database operation runs
- C. Create three separate Database configurations and select the right one with a Choice router that checks the server host name at runtime
- D. Hard-code the production host in the Database config and change it manually in Anypoint Studio before building for other environments

**Answer:** A

**Explanation:** Environment-specific property files with a placeholder such as ${env}.yaml, where env is supplied at deployment (for example in Runtime Manager properties), let one artifact run everywhere. Editing and rebuilding per environment defeats repeatable deployments. Routing between three configs or reading hosts from an Object Store adds runtime complexity that property placeholders already solve.

### Question 5 of 10

A RAML specification changes by adding a new resource /returns. The team has already implemented logic in the existing scaffolded flows. What should the developer do in Anypoint Studio?

- A. Edit the APIkit Router configuration to ignore the specification, so it forwards /returns requests to any flow
- B. Update the API dependency to the new version and regenerate flows, which adds flows for new resources and keeps existing ones
- C. Delete the project and scaffold a new one from the updated specification, then copy the old logic back in manually
- D. Add a new HTTP Listener with path /returns in a separate flow, because APIkit cannot handle resources added later

**Answer:** B

**Explanation:** Regenerating flows from an updated specification adds flows for new resources and methods without overwriting implemented ones. Re-creating the project throws away work, and bypassing APIkit with an extra listener loses validation. The APIkit Router always routes based on the specification; it cannot be told to ignore it.

### Question 6 of 10

A flow uses a Scatter-Gather with three routes that each call a different backend. All routes succeed. What is the payload after the Scatter-Gather completes?

- A. An object keyed by route index ("0", "1", "2"), where each value is a Mule message with its own payload and attributes
- B. An array containing the three route payloads in the order in which the backend calls finished during execution
- C. The original payload, because route results are only available as variables named after each route's index
- D. The payload produced by the last route, because each route overwrites the payload of the previous route in sequence

**Answer:** A

**Explanation:** Scatter-Gather aggregates results into an object whose keys are the route indexes and whose values are full Mule messages (payload plus attributes). The result is not an array ordered by completion time, and routes run concurrently rather than overwriting each other. The aggregated result replaces the payload; it is not stored in variables.

### Question 7 of 10 (choose 2)

Which TWO statements about Mule 4 error types are correct? (Choose two.)

- A. An error type is identified by a namespace and an identifier, such as HTTP:NOT_FOUND
- B. Custom error types created in error mappings must use the reserved MULE namespace
- C. Error types are Java exception class names that must be caught by full class name
- D. Custom error types can only be raised from Java code in a custom module
- E. The ANY error type matches all errors except critical ones such as overload

**Answer:** A, E

**Explanation:** Mule 4 errors are typed as NAMESPACE:IDENTIFIER, and ANY matches every error except critical ones that cannot be handled. Error types are not Java class names. Custom types such as APP:INVALID_ORDER can be raised with the Raise Error component or created through error mappings without Java, and they use your own namespace because MULE is reserved for runtime errors.

### Question 8 of 10

A DataWeave script must produce an object with a key only when payload.discount exists, otherwise omitting the key entirely. Which body is correct?

- A. { total: payload.total, discount?: payload.discount }
- B. { total: payload.total, discount: if (payload.discount != null) payload.discount }
- C. { total: payload.total, discount: payload.discount default skip }
- D. { total: payload.total, (discount: payload.discount) if (payload.discount != null) }

**Answer:** D

**Explanation:** A key-value pair wrapped in parentheses followed by if is added only when the condition is true. An if expression in the value position needs an else branch and would still create the key, skip is not a DataWeave keyword, and the ? suffix is RAML syntax rather than DataWeave. (Setting skipNullOn on the writer is another way to drop null fields.)

### Question 9 of 10

A Mule application publishes order events to an Anypoint MQ queue. The consuming flow uses the Anypoint MQ Subscriber with the default acknowledgement mode, and a processing error occurs. What happens to the message by default?

- A. It is nacked when the flow fails, so it returns to the queue and is available for redelivery
- B. It is moved at once to a dead-letter queue that Anypoint MQ creates automatically for each queue
- C. It is lost, because Anypoint MQ queues do not persist messages after delivery to a subscriber
- D. It is acknowledged and removed, because the subscriber acknowledges on receipt by default

**Answer:** A

**Explanation:** With the default AUTO acknowledgement mode, a message is acknowledged when the flow completes successfully and nacked when it fails, so it becomes available for redelivery. Messages are not acknowledged on receipt by default (that is IMMEDIATE mode). Dead-letter queues must be configured explicitly, and Anypoint MQ persists messages until they are acknowledged or expire.

### Question 10 of 10

A nightly job must synchronise 500,000 customer records from a database to Salesforce, track success and failure per record, and continue past individual failures. Which construct is MOST suitable?

- A. A Scatter-Gather with one route per thousand records, generated from the result set size
- B. A Batch Job with transformation and loading steps, and a Batch Aggregator for bulk upserts
- C. A For Each scope over the full result set, calling Salesforce Upsert for every single record
- D. A Parallel For Each over the full result set with maxConcurrency equal to the record count

**Answer:** B

**Explanation:** Batch Jobs are designed for large record sets: they queue records persistently, process them in steps, track per-record failures, and allow bulk operations through aggregators. For Each processes sequentially without per-record failure tracking, Parallel For Each at that concurrency would exhaust resources, and Scatter-Gather routes are fixed in configuration.

Ready for a timed run? Take the free 15-question MSMDI mini exam: https://devopscodelab.com/app/exams/salesforce-mulesoft-dev-i/mini/

DevOpsCode Lab is not affiliated with Salesforce. MSMDI and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
