Salesforce certification · Exam Salesforce-MuleSoft-Developer

Salesforce-MuleSoft-Developer Mock Exam Page 6

Salesforce MuleSoft Developer - Mule-Dev-201

Free Salesforce-MuleSoft-Developer mock exam questions 51–60, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free Salesforce-MuleSoft-Developer questions

51–60 of 67 free
Question 51 Choose 1
Refer to the exhibit.

What is the correct syntax to add a customer ID as a URI parameter in an HTTP Listener's path attribute?
Show answerHide answer

Correct answer: B {customerlD}

Explanation

Explanation:

URI Parameter Syntax: When defining an HTTP Listener's path in Mule 4, URI parameters (also known as path parameters) are defined using curly braces ({}) around the parameter name.

Example: If the Listener path is set to /accounts/{customerID}, a request to /accounts/12345 will be accepted.

Accessing the Parameter: The value of the URI parameter (12345 in the example) is then automatically extracted and made available in the Mule event as an attribute under attributes.uriParams.customerID.

❌ Incorrect Answers and Reasoning
A. (customerID): Parentheses are not the correct syntax for defining URI parameters in a Mule HTTP Listener path. This syntax is not used for this purpose in Mule.

C. #[customerID]: The #[...] syntax is used for DataWeave expressions to dynamically access variables, payloads, or attributes during message processing (runtime). It is not the correct way to define a path parameter in the Listener's configuration.

D. ${customerID}: The ${...} syntax is used for Mule Configuration Properties (placeholders) that are resolved when the application starts up. This is used for defining environment-specific values (like ports or credentials) from a properties file, not for defining variable parts of a request URI.

πŸ“š References
MuleSoft Documentation on HTTP Listener: "The path parameter is defined by enclosing its name in curly braces (e.g., /users/{id}) in the Listener's path configuration."

MuleSoft Documentation on URI Parameters: "URI parameters are accessible in a flow using the DataWeave expression attributes.uriParams."
Question 52 Choose 1
Refer to the exhibits.

What DataWeave expression transforms the conductorIds array to the XML output?
Show answerHide answer

Correct answer: C 1. 1. trains:
2. 2. {(
3. 3. conductorIds map ((engId, index) ->
4. 4. train: {
5. 5. engineerId: engId
6. 6. }
7. 7. )
8. 8. )}

Explanation

Explanation:

This DataWeave expression correctly transforms the array conductorIds = [592, 921] into the desired XML structure:

Let’s break it down:

trains: defines the root element.

{(...)}: wraps the result of the map operation inside the trains object.

conductorIds map (...): iterates over each ID.

train: { engineerId: engId } creates a train element with a nested engineerid.

The parentheses around the map block ({(...)}) are crucial β€” they ensure the mapped array is unwrapped into individual train elements inside trains.

