Cognizant Mulesoft Interview Questions | Cognizant Interview Questions

Below are Mulesoft Interview Questions based on the candidate's experiences and the company's interview pattern.

1. What is SEDA architecture?
SEDA is a staged event-driven architecture. It breaks the complex event-driven application into a number of stages that are connected by queues. It decouples receiving, processing, and dispatching phases.

A Stage is analogous to an "Event". To simplify the idea, think of SEDA as a series of events sending messages between them.

In a restaurant:
if waiter A has work of taking in the customers and allot a seat.
Waiter B has work of taking and processing order.
Waiter C has work of giving/taking bill and take out the customer.

Advantages of SEDA architecture:
1. we create a new thread for each request.
2. it is easy to program.
3. We can achieve higher parallelism in SEDA.
4. less time requires.
5. operation becomes robust.
6. Performance increases.

Disadvantages of SEDA architecture:
1. Caching can be a problem.
2. Scheduling can be a problem.
3. Locking can be a problem.

2. How SEDA can be implemented in mule?
Mule is built upon SEDA architecture.
In Mule, each component is treated as a stage with its own thread pool and work queue. If two flows are connected by queue let’s say by JMS component or by VM.

3. What is RAML?
RAML stands for Restful API Modelling Language. RAML can be used for:
1. API specification
2. We can mock API by RAML and API console.
3. We can generate an interface by RAML.
4. We can use RAML for API documentation.
5. It's a contract between APIs.

RAML lets you see what your API looks like as you design it, using easy-to-read plain text. RAML makes it easy to manage the API lifecycle from design to deployment to sharing. RAML is used for API modeling. RAML is both machine and human-readable.

4.  What are overlays in RAML?
Overlays are used to extend non-behavioral aspects of an API, such as descriptions, usage directions, and user documentation items.
Example: RAML 1.0 Overlay

For example: in API documentation if documentation is needed in multiple languages then overlays can be used.

5. What are Extensions in RAML?
The extension is used to extend or override behavioral aspects of the API.
Example: RAML 1.0 Extension

As you may infer from the name, extensions are used to extend an API by adding new behaviors and/or modifying existing behaviors of an API. An analogy from the object-oriented programming world would be a subclass extending a superclass, where the subclass can add new methods and/or override existing methods. An extension may also extend an API's non-functional aspects.
An extension might be used.

For example: to define additional resources that are exposed only to a select set of users, such as administrators or users having been assigned a particular role. An extension could also be used to add features for a newer version of an API.

6. What is a transport barrier?
A "transport barrier" is when your Mule message goes through an endpoint that makes use of a transport 
Example: HTTP endpoints, JMS, TCP, VM, etc.
There are two ways of calling flows in Mule:
1. Via an endpoint.
2. Via the Flow-Ref component.

The first case makes use of transports, therefore, your message goes through the whole serialization and deserialization processes. At the end of the day, you will still end up with the same payload but it will be a different Mule message. It is just a fancy way of saying we are sending a message across a transport. 

7. What are inbound and outbound properties in mule?
Mule Inbound Properties:
1. Inbound properties cannot be set by you.
2. Message sources (such as inbound endpoints) set them for you when they receive a message.
3. Inbound properties are lost when crossing a “transport barrier.”

Mule Outbound Properties:
1. Outbound properties can be set by you.
2. When crossing a “transport barrier”, outbound properties are automatically turned into inbound properties, and no longer exist as outbound properties.

8. What is Invocation and Session properties in mule?
Mule Invocation Properties:
1. Invocation properties can be set by you.
2. Invocation properties are lost when crossing a “transport barrier”.

Mule Session Properties:
1. Session Properties can be set by you.
2. Session properties are preserved when crossing a “transport barrier”.

9. What is Invocation and Session properties in mule?
Mule Invocation Properties:
1. Invocation properties can be set by you.
2. Invocation properties are lost when crossing a “transport barrier”.

Mule Session Properties:
1. Session Properties can be set by you.
2. Session properties are preserved when crossing a “transport barrier”.

10. When to use VM and when to flow ref?
VM endpoints enable message redelivery strategies to be configured in your exception handling blocks – this is not possible with flow-refs.  VMs can do this because they internally use a queue to hold messages while flow-refs are like simple method calls.

Contrast that to a private flow and chaining with flow-refs, if an exception occurs in the called flow even though we have a rollback strategy configured it will NOT execute because there is no internal queue involved.

11. What is the Anypoint platform?
Anypoint Platform is a complete solution for API-led connectivity that helps companies build application networks of apps, data, and devices, both on-premises and in the cloud. 
This hybrid integration platform includes iPaaS, ESB, and a unified solution for API management, design, and publishing.

