ExamGecko
Home Home / MuleSoft / MCD - Level 1

MuleSoft MCD - Level 1 Practice Test - Questions Answers, Page 22

Question list
Search
Search

List of questions

Search

Related questions











Refer to the exhibits. In the choice router, the When expression for the domestic shipping route is set to '#[payload= 'FR']'.

What is the output of logger after the execution of choice router is completed?

A.
'Domestic'
A.
'Domestic'
Answers
B.
'International'
B.
'International'
Answers
C.
'US'
C.
'US'
Answers
D.
A dataweave syntax error
D.
A dataweave syntax error
Answers
Suggested answer: D

Explanation:

To compare, DataWeave syntax is #[payload == 'FR'].

In this case only one = is used so it will give syntax error.

Hence the correct answer isA dataweave syntax error

Refer to the below exhibit.

A Mule application configures a property placeholder file named config.yaml to set some property placeholders for an HTTP connector.

What is the valid properties placeholder file to set these values?

A.
1. http: 2. host = 'localhost' 3. port = '8081'
A.
1. http: 2. host = 'localhost' 3. port = '8081'
Answers
B.
1. http: 2. basepath: 'api' 3. host : 'localhost' 4. port : '8081'
B.
1. http: 2. basepath: 'api' 3. host : 'localhost' 4. port : '8081'
Answers
C.
1. http.host = localhost 2. http.port = 8081
C.
1. http.host = localhost 2. http.port = 8081
Answers
D.
1. { 2. http: 3. basePath: 'api', 4. port: '8081', 5. host: ' localhost'
D.
1. { 2. http: 3. basePath: 'api', 4. port: '8081', 5. host: ' localhost'
Answers
Suggested answer: B

Explanation:

Correct answer is as below as it follows the correct syntax.

http:

basepath: 'api'

host : 'localhost'

port : '8081'

Mule Doc Reference :https://docs.mulesoft.com/mule-runtime/4.3/mule-app-properties-to-configure

Following Mulesoft's recommended API-led connectivity approach , an organization has created an application network. The organization now needs to create API's to transform , orchestrate and aggregate the data provided by the other API's in the application network. This API should be flexible enought ot handle the data from additional API's in future.

According to Mulesoft's recommended API-led connectivity approach , what is the best layer for this new API?

A.
Process layer
A.
Process layer
Answers
B.
System layer
B.
System layer
Answers
C.
Experience layer
C.
Experience layer
Answers
D.
Data layer
D.
Data layer
Answers
Suggested answer: A

Explanation:

Correct answer isprocess layeras all the orchestration and transformation logic should be in process layer as per Mulesoft's recommended approach for API led connectivity.

API-led connectivity is a methodical way to connect data to applications through reusable and purposeful APIs. These APIs are developed to play a specific role -- unlocking data from systems, composing data into processes, or delivering an experience.

What are the APIs that enable API-led connectivity?

API-led connectivity provides an approach for connecting and exposing assets. With this approach, rather than connecting things point-to-point, every asset becomes a managed API -- a modern API, which makes it discoverable through self-service without losing control.

The APIs used in an API-led approach to connectivity fall into three categories:

System APIs-- these usually access the core systems of record and provide a means of insulating the user from the complexity or any changes to the underlying systems. Once built, many users, can access data without any need to learn the underlying systems and can reuse these APIs in multiple projects.

Process APIs-- These APIs interact with and shape data within a single system or across systems(breaking down data silos)and are created here without a dependence on the source systems from which that data originates, as well as the target channels through which that data is delivered.

Experience APIs-- Experience APIs are the means by which data can be reconfigured so that it is most easily consumed by its intended audience, all from a common data source, rather than setting up separate point-to-point integrations for each channel. An Experience API is usually created with API-first design principles where the API is designed for the specific user experience in mind.

Refer to the exhibits.

As a mulesoft developer, what you would change in Database connector configuration to resolve this error?

A.
Configure the correct host URL
A.
Configure the correct host URL
Answers
B.
Configure the correct database name
B.
Configure the correct database name
Answers
C.
Configure the correct table name
C.
Configure the correct table name
Answers
D.
Configure the correct JDBC driver
D.
Configure the correct JDBC driver
Answers
Suggested answer: D

Explanation:

Correct answer isConfigure the correct JDBC driveras error message suggests the same

Caused by: java.sql.SQLException: Error trying to load driver: com.mysql.jdbc.Driver : Cannot load class 'com.mysql.jdbc.Driver': [

Class 'com.mysql.jdbc.Driver' has no package mapping for region 'domain/default/app/mule_app'.,

Cannot load class 'com.mysql.jdbc.Driver': [

Refer to the exhibits.

What payload and variable are logged at the end of the main flow?

A.
[[5, 10, 15, 20], 1]
A.
[[5, 10, 15, 20], 1]
Answers
B.
[[5, 10, 15, 20], 5]
B.
[[5, 10, 15, 20], 5]
Answers
C.
[[Req5, Req10, Req15, Req20], 5]
C.
[[Req5, Req10, Req15, Req20], 5]
Answers
D.
[Req5Req10,Req15Req20, 5]
D.
[Req5Req10,Req15Req20, 5]
Answers
Suggested answer: B

Explanation:

Correct answer is [[5, 10, 15, 20], 5]

Key thing to note here is that any changes made to payload in for each loop are not available outside for each scope where as variable value updated in for each loop is visible out side for each loop too.

In this example , sequence can be described as follows

1) Payload is set to the value [5, 10, 15, 20]

2) Variable is set to the value of 1

3) For each loop is executed four times and in each loop payload value is updated to append 'Req' and variable is count is increased by 1

4) Once control comes out of for each , payload changes made within for each are not visible. Hence payload at this point of time is equal to payload available before entering for each loop which was [5, 10, 15, 20]. Similarly variable value updated in for each loop is also available outside hence variable value is 5 as it was updated in loop.

