ExamGecko
Home Home / MuleSoft / MCD - Level 1

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

Question list
Search
Search

List of questions

Search

Related questions











A company has defined two RAML fragments, Book Data Type and Book Example to be used in APIs.

What would be valid RAML to use these fragments ?

A.
1. #%RAML 1.0 2. title: Books 3. types: 4. Book: ABC/Examples/bookDataType.raml 5. /books: 6. post: 7. body: 8. application/json: 9. type: Book 10. examples: 11. input: ABC/Examples/bookExample.raml 12. responses: 13. 201: 14. body: 15. application/json: 16. example: 17. message: Book added
A.
1. #%RAML 1.0 2. title: Books 3. types: 4. Book: ABC/Examples/bookDataType.raml 5. /books: 6. post: 7. body: 8. application/json: 9. type: Book 10. examples: 11. input: ABC/Examples/bookExample.raml 12. responses: 13. 201: 14. body: 15. application/json: 16. example: 17. message: Book added
Answers
B.
1. #%RAML 1.0 2. title: Books 3. Book: !include bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: !include bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
B.
1. #%RAML 1.0 2. title: Books 3. Book: !include bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: !include bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
C.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
C.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
D.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
D.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
Suggested answer: D

Explanation:

* RAML file contains lot of information that could be considered as 'not API-describing'. Sort of 'economy-class' members.Equally important, but not necessarily part of the main RAML file.* Through !includes, RAML allows us to build file-distributed API definitions, which is not only useful to encourage code reuse but also improves readability.* We can create RAML fragments with such code and then include them in main RAML project using !include like:types:Book: !include bookDataType.raml andexamples:input: !include bookExample.raml* Additionally for----------------------------------------------------------------------------------------------------------------------------------------Answer:: D

An organization's Center for enablement (C4E)has built foundational assets (API specifications and implementation templates, common frameworks, and best practices guides) and published them to Anypoint Exchange.

What is a metric related to these foundational assets that helps the organization measure the success of it's C4E efforts?

A.
Utilization counts of foundational assets in production applications
A.
Utilization counts of foundational assets in production applications
Answers
B.
Correlation of each foundational asset with the counts of developers that download such asset
B.
Correlation of each foundational asset with the counts of developers that download such asset
Answers
C.
Correlation of key performance indicators (KPI) of production applications with foundational assets
C.
Correlation of key performance indicators (KPI) of production applications with foundational assets
Answers
D.
Count how many Lines Of Business (LoBs) onsumed each foundational asset
D.
Count how many Lines Of Business (LoBs) onsumed each foundational asset
Answers
Suggested answer: C

Explanation:

Below are the Key performance indicators (KPIs), to measure and track the and success of the C4E and its activities, as well as the growth and health of the application network. Most of the metrics can be extracted automatically, through REST APIs, from Anypoint Platform.

* # of assets published to Anypoint Exchange

* # of interactions with Anypoint Exchange assets

* # of APIs managed by Anypoint Platform

* # of System APIs managed by Anypoint Platform

* # of API clients registered for access to APIs

* # of API implementations deployed to Anypoint Platform

* # of API invocations

* # or fraction of lines of code covered by automated tests in CI/CD pipeline

* Ratio of info/warning/critical alerts to number of API invocations

Refer to the exhibit.

The default scope in choice router recursively calls the color flow.

A web client sends a PUT request to the HTTP listener with payload Blue.

What response is returned to the web client?

A.
'Blk'
A.
'Blk'
Answers
B.
'Green'
B.
'Green'
Answers
C.
A timeout error
C.
A timeout error
Answers
D.
['Blue', 'Red', 'Blk']
D.
['Blue', 'Red', 'Blk']
Answers
Suggested answer: C

Explanation:

Sequence can be described as follows.

* When web client sends the request , it sends payload as Blue (mentioned in question)

* In first iteration this will go to default choice , which sets payload to Red

* Via default route , flow will call itself with payload as Red

* In second iteration , as payload is Red , it will go to first route in choice router which will set payload to Blk and second iteration will end returning back payload as Blk to first iteration.

* This Blk will be again set to payload and first iteration will end returning back response as Blk

Refer to the exhibits.

The mule application is debugged in Anypoint Studio and stops at the breakpoint as shown in below exhibit.

What is the value of the payload displayed in the debugger at this breakpoint?

A.
Start
A.
Start
Answers
B.
Process
B.
Process
Answers
C.
Finished
C.
Finished
Answers
D.
Payload is always empty at the breakpoint
D.
Payload is always empty at the breakpoint
Answers
Suggested answer: A

Explanation:

Setting Breakpoints

To set breakpoints, right-click a building block, then select Toggle Breakpoint.

Studio applies a red dot to the building block's icon on the canvas.

