Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

1. Introduction, Roles & Responsibilities and about project?

<speak min 5 to 6 min>


2. Have you worked with RAML? Why do we use RAML and what are the different
sections available in RAML?
Yes. I worked in RAML; we will write the API specifications using RAML language in
Anypoint platform design centre. After we design the specifications, we can test it
using MOCK URL which we can generate in design centre.
There are many sections available in RAML like RESOURCE NAME, METHOD NAME,
QUERY PARAMS, URI PARAMS, HEADERS, REQUEST BODY, RESPONSE BODY. And
also, we can implement API fragments in RAML such as TRAITS, RESOURCE TYPES,
DATA TYPES, LIBRARIES, SECURITY SCHEMES.
3. Why do we implement API fragments?
We can write common code or common functionality within API fragments and we
can use it in multiple resources.
For an example, if we apply client id enforcement policy for our API, we need to pass
client id and client secret for all the applications. Here, inside TRAITS fragment we
can define client id and client secret headers and we can use that TRAIT for all the
resources in our RAML. So that in every resource we need not to define these
headers. Like this if we have any common attributes within method level, we can
define in the TRAITS. If we have to apply common security, we can define SECURITY
SCHEME.
4. What is API LED Architecture?
API LED architecture is recommended by Mulesoft. Because of this architecture, we can
reuse the APIs in future whenever required.
There are 3 layers:
I. System API’s:
a. System APIs are used to connect with the target systems like Amazon,
Database, SAP, Hadoop.
II. Process API’s:
a. Process APIs are built to compose or combine two or more system API’s.
All the business logics will be implemented using Process API’s.
b. Process API’s and System APIs should not be exposed to outside world.
III. Experience API’s:
a. Will be exposed for consumers or public.
b. Source request/payload validations will be performed in experience api
using RAML data types.