Anypoint Platform provides us:
1) API Manager
2) Runtime manager
3) Design center
4) Access management
5) Anypoint exchange
6) Anypoint visualizer: Anypoint Visualizer displays views of different aspects of the application network graph. It provides a real-time graphical representation of the APIs and the Mule applications that are running and discoverable.
It collects the data from the APIs, Mule applications, and proxies deployed to CloudHub or standalone mule runtime engine to discover all incoming and outgoing connections through an embedded plugin.
7) Anypoint Monitoring: Anypoint Monitoring provides visibility into integration across your Application Network graph. It provides feedback from the Mule flows and components in your application network graph.
8) Secret Manager: Secret Manager uses secure vault technology to store and control access to private keys, passwords, certificates, and other secrets. Use Secret Manager to write, read, manage your secret, keys, Transport Layer Security Certificate (TLS), and many other documents.

12. What is API Manager?
API Manager is the component of Anypoint Platform that helps in managing the APIs for an organization.
From API manager we can:
1) Apply policies.
2). Alerts by email if someone violates policy or response time is more, etc.
3). SLA tiers.
4). Autodiscovery.

13. What are exception strategies?
1. Default exception strategy
2. Catch exception strategy
3. Rollback exception strategy
4. choice exception strategy 
5. reference exception strategy.

14. What are processing strategies?
1. Synchronous processing strategy
2. Queued asynchronous strategy
3. Non-blocking processing strategy.

15. What is MQ and why we should use it?
MQ or message queue is used to connect applications from each other to send data or messages.
Let’s say if we want to connect the mule application with Mainframe, we can use MQ to connect it and exchange data.

We can also use web services to communicate between applications but MQ is preferred because:

1.  If the connection is lost then MQ persists the message and resumes from the same point from where the connection gets lost.
2. We can configure MQ to process asynchronously.

16. What is Anypoint MQ?
Anypoint MQ is the queueing facility given by Mulesoft in the Anypoint platform. It comes only in the paid version. We can create queues and call that queues from our mule flow via client id and client secret from of our organization and queue name.

17. How we can deploy our API in the mule cloud?
By runtime manager of the Anypoint platform, we can deploy mule applications to the mule cloud hub.
In mule 3 cloud hub deployment, we need a .zip project file.
In mule 4 cloud hub deployment, we need a .jar project file.

18. What is an API kit?
API kit is required to convert RAML into Mule flows.

19. What is an API kit router?
API kit is used to route the request to various flows via HTTP method and resource name.

20. What is dataweave? Name 10 dataweave inbuilt functions?
Dataweave is a language that is used to transform data from one form to another. For example: JSON to XML. There are many facilities given in dataweave language to do modifications in our data.

21. What is message enricher? How it works?
Message enricher is used to enrich our payload with some other data.
We can modify our payload with some other data. There are two main attributes in message enricher: source and target.
the source is our existing payload and the target is message or data which is used to modify our existing payload.

22. What is SAML? How we can apply SAML in our application?
SAML or security assertion mark-up language is used to do a single sign-on. So users do not need to manually sign on each time and SAML is secured too.

We need to sign on to the third party for the generation of tokens.
In Anypoint platform go to access management -> external identity and select SAML 2.0. and feed server URL given by the third party in SAML policy section in Anypoint platform.
The access token is generated by the client URL provided by the client id and client secret of the organization.
Once the token is generated, we can access our API by applying the access token in the request.

23. How to convert HTTP to HTTPS in mule?
For conversion of HTTP to HTTPS we need to do TLS configuration in these we need to generate security certificates like key store and trust store.
Key Store: It is a server-side asset that contains data in encrypted and decrypted form.
Trust Store: It is a client-side asset that contains data in encrypted and decrypted form. We need to give the location of both the key store and trust store in the TLS configuration to convert HTTP to HTTPS.

24. What are aggregators and splitters in the mule?
Aggregator: This is used to aggregate or some of the response data. Example: collection aggregator
Splitter: It is used to split or bifurcate the data. Example: Collection splitter

25. What are the core principles of ESB integration?
1) Data orchestration 
2) Data transportation 
3) Data transformation 
4) Data mediation 
5) Non- functional consistency 

26. Name two Integration design patterns?
1) Canonical design pattern
2) Facade design pattern

27. What is Mule object structure?

28. Name a few ESBs available in the market?
1) Mule ESB
2) Tibco ESB
3) Dell-Boomi 
4) Apache Camel
5) Fuse JBoss ESB

29. What is salesforce? Have you worked on a Salesforce connector?
Salesforce is a CRM application and used for storing customer-related data. 