❌ Why the Other Options Are Incorrect:
A. Missing outer braces {(...)}: β€” would cause a syntax error or incorrect structure.
B. Wraps everything in { trains: ... } but lacks the unwrapping parentheses: β€” results in a nested array inside trains, not individual elements.
D. Starts with {( trains: ... )}: β€” invalid syntax; the placement of {( is incorrect.

πŸ”— Reference:
MuleSoft Docs – DataWeave XML Output
DataWeave Language Guide – Mapping and Object Construction
Question 53 Choose 1
Refer to the exhibit.



The main flow contains a Flow Reference for the child flow.
What values are accessible in the child flow after a web client submits a request to http://localhost:8Q81/order? color=red?
Show answerHide answer

Correct answer: D payload quantity var color query param

Explanation

Explanation:

When a Flow Reference component is used to call another flow, the entire Mule event (including its current state) is passed from the parent flow to the child flow. The child flow operates on the same event instance, unless an error occurs or the event is explicitly altered.

Let’s trace what is available in the child flow when it is called from the main flow:

Initial Request: The web client sends GET /order?color=red.

HTTP Listener (main flow): This component creates the initial event.

payload: The payload is set to the body of the HTTP request. For a GET request with no body, this is typically an empty string or null, but the payload variable exists and is accessible.

attributes: The HTTP request attributes (headers, query params, etc.) are stored here. Specifically, the query parameter color=red is accessible via attributes.queryParams.color or simply attributes.queryParams['color'].

Set Variable (main flow): The processor executes.

vars.quantity: This variable (quantity) is now part of the event and is set to 1.

Flow Reference (main flow): The child flow is invoked. At the moment of invocation, the event contains:

- The current payload.
- The current attributes (including the color query param).
- The current variables (including quantity).

All of these components (payload, vars.quantity, attributes.queryParams.color) are accessible in the child flow because they are part of the same event context passed by reference.

Why the others are incorrect:
A. payload: This is true but incomplete. The child flow has access to much more than just the payload.

B. payload quantity var: This is also incomplete. It misses the HTTP query parameters, which are a key part of the request and stored in attributes.

C. payload color query param: This is incomplete. It misses the quantity variable that was explicitly set in the main flow before the Flow Reference.

Reference:
MuleSoft Documentation - Flow Reference Component and Mule Event Structure. The documentation states that flows called via Flow Reference share the same Mule event, meaning all its parts (payload, attributes, variables, error) are accessible. This tests knowledge from the Controlling Message Flow (19%) and Handling Errors (22%) domains, specifically regarding event propagation between flows.
Question 54 Choose 1
Refer to the exhibits.



The Set Payload transformer's value is set to {'year': '2020'}.
What message value should be added to the Logger component to output the message 'The year is 2020', without hardcoding 2020?
Show answerHide answer

Correct answer: D #["The year is "++ payload.year].

Explanation

Explanation:

The payload is:
{ "year": "2020" }

To log:
The year is 2020

β€’ Without hardcoding 2020
β€’ Using valid DataWeave expression syntax inside the Logger

You need:
βœ” String concatenation
DataWeave uses ++ for concatenation:
"The year is " ++ payload.year

Wrapped in an expression:
#["The year is " ++ payload.year]

This matches Option D.

❌ Why the other options are incorrect
A. '#[The year is $(payload.year)]'
${} syntax is for property placeholders, not DW.
Wrong DW syntax.

B. 'The year is #[payload.year]'
Mixing literal text + DW expression is invalid without proper formatting.
DW inside quotes is not evaluated.

C. '#[The year is " + payload.year]'
Uses Java-style string concatenation (+) which is invalid in DW.
Missing quotes around the literal string.
Question 55 Choose 1
Which out of below is not an asset?
Show answerHide answer

Correct answer: C Exchange

Explanation

Explanation:

In the context of Anypoint Platform and MuleSoft's terminology, an asset is a reusable component or piece of content that can be developed, shared, and deployed. The Anypoint Exchange is the central repository where these assets are stored, discovered, and managed.

Let’s break down each option:

A. Template: Is an asset. Templates are pre-built project skeletons (e.g., API-led connectivity templates, Salesforce integration templates) available in Exchange to accelerate development.

B. Connector: Is an asset. Connectors (like Salesforce, Database, HTTP) are modular components published to Exchange that provide connectivity to external systems. They are installed as dependencies in a Mule project.

C. Exchange: Is NOT an asset. Anypoint Exchange is the platform service or portal itselfβ€”the marketplace or repository where assets (like Templates, Connectors, Examples, RAML specs, and Policies) are stored and shared. It is the container, not the content.

D. Example: Is an asset. Examples are specific, illustrative instances of code, configurations, or projects shared on Exchange to demonstrate how to use an API, connector, or other asset.

Therefore, Exchange is the service that hosts the assets, making it the item that is not classified as an asset itself.

Reference:
MuleSoft Documentation - Anypoint Exchange. The documentation describes Exchange as "a built-in, central repository for discovering, sharing, and reusing assets," clearly differentiating the repository from the assets it contains. This concept is part of the foundational knowledge for the Understanding MuleSoft (10%) domain.
Question 56 Choose 1
Refer to the exhibits.



A web client sends sale data in a POST request to the Mule application. The Transform Message component then enrich the payload by prepending a vendor name to the sale data. What is written to the sales.csv file when the flow executes?
Show answerHide answer

Correct answer: A The enriched payload in JSON format

Explanation

Explanation:

Why A is correct
Look at the Transform Message component in the exhibit:
%dw 2.0
output application/json
---
{
vendor: "Acme" ++ payload.sale]!,
sale: payload
}

It explicitly sets output application/json and builds a JSON object that contains:
- a new field vendor: "Acme" plus the original data
- the original sale object unchanged

So after the Transform Message, the payload is JSON like:
{
"vendor": "Acme",
"sale": {
"transaction_id": "SS-4848-44KK-45YQ",
"customer_id": "anniepoint@acme.com",
...
}
}

The File Write operation that follows has no DataWeave transformation or output format override defined.
When a File connector receives application/json payload and no writer configuration is specified, it writes the payload exactly as-is β€” in this case, the JSON string.
Therefore, the content written to sales.csv is the enriched JSON payload (not CSV, not XML).

Why the other options are wrong
B. The enriched payload in XML format – Wrong. The Transform Message outputs application/json, not application/xml.
C. The enriched payload in CSV format – Wrong. There is no CSV writer or output application/csv anywhere in the flow.
D. An error message – Wrong. Nothing in the flow will fail β€” the expression is valid and the File Write succeeds.

Even though the file is named sales.csv, Mule does not automatically convert JSON to CSV just because of the file extension.
Question 57 Choose 1
How can you call a subflow from Dataweave?
Show answerHide answer

Correct answer: C Lookup function

Explanation

Explanation:

In Mule 4, DataWeave is a powerful transformation language that is tightly integrated with the Mule runtime. One of its advanced capabilities is the ability to invoke Mule flows (including sub-flows) directly from within a DataWeave script using the lookup function.

Purpose: The lookup function allows DataWeave to call a flow by its name, pass a payload (and optionally variables), and receive the flow's result. This enables complex, flow-based logic (like calling external systems, performing business rules, or database operations) to be embedded within a data transformation.

Syntax: The basic syntax is lookup("flowName", payload) or lookup("flowName", payload, vars).

Example:
%dw 2.0
output application/json
---
{
originalData: payload,
processedResult: lookup("myProcessingSubflow", payload.someField)
}

Why the others are incorrect:
A. Not possible in Mule 4: This is false. Mule 4 specifically introduced this powerful integration feature.

B. Import function: The import directive in DataWeave is used to import DataWeave modules (.dwl files) containing reusable functions or declarations, not to call Mule flows.

D. Include function: There is no standard include function for flow invocation in DataWeave. The include directive is used in XML configuration files (like Mule config files) to include other XML resources.

Reference:
MuleSoft Documentation - DataWeave lookup Function. The official documentation details how to use lookup to call flows and sub-flows, passing parameters and handling results. This is an advanced feature within the Transforming Data (12%) and Processing Data (22%) domains.
Question 58 Choose 1
A Mule project contains a DataWeave module like WebStore.dwl that defines a function named loginUser. The module file is located in the project's src/main/resources/libs/etl folder. What is correct DataWeave code to import all of the WebStore.dwl file's functions and then call the loginUser function for the login "Todd.Pal@mulesoft.com"?
Show answerHide answer

Correct answer: D 1. 1. import * from libs::etl::WebStore 2. 2. --- 3. 3. loginUser("Todd.Pal@mulesoft.com")

Explanation

Explanation:

In DataWeave 2.0, to import functions from a module file, you use the import directive. The path is constructed using double colons :: to represent directory separators, and the file extension (.dwl) is omitted.

Breaking down the correct import:
Module location: src/main/resources/libs/etl/WebStore.dwl

The src/main/resources directory is the root for DataWeave modules.
Therefore, the module path is: libs::etl::WebStore

import * from libs::etl::WebStore imports all functions from that module into the current namespace, allowing you to call loginUser() directly.

Why the other options are incorrect:
A) import libs.etl – This is invalid syntax. DataWeave uses :: separators, not dots. Also, you must specify the filename (WebStore), not just the folder.