5. I want to validate one of the fields in my RAML, that is email id. How do you validate
email id field in RAML?
Basically, we will do all kind of validations using DATA TYPES fragment. For email id
field validation, we can define PATTERN keyword. In PATTERN keyword we can
define it should accept only one ‘@’ symbol and only one ‘.’ symbol.
6. What is the use of DATA TYPES in RAML?
Data Types is one type of fragment. It is used to validate the incoming payload by writing
JSON schemas inside the data types file.
Data types can describe a base or resource URI parameter, a query parameter, a request or response header, or a request or
response body. Data types are built-in or custom. A built-in type can be used anywhere the API expects data.
7. What is mule event?
Mule event is combination of payload, attributes and variables.
8. What is the difference between SOAP & REST services?
SOAP is heavy in weight but REST is light weight service.
SOAP will accept only XML data, REST will accept all kinds of data formats like JSON, XML,
CSV.
9. How do you secure your API’s?
In our project we have applied the policies in API manager to secure the API’s. And
also, we can use HTTPS protocol for our APIs for more security. When we apply
HTTPS protocol, we need to define the TLS configuration in our HTTP connector.
We will be provided with KEY STORE and TRUST STORE details with the mapping
sheet. So, we will configure KEY STORE in our HTTP listener and TRUST STORE in or
HTTP REQUEST connector.
10. I have a company employee’s data with multiple locations like Hyderabad, Chennai
and Pune in a SFTP server. Now, I want to read the file from SFTP and generate
separate file for every location? How you will design a flow for this?
First, I will use SFTP read connector to read the data from the file, after I get the file I
will use SCATTER GATHER component.
Inside SCATTER GATHER, I will create separate flows or routes for every location. As
we have 3 locations here, I will create 3 routes inside SCATTER GATHER. In first route
of SCATTER GATHER, we can use transform message to filter only HYDERABAD
employee’s data.
In the 2nd route of SCATTER GATHER, we can use one more transform message to
filter only CHENNAI employee’s data. Like this we can design solution for this
requirement.
11. Can I place only one route inside SCATTER GATHER component?
No, it will throw an error. We should keep minimum of 2 routes in SCATTER GATHER.
12. I have deployed one simple application with 0.1 vCore in cloudhub. But, I would like
to process 1GB data with this application. So, can I process 1GB data with 0.1 vCore ?
In 0.1 vCore we get 500 MB of memory and 8GB of worker storage space.
By using File store streaming strategy, we can process 1GB file with 0.1 vCore.
Because in file store streaming, only some amount of data will be stored in memory
and rest of the data will be stored in worker’s storage space. So, it will split the data
and processed internally.
File store streaming is a default streaming strategy in mule 4.
13. How many streaming strategies are available in mule 4?
We have 3 types of streaming strategies:
o Repeatable File Store Streaming
▪ Default
▪ Data is stored in Memory and Storage
▪ Non-Consumable Payloads
▪ Can be configured for Performance
▪ Reliable
o Repeatable In Memory Streaming
▪ Data is stored only in Memory
▪ If it reaches to maximum memory, we will get memory issues.
▪ It is faster processing
o Non-Repeatable Streaming
▪ Data is stored in Memory
▪ Payload will become null after a single use by a processor
▪ Improves TPS and Performance as it releases the memory
14. In which ports you will deploy the applications in Cloud Hub?
In my project, we will deploy the applications using 8081, 8082, 8091, 8092 ports.
Usually, we will deploy our experience api’s with 8081 or 8082 ports. If it is HTTP, we will
use 8081 & if its HTTPS we will use 8082 port.
We will deploy our process, system api’s with 8091 or 8092 ports. If HTTP – 8091, HTTPS-
8092 port.
In my application 8091 & 8092 are private ports. Whenever we deploy the application in
private ports, nobody from outside can consume our api’s.
This is how we will deploy the applications in Cloudhub.
15. I am getting an error while sending a request to one of the REST service, how you
will implement RETRY mechanism?
We can use UNTIL SUCCESSFUL scope to implement the RETRY mechanism. Here we
have to wrap the HTTP REQUEST component inside the UNTIL SUCCESSFUL scope. So it
will do the retry as per configuration.
16. What is the difference between FOR EACH & PARALLEL FOR EACH?
For each is used for sequential processing of the data.
Parallel for each is used to do the parallel processing.
Only one thread will execute in case of FOR EACH.
Multiple threads will run in parallel in case of PARALLEL FOR EACH.
17. What are the differences between parallel for each and Batch?
• Parallel For-Each is Synchronous and Batch is Asynchronous
• Predefined sections in Batch for Handling Errors, Processing, Aggregation, On
Complete
• Can customize Number of Threads based on incoming Records and Batch
Block Size
• The batch does not give any output payload. Parallel For Each provides the
output of Processed Records in the same order
18. What are the different types of THREADS available in MULE 4?
We mainly have 3 types of threads in MULE 4:
CPU LITE – this thread will be invoked with connectors which can execute in less
than 10 seconds. Example: SET VARIABLE.
CPU INTESIVE – connectors with above 10 seconds processing time, will be used.
Example – TRANSFORMATION message component
BLOCKING IO – is for transactions and batch processing.
19. Have you ever worked with Transaction Management or Transactions in Mule 4?
No. I never used TRANSACTIONS in my project but I have knowledge on this.
There are 2 types of transactions. in Mule 4:
➢ Single transactions,
➢ extended transactions
Transactions are used to roll back the data.
Transactions will be used with Database, VM, JMS connectors
How you will initiate transaction?
We can initiate transaction using try scope or any event source connector

20. What is horizontal scaling and vertical scaling?


Vertical scaling is to increase the worker size, when you want to process the CPU
Intensive API’s or process large payload with small number of request increase the
vCore size.
Horizontal scaling is to increase the number of worker, if you want to increase the
throughput of high frequency small payload

21. 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
22. How to encrypt and use secure properties?
1. Create a property files containing the properties you want to secure
2. Pass the property file to the Secure Properties Tool
3. Provide the Mule application with a secure properties configuration
4. Add the Secure Configuration Properties module to the application
5. Use the secure properties in your application
6. Hide properties from view in Runtime Manager

23. What is difference between authentication vs authorization?


In simple terms, authentication is the process of verifying who a user is, while
authorization is the process of verifying what they have access to. Comparing these
processes to a real-world example, when you go through security in an airport, you
show your ID to authenticate your identity.