30. What is the dynamic and parameterized query in the DB connector, how to execute and how to execute the stored procedure in mule?
We used parameterized queries in DB operations to avoid SQL injection. Dynamic queries lead to SQL injections. SQL injections are the vulnerable thing and used to attack data-driven applications and to hack database applications. We can call store procedure from database connector in Mule

31. What are the different types of variables in mule?
There are three types of variables in mule: 
1) Flow variable 
2) Session variable
3) Record variable

Flow variable: We can store data or values in the flow variable and can access them in the flow. A flow variable cannot cross the transport barrier or endpoints. 
Session variable: We can access session variable anywhere in the flow and session variable can cross transport barrier in some cases Example: VM
Record variable: Record variables are used in batch processing.

32. How to perform batch processing in mule?
Batch processing is a technique to process data in batches. In mule, there are four phases in batch processing. 
1) Input – In this stage data is gathering and transform into desired input.
2) Load And Dispatch – In this stage batches are created for processing.
3) Process – In this stage batch steps are processed one by one and output is forwarded to the final stage.
4) On Complete – It is the optional stage that is used to show the report of the records process. 

33. How to consume soap web service in mule?
By using web service consumer. We need to give WSDL path in web service consumer component to consume soap web service.

34. how to create a soap web service in mule?
By using the apache CXF component in mule.

35. How to consume the rest web service in mule?
By using an HTTP connector.

36. What are the advantages of ESB?
1) Defining API specifications.
2) Connection of applications by queue and web services.
3) Routing of data.
4) Deployment of application to server or cloud.
5) Manage applications.
6) Data format conversion.

37. What is flow, sub-flow and private flow?
1) flow: Flow contains message source and message processors which are used to perform a certain operation.
2) Sub-flow: Sub Flow is used to break the main flow into smaller flows to increase readability. In sub-flow main flow’s encryption strategy is used. Sub Flow is synonymous. We can connect the sub-flow from the main flow way flow reference components.
3) Private Flow: Flow without message source is known as private flow it has its own exception strategy. 

38. Difference between mule 3 and mule 4?
Mule 4
Mule 3
In Mule 4 the project is by default mavenized, so we do not need to convert it into a maven project manually.
We need to convert the project into the maven project manually.
In cloud hub deployment we need to deploy the .jar project file from the runtime manager
In mule 3 cloud hub deployment we need to deploy the .zip project file from the runtime manager
In mule 4 exception handling is changed, we use on error continue and on error propagate to handles error 
We use mule exception strategies like catch, rollback, choice, etc.
The mule expression language is eliminated in mule 4
The mule expression language is present in mule 3
Data weave version is changed to 2.0
Data weave version is 1.0
Transformers is eliminated in mule 4
Transformers is present in mule 3
In mule 4 there is no need to manually tune the runtime it has a self-tuning engine
In mule 3 we need to manually tune the runtime

39. What is invoke component in mule?
It is used for JAVA support in mule. We can execute JAVA code from invoke component.

40. What is API LED connectivity in mule?
API LED connectivity is used to propagate messages from an application to another via different layers.
1) System API: It is used to expose all data from the backend and convert it into another desirable form.
2) Process API: In-process API we can filter desired data and perform the business operations in it.
3) Experience API – It is used to connect different UI devices. It facilitates UI to capture the same API in different platforms. 

41. What is the API lifecycle in mule?
1) Design 
2) Simulate
3) Feedback 
4) Validate

42. How to read flat file in mule and how to read fix width format in mule?
Both flat-file and fix width format functionality support is present in the transform message component in the mule.

48. What is Munit? How to perform it?
Munit is the unit testing framework in mule. It is like Junit in JAVA. We need to generate Munit flows from mule flows and performed Munit testing. The green bar indicates successful testing and Red bar indicates the error. 

43. What is a VM connector? List out the Difference between flow reference and VM?
In VM: 
1) VM is used for asynchronous processing.
2) It is used to connect different mule applications.
3) It is used to connect applications via queues.
4) When we distribute our work across clusters.

In Flow reference: 
1) We use flow reference to connect the sub-flow from the main flow.
2) Process is synchronous.

44. What is Synchronous & Asynchronous flow?
Synchronous flow: 
1) In this same thread is responsible for the execution of the whole process.
2) So, more time is elapsed in it.
Asynchronous flow: 
1) More than one thread is required to execute a process.
2) There is a separate thread for message receiving, message processing, and message dispatching. 

45. What are API proxy and API gateway.
1) API proxy: API proxy is a proxy URL that is used to secure API by avoiding accessing the original URL. Proxy URL is generated from API manager in Anypoint platform.
2) API gateway: API gateway restricts the unwanted malicious attacks from the hackers and the security policies apply to API gateway.

