Skip to main content

Mulesoft Interview Questions With Answers - Part 1

Bonjour!


What is Mulesoft?

The first and the most basic question asked in Mulesoft developer interviews. 

Mulesoft, is the vendor that provides an integration platform to help businesses connect data, applications, and devices.

Mule, is the runtime engine of Anypoint Platform. It is a lightweight Java-based enterprise service bus (ESB) that allows developers to connect applications and exchange data.


What is the difference between map and mapObject?

map operator is used for array. It takes an array as input and returns an array.

mapObject operator is used for object with key: value pairs. It takes an object as input and returns an object.


map invokes lambda with two parameters: value and index from the input array. 

Example:

%dw 2.0
output application/json
---
["apple", "orange", "banana"] map (value, index) -> { 
    (index) : value}

Output:

[ { "0": "apple" }, { "1": "orange" }, { "2": "banana" } ]


mapObject invokes lambda with keyvalue, or index for mapping given object.

Example:

%dw 2.0
output application/json
---
{"chandler":"bing","monica":"geller"} mapObject (value,key,index) -> { 
    (index) : { (value):key} }

Output:

{ "0": { "bing": "chandler" }, "1": { "geller": "monica" } }


What is API-led connectivity?

API-led connectivity is a methodical way to connect applications to data through reusable APIs. APIs are created in three distinct layers: Experience, Process, and System.



Variables in Mule 4 vs Mule 3?

In Mule 3, we had three types of variables: Session variables, Record variables, and Flow variables.

In Mule 4, we only have Flow variables. These variables can be accessed using the keyword "vars".

Example:

vars.variableName


Error Handling in Mule 4?

Error handling in Mule 4 is redesigned. It has three mechanisms to handle errors now.

1. On-Error Propagate:  In an On-error Propagate scope, when an error occurs, it terminates the current execution of flow and then throws the error to its parent flow where it's handled.

2. On-Error Continue: In case of an error in an On-error Continue scope, the execution of the flow continues as if successful sending a 200 OK response.

3. Try Catch scope: A Try Catch scope is used to handle errors on individual components. It is especially useful when you need to separate error handling strategies for different components in a flow.


What are the Logger levels?

There are 5 logger levels namely: DEBUG, ERROR, INFO, TRACE, and WARN. 


What does scatter-gather return?

A scatter-gather returns a Mule event.


API Life Cycle?

An API life cycle consists of 3 layers:



The first step towards API development is API SpecificationThis phase involves designing the API based on the requirements of the business. An API Specification is a blueprint of an API.

Anypoint Platform provides Design center to design API's REST interfaces.

The next phase is API ImplementationThis phase involves the actual implementation of the API.

Anypoint Platform provides Flow Designer which is a web-based tool to create a prototype of the API.

Anypoint Studio is the IDE for the development and testing of Mule applications. 

The final phase in API life cycle is API management, which uses a tool named API manager on Anypoint Platform which is used to apply policies to secure APIs and restrict access. 


What is RAML?

RAML stands for RESTful (REpresentational State Transfer) API Modeling Language. It's a way of describing a RESTful API that is readable by both humans and computers. 

They use HTTP methods such as GET, PUT, POST, DELETE, etc.


Difference between URI parameters and Query parameters.

URI parameter is used to specify a specific resource whereas Query parameter is used to filter or sort those resources.

let's say we need to filter products based on productType, we use query parameters in this case:

GET: /products?productType=electronics

Let's consider another scenario where we need to retrieve particular product details, we use URI parameters in this case:

GET: /products/{productID}

here, productID will be replaced by a value.


adios amigos





Comments

Post a Comment

Popular posts from this blog

RAML 1.0 Multiple Types for a Single Request

Bonjour ! You must have come across a situation where you need to define two different Types for a particular resource in your RAML specification. In this article, I'll show you how to do that! you can define multiple Types using the pipe  symbol ("|") as follows:  The request  Types can be defined in the header of the RAML. The examples   can be specified using facet " examples " and added in the form of either files using keyword " include " or the example itself.   Adios amigos!

Mulesoft Interview Questions With Answers - Part 2

Bonjour! Let's take a look at some more Mulesoft basic interview-related questions! Which component is used for schema validation and routing incoming Mule messages against RAML? APIkit Router.  Mule provides  APIkit Router  for Schema validation and routing the incoming Mule messages, serializing responses,  validating payloads, Query parameters, URI parameters  against RAML .  Can you create a custom connector?  Yes.  When an  API specification  is published to  Anypoint Exchange,  it automatically generates a connector for it. What is the purpose of a domain project?  The main purpose of a domain project is to have all the  globally shared configurations  for the projects. All the shared resources can be configured in a domain project. Mule applications can be associated only with one domain project. However, a domain project can be associated with multiple mule applications. How do you override application properties?  You can configure your Mule application to automatically lo