24. What is the Errortype Reflected when one of the flows in scatter-gather throws
error?
After every route executes. If any has failed with an error. Then the scatter-gather
components throws error of tyoe: MULE:COMPOSITE:ROUTING
25. Where and how should the value global error handler be added in the Mule project
so that the error handler scope is the default error handler?
We can do so by adding the “Error Handler” scope to a Mule configuration file.
Typically, it is put in the global configuration file. Then this handler needs to be
specified as the application's default error handler. You can add any number of error
handler (propagate or continue) scope to this global error handler.
26. What is p() used in DataWeave?
p() function is used for reading data from properties files like Database Passwords,
HTTP Host, API Keys, etc.
27. What are the Dataweave functions you worked on?
I worked with many functions such as MAP, MAP OBJECT, FILTER, DISTINCT BY, ORDER BY,
REDUCE.

28. What is difference between MAP & MAP OBJECT?


MAP is used with arrays. To iterate over the values of the array we will use MAP. For MAP, input
and output will be in the form of array.
MAP OBJECT is used with objects. To iterate over key, value, index of the objects. For MAP
OBJECT, input and output will be in the form of object.

29. What is the difference between MAP OBEJCT & PLUCK?


Map object and pluck both will work with object as input. But MAP OBJECT will give the ouput in
the form of object but PLUCK will give ARRAY as output.
30. How to remove blank spaces from starting and ending of the string?
We can use trim() function to remove any blank spaces from the
beginning and end of a string.

31. How to retrieve property value in dataweave?


‘p’ function is used to retrieve the property value using dataweave expression.
Syntax will be like: p(‘property-key’)
32. How to display only DATE by using now function?
We can use format keyword along with now function to achive this.

33.
input payload
{
"array1" : [1,2,3],
"array2": [4,[5,6],7]
}

How can we combine all the values in to a single array?


Dwl code:
%dw 2.0
output application/json
---
flatten(payload.array1 ++ payload.array2)
flatten is used to combine the multiple arrays into a single array.
Flatten will remove the nested arrays.

34.
INPUT is [1,2,3,4,5]
I need output as [2,4,6,8,10]
How you can write data weave for this?

We can use map operator to iterate over array and multiply with 2.

Code:
%dw 2.0

output application/json

---

payload map $*2

35. How you can add all numbers in an ARRAY.


Input is [1,2,3,4,5]
We can use reduce function to add all numbers in an array.

Code:
%dw 2.0

output application/json

---

payload reduce $ + $$

36. Input: - [1,2,3,2,4,1,2]


[1,2,3,4,4]

Can you write a code to list only unique records from 2 arrays

Code:
%dw 2.0
output application/json
var a = [1,2,3,2,4,1,2]
var b = [1,2,3,4,4]
---
(flatten(a ++ b)) distinctBy $

37. Input: "hello world"


Output: "world hello"
Code:
%dw 2.0
output application/json
---
(payload splitBy " ")[-1 to 0] joinBy " "
38. Declare a variable and define 1 to 10 numbers in an array and write a DWL to define even
numbers and odd numbers.

Code:
%dw 2.0
output application/json
var a = [1,2,3,4,5,6,7,8,9,10]
---
{
even_numbers: a filter ((item, index) -> isEven(item)),
odd_numbers: a filter ((item, index) -> isOdd(item)),
}
This is sukumar. I have completed btech after that i have started with my carrier in software technology. Last
3.2 years i am working as a software developer in appstaions pvt limited. Last 2 years I am working as a mule
developer. My current project is Ecommerce. This is online store. Customers login and buy the items dirctley
like mobiles and laptops whaterver customer want those item directley buy into the customer.

I have developed different api's like

1) Customer api
2) Product api
3) Order api
4) Sales api

I have good knowledge in HTTP, FTP, SFTP, DATABASE connectors.


I am having good knowledge in error handling framework like on error continue, on error propagate and global
handling.
I have good knowledge in Anypoint studio and Anypoint platform.
I worked with for each, batch processing to process the data.
I have knowledge in designing, developing and deploying the applications.
Coming to my current project:
I am currently working for Ecommerce client. Where we develop the integrations related to health insurance.
We have developed integrations like create policy, update policy, create new agent, delete policy, renew policy.
We have used API led architecture in this project means we implemented experience apis, process apis and
systems apis.

Coming to my roles and responsibilities

I will develop the api specifications using RAML in design center


Worked with anypoint studio to implement the apis
Applied policies in api manager to secure the apis.
Attending calls with client to gather the requirements and understand the requirements.

You might also like