46. How to iterate collections in mule?
1) By using a map operator.
2) By using for each scope.

47. What are mule scopes? How many scopes you have used?
Scopes: Scopes contain multiple message processors for performing certain operations.
Example: for each, async, transactional.

48. How to handle transactions in mule?
By using a transactional scope.

49. What is MEL? How to consume headers in mule?
MEL or Mule expression language is used to access Inbound properties in mule, like query parameters, URI parameters, and headers.
We can consume headers in mule by message.inboundproperties.hearders  

50.How to apply basic authentication in mule?
Basic authentication is used to secure API by username and password, so we need to go to the policy section in API manager and select basic authentication. Before it we need to enable the security manager and choose a username and password.

51. What is Mongo DB connector? Have you used it?
Mongo DB connector is used to connect Mongo DB. Mongo DB credentials are applied to the Mongo DB connector to access it.

52. What is cache scope, until successful scope & first successful scope in mule?
1) Cache Scope: Cache Scope is used in mule to store the data which is used again and again. There are two types of object store we used in caching.
1) In memory object store 
2) Persistent store 

2) Until Successful Scope: Until Successful scope is used for a resource to execute successfully. In this scope, we give retries to connect to the resource if the resource connects successfully within given retries then scope gives the successful response.

3) First Successful in Mule: First successful components return payload of the branch which gives successful response first.

53. What is the poll scope and watermarking in mule?
1) Poll scope: Poll scope is used for polling. If you want to execute the operation within a gap of a certain time then we can use poll scope.

2) Watermarking: Adding new data without replacing old data is known as watermarking. If 10 records are read from the database and return in file and new 2 records are added to the database so that 2 new records will be added to the file without replacing all the records.

54. What is CORS?
CORS or Cross-Origin Resource Sharing is a technique by which we can access our API in JAVA script and other JAVA script-supported languages for this we need to enable CORS policy in the Anypoint platform.

55. How to validate schema in mule?
By schema validation filter.

56. How we can send email in mule?
By using SMTP and attachment transformer in mule.

57. How to use property file in mule?
For this, we need to configure property place holder in global elements. We can access the value by ${keyname} anywhere in the mule components.

58. What is the filter in mule? Explain At least 5 types of filters?
The filter is used for filtering tasks if the given condition is matched then it allows to pass the payload otherwise restrict it.

5 Types of filters are as follows:
1) Message filter 
2) Schema validation filter
3) Or filter
4) And filter
5) Not filter

59. What is scatter-gather in mule? How it works in detail.
Scatter gather is a routing component that routes the payload via different branches, and we get output in the form of an array in the output node.
By default, if any branch gives error then the whole operation will not stop, and it returns the output of the successful branches. If any branch fails, it gives composite routes exception and we can track the exception in a particular branch by sequential ID.

60. What is the choice in mule?
the choice is a routing component in mule that is used to route the message on the basics of given conditions. 

61. What is Anypoint exchange?
Anypoint exchange is an online portal given by mulesoft to store and access assets publicly and private. We can store connectors, components, etc in Anypoint exchange.

62. What is an object store?
Object Store is used to store objects. There are 2 types of object store mainly we have:
1) In memory object store
2) Persistent store 

63. How can we apply encryption and decryption in mule?
Encryption and decryption are applied via the encryption component in the mule. Encryption techniques can be applied in mule-like:
1) PGP Encryption
2) JCE Encryption
3) XML Encryption 

64. LDAP connector in mule?
LDAP or Light Weight Directory Access Protocol is used to access network directories. LDAP connector is used in mule to access it. Operations like search, create, update, delete can be used.

65. Diff between map object and map operator in mule?
Map Operator
Map Object
The output of the map operator is an array
The output of map object is an object
Transformation function lambda invokes 2 parameter index and value. Index refers to the positions of key and value.
Transformation function lambda invokes 2 parameter key and value.
The index is denoted by $$ sign and value by $
Key is denoted by $$ and value by $

66. Name 10 dataweave operators.
1) Split space by
2) Pluck 
3) Flatten
4) Now
5) Seil
6) ABS
7) Min
8) Max
10) Random 

67. What are different Thread pools in mule?
There are 3 thread pools in the mule.
1) Receiving thread pool – It is used for receiving messages from the message source.
2) Processing thread pool – It is used for processing the message 
3) Dispatching thread pool – It is used to dispatch the message out of the flow.

68. how many minimum components required for valid flow in mule?
At least one message processor.

69. What is autodiscovery in mule?
Autodiscovery is a technique for API management. It is used for API pairing or API tracking.

70. How can we use if-else condition in mule?
By using when-otherwise in mule.