B) import * from libs::etl – This tries to import from a directory (etl), not a module file (WebStore). You must import from the specific .dwl file.

C) import libs.etl.WebStore – Uses dot notation (.) instead of the correct double colon (::) syntax.

Key DataWeave Module Import Rules:
- Path separators are ::, not . or /.
- Omit the .dwl extension in the import statement.
- The path is relative to src/main/resources.
- import * from imports all functions so they can be called directly by name.

Reference:
This follows DataWeave 2.0 documentation on module imports, specifically the syntax for importing from custom modules in the resources folder. The pattern import * from some::path::ModuleName is standard.
Question 59 Choose 1
Which keyword do you use to create a new function in DataWeave?
Show answerHide answer

Correct answer: B fun

Explanation

Explanation:

βœ… Correct Option:

B. fun
In DataWeave, the keyword fun is used to define a new function. This is the official and syntactically correct declarative keyword for creating anonymous functions, which can be assigned to variables or used inline. For example: var myFunction = fun(x) -> x * 2.

❌ Incorrect Options:

A. function
This is incorrect. While function is a common keyword in many other programming languages like JavaScript, it is not the keyword used for function definition in the DataWeave language. Using function will result in a syntax error.

C. func
This is incorrect. func is an abbreviation sometimes used in other languages but is not valid syntax in DataWeave. The language specification requires the use of fun to declare a function.