When you run your application in Debug mode, Studio stops the flow execution at the breakpoint you have set, allowing you to check the Mule Event content in the Mule Debugger View.

Mule Ref Doc :Setting Breakpoints | MuleSoft Documentation

Refer to the exhibits.

The Batch job processes an array of strings.

What information is logged by the logger component after the batch job scope completes processing of the input payload?

A.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0 payload: ['A','B','C']
A.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0 payload: ['A','B','C']
Answers
B.
['A','B','C']
B.
['A','B','C']
Answers
C.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0 payload: ['a', 'b', 'c']
C.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0 payload: ['a', 'b', 'c']
Answers
D.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0
D.
Total Records Processed: 3 Successful Records: 3 Failed Records: 0
Answers
Suggested answer: D

Explanation:

Correct answer is as below.On complete phase only has access to batch job result statistics and payload is not available.

Total Records Processed: 3

Successful Records: 3

Failed Records: 0

On Complete

During this phase, you can optionally configure the runtime to create a report or summary of the records it processed for the particular batch job instance. This phase exists to give system administrators and developers some insight into which records failed to address any issues that might exist with the input data.

Sample output is as below

Mule Ref Doc :https://docs.mulesoft.com/mule-runtime/4.3/batch-processing-concept#on-complete

Refer to the exhibits.

Set paylaod transformer is set the firstName and lastName of the customer as shown in below images.

What is the correct Dataweave expression which can be added in message attribute of a Logger activity to access firstName (which in this case is Madhav) from the incoming event?

A.
firstName
A.
firstName
Answers
B.
customer.firstName
B.
customer.firstName
Answers
C.
vars.'customer.firstName'
C.
vars.'customer.firstName'
Answers
D.
vars.'customer'.'firstName'
D.
vars.'customer'.'firstName'
Answers
Suggested answer: D

Explanation:

Correct answer is vars.'customer'.'firstName'

Please note that you can also access firstName using this syntax vars.customer.firstName.

Mule Ref Doc :Variables in Mule Apps | MuleSoft Documentation

A REST connect module is generated for a RAML specification. and then the rest connect module is imported in mule application in Anypoint Studio. For each method of the RAML specification , what does the REST connect module provide?

A.
A scope
A.
A scope
Answers
B.
A flow
B.
A flow
Answers
C.
An operation
C.
An operation
Answers
D.
An event source
D.
An event source
Answers
Suggested answer: B

Explanation:

Correct answer is an operation. For each method of the RAML specification , REST connect module provide an operation.

Please refer to the below screenshot.

Refer to the exhibits.

The Batch Job scope contains two Batch Steps scopes with different accept expression.

The input payload is passed to the Batch Job scope.

After the entire payload is processed by the batch job scope , what messages have been logged by the Logger component?

A.
1. {amount=140} 2. {amount=102} 3. {step2amount=100}
A.
1. {amount=140} 2. {amount=102} 3. {step2amount=100}
Answers
B.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=40}
B.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=40}
Answers
C.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140}
C.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140}
Answers
D.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140} 5. {step2amount=102}
D.
1. {amount=140} 2. {amount=102} 3. {step2amount=100} 4. {step2amount=140} 5. {step2amount=102}
Answers
Suggested answer: D

Explanation:

This question validates you knowledge on Batch Processing. Before we analyze the question , lets revise a bit about batch filters.

Batch Filters

You can apply one or more filters as attributes to any number of batch steps.

Imagine a batch job whose first batch step checks if a Salesforce contact exists for a record, and a second batch step that updates each existing Salesforce contact with new information. You can apply a filter to the second batch step to ensure it only processes records that didn't fail during the first batch step.

By having batch steps accept only some records for processing, you streamline the batch job so the Mule runtime engine can focus only on the relevant data for a particular batch step.

A batch step uses two attributes to filter records:

acceptExpression

acceptPolicy

Each batch step can accept oneacceptExpressionand oneacceptPolicyattributes to filter records.

Use theacceptExpressionattribute to process only records that evaluate to true; if the record evaluates to false, the batch step skips the record and sends it to the next one. In other words, the records with an accept expression that resolves to false are the ones that Mule filtersout.

The example below filters out all records where the age is less than 21; the batch step does not process those records.

<batch:job jobName='batchJob'>

<batch:process-records >

<batch:step name='adultsOnlyStep' acceptExpression='#[payload.age > 21]'>

...

</batch:step>

</batch:process-records>

</batch:job>

Mule Ref Doc :Refining Batch Steps Processing | MuleSoft Documentation

As we are clear with above concepts , now lets understand this solution step by step.

1) Batch Step (Less than 50)

Accept expression for this batch step is less than 50. Hence elements which will go in this batch step are amount value 40 and 2. Hence output of logger in first batch step is

