Real Interview Q&A Collection (Global Companies) — Interview Questions & Scenarios (2026)
Real interview questions asked by Fortune 500 enterprises, banks, and major SI consultancies.
🏢 Real Interview Q&A Collection (Global Companies)
Real interview questions asked by Fortune 500 enterprises, banks, and major SI consultancies.
An exception arose at System layer and I want that error message to propagate to Experience
layer. How?
Use on-error-propagate at each layer. In the SAPI: catch the error → build standardized error
payload → re-throw using . In the PAPI: same pattern — on-error-propagate re-throws the error
upward. In the XAPI: on-error-propagate catches it → formats into the standard HTTP error response
format with correct status code.
The key: keep the error payload consistent at every layer. Use a standard error schema {correlationId,
errorCode, message, layer} so XAPI always knows what to expect regardless of which layer the error
originated from.
Project: Aviation — Core Integration Gateway.
Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.
What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.
Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.
System API is taking too long to respond (timeout). How do you fix it from XAPI's perspective?
Three approaches depending on requirements:
responseTimeout value. Quick fix but doesn't solve the root cause.
Anypoint MQ. MQ consumer calls SAPI when it's ready. XAPI provides a polling endpoint or callback
URL for the result.
N times with a delay. Catch MULE:RETRY_EXHAUSTED → return 503 with Retry-After header to caller.
How do you implement CI/CD for MuleSoft? What Maven commands do you use?
In our Enterprise Architecture: GitHub Actions triggers on push to any environment branch. Pipeline stages:
Secrets (CloudHub credentials, connected app keys) stored in GitHub Secrets, passed as environment
variables to Maven. Deployment targets vary by branch: develop→sandbox, qa-branch→qa,
main→production. Maven Parent POM / BOM centralizes all shared plugin and connector versions — every enterprise API inherits from it.
What is the difference between DataWeave 1.0 and 2.0?
| FEATURE | DATAWEAVE 1.0 (MULE 3) | DATAWEAVE 2.0 (MULE 4) |
|---|---|---|
| Header | %dw 1.0 | %dw 2.0 |
| Conditional | when-otherwise | if-else |
| Imports | Not available | import dw::core::Strings |
| Functions | %function myFn(x) x + 1 | fun myFn(x) = x + 1 |
| Variables | %var x = 5 | var x = 5 |
| Output | Declared in header | Declared in header with output keyword |
Project: Commercial Banking — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.
What is the p() function in DataWeave? What is lookup()?
p() function: Reads a value from a properties file (application properties, config YAML, Secure
Properties). Used to access configuration without hardcoding.
DataWeave — p() to read properties
%dw 2.0
output application/json
---
{ "appName": p('app.name'), "apiKey": p('secure::api.key') }
lookup() function: Invokes a Mule flow by name from within a DataWeave expression and returns its result. Can only call flows — not sub-flows.
DataWeave — lookup() to call a flow
%dw 2.0
output application/json
---
{ result: lookup('validateAddressFlow', {address: payload.address}) }
Project: Telecommunications — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.
What is the difference between flatten and flatMap?
| OPERATOR | INPUT | OUTPUT | USE WHEN |
|---|---|---|---|
flatten | Nested array | One-level-flattened array | You have [[1,2],[3,4]] and want [1,2,3,4] |
flatMap | Array + lambda | Flattened array after transformation | Map each element to an array, then flatten all results |
DataWeave — flatten vs flatMap
// flatten: turns nested arrays flat
[[3,5],[0.9,5.5]] flatten
// Output: [3, 5, 0.9, 5.5]
// flatMap: iterate + flatten in one operation
[[3,5],[0.9,5.5]] flatMap (value, index) -> value
// Output: [3, 5, 0.9, 5.5]
How do you skip null values in DataWeave? How do you mask sensitive data?
DataWeave — skipNullOn
%dw 2.0
output application/json skipNullOn="everywhere"
---
{ "name": "John", "company": "MuleSoft", "designation": null }
// Output: { "name": "John", "company": "MuleSoft" }
// null fields are omitted from output
DataWeave — mask() operator (from dw::util::Values)
%dw 2.0
output application/json
import * from dw:-util:-Values
var data = { "name": "John", "ssn": "123-45-6789", "cardNo": "1234567890123456" }
---
(data mask "ssn" with "*---*--****") mask "cardNo" with "************3456"
Project: Logistics — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.
What is zip() function? How do you merge two arrays?
zip() combines two arrays element-by-element into an array of pairs (arrays of 2 elements each).
DataWeave — zip() and flatten to merge
%dw 2.0
output application/json
---
// zip two arrays:
["Alice","Joe"] zip ["Integration Engineer", "Lead"]
// Output: [["Alice","Integration Engineer"],["Joe","Lead"]]
// Merge two arrays into one flat array:
import * from dw:-core:-Arrays
var a1 = ["a","b"]
var a2 = ["c","d"]
---
flatten([a1, a2])
// Output: ["a","b","c","d"]
What is sizeOf(), typeOf(), and how do you remove a key from an object?
DataWeave — sizeOf, typeOf, remove key
%dw 2.0
output application/json
---
// sizeOf: count elements in array or keys in object
sizeOf([1,2,3,4]) // → 4
sizeOf({a:1, b:2}) // → 2
// typeOf: get the data type
typeOf([1,2,3]) // → "Array"
typeOf("hello") // → "String"
typeOf(42) // → "Number"
// Remove key with - operator:
var details = { name: "John", age: 25, ssn: "123" }
details - "ssn"
// Output: { name: "John", age: 25 }
// Use - to strip PII before sending to external systems
What is reduce() in DataWeave? Write examples for sum and string concat.
DataWeave — reduce() for aggregation
%dw 2.0
output application/json
var numbers = [1, 2, 3, 4]
var salaries = [50000, 60000, 45000, 70000, 55000]
---
{
sum: numbers reduce ((item, acc = 0) -> acc + item), // 10
product: numbers reduce ((item, acc = 1) -> acc * item), // 24
concat: numbers reduce ((item, acc = "") -> acc ++ item), // "1234"
maxSalary: salaries reduce ((item, acc = 0) -> if (item > acc) item else acc) // 70000
}
Project: Energy & Utility — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.
What is match vs matches? What is read() vs readUrl()?
DataWeave — match vs matches
// match: returns array of capture groups from regex match
"me@mulesoft.com" match(/([a-z]*-@([a-z]*-.com/)
// Output: ["me@mulesoft.com", "me", "mulesoft"]
// matches: returns boolean — does entire string match?
"admin123" matches /a.*\d+/ // true
"admin123" matches /^b.+/ // false
DataWeave — read() vs readUrl()
// read(): parses a string or binary as a specific MIME type
read('{ "Hello": "World" }', 'application/json')
// Output: parsed JSON object
// readUrl(): reads from URL (including classpath)
readUrl("classpath:--config/mapping.json", "application/json")
// Reads from src/main/resources/config/mapping.json
How do you access secure properties inside DataWeave? How to encode/decode base64?
DataWeave — Secure properties + base64
%dw 2.0
output application/json
import toBase64 from dw:-core:-Binaries
import fromBase64 from dw:-core:-Binaries
---
{
// Access secure property:
apiKey: p('secure:-api.clientSecret'),
// Base64 encode:
encoded: toBase64("Secret"), // "U2VjcmV0"
// Base64 decode:
decoded: fromBase64("U2VjcmV0") // "Secret"
}
Project: Commercial Banking — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.
Write DataWeave to check if a number is even or odd. How to convert string to Number?
DataWeave — Even/Odd + type conversion
%dw 2.0
output application/json
var n = attributes.queryParams.number as Number
---
// Even or odd:
if ((n mod 2) == 0) { result: "Even" } else { result: "Odd" }
// String to Number:
"345.60" as Number // 345.60
// Number to String:
345.60 as String // "345.6"
// String to Date:
"2026-10-16" as Date {format: "yyyy-MM-dd"}
Project: Telecommunications — High-Volume Payload Transformation Service.
Problem: Transforming a 60MB nested XML payload containing 30,000 line items was consuming 1.2GB of heap memory and causing garbage collection pauses of up to 4 seconds.
What I Did: Rewrote the script using DataWeave 2.0 streaming with pluck, groupBy, and indexed lookups, avoiding eager array loading into JVM heap.
Result: Reduced memory footprint by 82% and dropped transformation execution time from 4.1s to 240ms.