5) Hence correct answer is [[5, 10, 15, 20], 5]

For Each Scope

The For Each scope splits a payload into elements and processes them one by one through the components that you place in the scope. It is similar to afor-each/forloop code block in most programming languages and can process any collection, including lists and arrays. The collection can be any supported content type, such asapplication/json,application/java, orapplication/xml.

General considerations about the For Each scope:

By default, For Each tries to split the payload. If the payload is a simple Java collection, the For Each scope can split it without any configuration. The payload inside the For Each scope is each of the split elements. Attributes within the original message are ignored because they are related to the entire message.

For Each does not modify the current payload. The output payload is the same as the input.

For non-Java collections, such as XML or JSON, use a DataWeave expression to split data. Use theCollectionfield for this purpose.

What is output of Dataweave flatten function?

A.
Object
A.
Object
Answers
B.
Map
B.
Map
Answers
C.
Array
C.
Array
Answers
D.
LInkedHashMap
D.
LInkedHashMap
Answers
Suggested answer: C

Explanation:

Correct answer is Array.

Flatten turns a set of subarrays (such as [ [1,2,3], [4,5,[6]], [], [null] ]) into a single, flattened array (such as [ 1, 2, 3, 4, 5, [6], null ]).

This example defines three arrays of numbers, creates another array containing those three arrays, and then uses the flatten function to convert the array of arrays into a single array with all values.

Source

%dw 2.0

output application/json

var array1 = [1,2,3]

var array2 = [4,5,6]

var array3 = [7,8,9]

var arrayOfArrays = [array1, array2, array3]

---

flatten(arrayOfArrays)

Output

[ 1,2,3,4,5,6,7,8,9 ]

Refer to the exhibits. In the color flow , both the variable named color and payload are set to 'red'.

An HTTP POST request is then sent to the decideColor flow's HTTP Listener.

What is the payload value at the Logger component after the HTTP request completes?

A.
white
A.
white
Answers
B.
red
B.
red
Answers
C.
blue
C.
blue
Answers
D.
Error message
D.
Error message
Answers
Suggested answer: C

Refer to the exhibits. APIKit router is used to generate the flow components for RAML specification.

The Mule application must be available to REST clients using the two URL's

http://localhost:8081/internal and http://localhost:8081/external

How many APIKit Router components are generated to handle requests to every endpoint defined in RAML specification?

1. Library.raml

2. /books

3. get:

4. post:

5. /order:

6. get

7. patch

8. /members

9. get:

A.
1
A.
1
Answers
B.
2
B.
2
Answers
C.
3
C.
3
Answers
D.
5
D.
5
Answers
Suggested answer: A

Refer to the exhibits.

The mule application implements a REST API that accepts GET request from two URL's which are as follows

1) http://acme.com/order/status

2) http://acme.com/customer/status

What path value should be set in HTTP listener configuration so that requests can be accepted for both these URL's using a single HTTP listener event source?

A.
*[order,customer]/status
A.
*[order,customer]/status
Answers
B.
?[order,customer]/status
B.
?[order,customer]/status
Answers
C.
*/status
C.
*/status
Answers
D.
*status
D.
*status
Answers
Suggested answer: C

Explanation:

Correct answer is */status as it is the correct way to use wildcards while configuring path value in HTTP listener

What HTTP method in a RESTful web service is typically used to completely replace an existing resource?

A.
GET
A.
GET
Answers
B.
PATCH
B.
PATCH
Answers
C.
PUT
C.
PUT
Answers
D.
POST
D.
POST
Answers
Suggested answer: C

Explanation:

PUT replaces the original version of the resource, whereas the PATCH method supplies a set of instructions to modify the resource

Total 235 questions
Go to page: of 24