D. map
This is incorrect. map is a higher-order function in DataWeave used to apply a transformation to every element of an array. It is not a keyword for creating a new function but rather a function that consumes another function as an argument.

πŸ“‹ Summary:
DataWeave has its own specific syntax for function definition. To create an anonymous function, the correct and required keyword is fun, followed by the parameters and the function body. This is a fundamental part of the language's syntax for defining reusable transformation logic.

πŸ”— Reference:
MuleSoft Documentation: DataWeave - Functions (The documentation shows examples using the fun keyword).
Question 60 Choose 1
An API instance of type API endpoint with API proxy is created in API manager using an API specification from Anypoint Exchange. The API instance is also configured with an API proxy that is deployed and running in CloudHub.

An SLA- based policy is enabled in API manager for this API instance.

Where can an external API consumer obtain a valid client ID and client secret to successfully send requests to the API proxy?
Show answerHide answer

Correct answer: A In the organization's public API portal in Anypoint Exchange, from an approved client application for the API proxy

Explanation

Explanation:

βœ… Correct Option

A. In the organization's public API portal in Anypoint Exchange, from an approved client application for the API proxy 🟒
When an SLA-based policy (like Rate Limiting or Throttling) is applied, MuleSoft enforces client ID and client secret validation. These credentials are issued when an external API consumer registers their client application through the API portal in Anypoint Exchange. Once the application is approved, the client gets a valid client ID and client secret to access the API proxy successfully.

❌ Incorrect Options

B. In Anypoint Studio, from components generated by APIkit for the API specification πŸ”΄
APIkit scaffolds flows in Anypoint Studio based on the API specification, but it does not provide client credentials for consumers. It is a developer tool for building APIs, not a distribution point for consumer authentication details.

C. In Anypoint Studio, from components generated by Rest Connect for API specification πŸ”΄
Rest Connect helps generate reusable connectors from REST APIs but does not issue client IDs or secrets. Like APIkit, it is focused on simplifying integration, not consumer identity management.

D. In Runtime Manager, from the properties tab of the deployed approved API proxy πŸ”΄
Runtime Manager shows deployment properties, logs, and monitoring details, but it does not provide client credentials. Only Anypoint Exchange, via the API portal, manages client applications and their credentials.

πŸ“˜ Summary
In this case, the API proxy is deployed in CloudHub and protected by an SLA-based policy. API consumers must obtain valid client credentials. These credentials are created when the consumer registers and gets approval for their client application in the organization’s API portal in Anypoint Exchange. This ensures controlled and secure access to the API proxy.

πŸ”— Reference
MuleSoft Documentation – Managing Client Applications
Full mock exam

Sit the Salesforce-MuleSoft-Developer exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real Salesforce-MuleSoft-Developer exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full Salesforce-MuleSoft-Developer mock exam
  • 65questions per mock
  • 105 mintime limit
  • 234questions in the bank
  • Newmock on every attempt