{amount=140}

{amount=102}

2) Batch Step (Greater than 20)

Accept condition for this batch step is greater than 20. Note that input amount values for this batch step are 100 , 140 and 102 (last two values have been updated in batch step less than 50)

As all values satisfy this condition out put of second logger is

{step2amount=100}

{step2amount=140}

{step2amount=102}

Hence correct answer to this question is

{amount=140}

{amount=102}

{step2amount=100}

{step2amount=140}

{step2amount=102}

2) Batch Step (Greater than 20)

Accept condition for this batch step is greater than 20. Note that input amount values for this batch step are 100 , 140 and 102 (last two values have been updated in batch step less than 50)

As all values satisfy this condition out put of second logger is

{step2amount=100}

{step2amount=140}

{step2amount=102}

Hence correct answer to this question is

{amount=140}

{amount=102}

{step2amount=100}

{step2amount=140}

{step2amount=102}

Refer to the exhibit.

How should be the where clause written for the configured input parameters in such a way that it achieves below SQL query?

A.
WHERE city := ${city} AND state := ${state}
A.
WHERE city := ${city} AND state := ${state}
Answers
B.
WHERE city = attributes.city AND state = attributes.state
B.
WHERE city = attributes.city AND state = attributes.state
Answers
C.
WHERE city = :city AND state = :state
C.
WHERE city = :city AND state = :state
Answers
D.
WHERE city := city AND state := state
D.
WHERE city := city AND state := state
Answers
Suggested answer: C

Explanation:

Correct syntax to use where clause isWHERE city = :city AND state = :state

This question validates knowledge on using dynamic queries in DBselect operation.

Configure Dynamic Queries in the Select Operation

When you need to parameterize not only theWHEREclause but also parts of the query itself (for example, queries that compare tables that depend on a condition, or complex queries for which the project table columns need to vary), you can configure dynamic queries.

In the following example, you configure a dynamic query by using a full expression with a string in which the table depends on a variable$(vars.table). Although some of the query text is dynamic ('SELECT * FROM $(vars.table)), theWHEREclause still defines theWHEREcondition using input parameters: in this case,WHERE name = :name.

In your Studio flow, select theSelectoperation.

In the operation configuration screen, set theSQL Query Textfield toSELECT * FROM $(vars.table) WHERE name = :name.

Set theInput Parametersfield to{'name' : payload}.

The following screenshot shows the configuration in Studio:

Figure 3. Dynamic query configuration

In the XML editor, the<db:sql>configuration looks like this:

<set-variable variableName='table' value='PLANET'/>

<db:select config-ref='dbConfig'>

<db:sql>#['SELECT * FROM $(vars.table) WHERE name = :name']</db:sql>

<db:input-parameters>

#[{'name' : payload}]

</db:input-parameters>

</db:select>

You can apply input parameters only to parameters in aWHEREclause. To modify any other part of the query, use the DataWeave interpolation operator.

Mule Ref Doc:Query a Database Examples - Mule 4 | MuleSoft Documentation

A shopping API contains a method to look up store details by department.

To get the information for a particular store, web clients will submit requests with a query parameter named department and uri parameter named storeId

What is valid RAML snippet that supports requests from a web client to get a data for a specific storeId and department name?

A.
1. /department: 2. get: 3. uriParameter: 4. storeId:
A.
1. /department: 2. get: 3. uriParameter: 4. storeId:
Answers
B.
1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department:
B.
1. get: 2. uriParameter: 3. {storeId}: 4. queryParameter: 5. department:
Answers
C.
1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}:
C.
1. get: 2. queryParameter: 3. department: 4. uriParameter: 5. {storeId}:
Answers
D.
1. /{storeId}: 2. get: 3. queryParameter: 4. department:
D.
1. /{storeId}: 2. get: 3. queryParameter: 4. department:
Answers
Suggested answer: D

Explanation:

Lets revise few concepts RAML which can help us to find the answer of this question.

URI Parameters

Lets have a look at below example.

/foos:

/{id}:

/name/{name}:

Here, the braces { } around property names define URI parameters. They represent placeholders in each URI and do not reference root-level RAML file properties as we saw above in thebaseUrideclaration. The added lines represent the resources/foos/{id}and/foos/name/{name}.

Query Parameters

Now we'll define a way to query thefooscollection using query parameters. Note that query parameters are defined using the same syntax that we used above for data types:

/foos:

get:

description: List all Foos matching query criteria, if provided;

otherwise list all Foos

queryParameters:

name?: string

ownerName?: string

Based on the above information , below is the only option which definesstoreidas uri parameter anddepartmentas query parameter.

/{storeId}:

get:

queryParameter:

department:

Total 235 questions
Go to page: of 24