Day 12 — Practice questions and interview answers
Everything from the first eleven days, as problems. Clear each box and try it before you look.
1. Greet somebody properly
Take a name that arrives as " anita SHARMA " and produce "Dear Anita sharma,".
Dear @{concat(toUpper(substring(trim(triggerBody()?['Name']), 0, 1)), toLower(substring(trim(triggerBody()?['Name']), 1)))},
2. Pull the domain out of an email
@last(split(triggerBody()?['Email'], '@@')) @first(split(triggerBody()?['Email'], '@@')) @split(first(split(triggerBody()?['Email'], '@@')), '.')
3. Add GST and round it
@mul(triggerBody()?['Fee'], 0.18) @add(triggerBody()?['Fee'], mul(triggerBody()?['Fee'], 0.18)) @int(add(triggerBody()?['Fee'], mul(triggerBody()?['Fee'], 0.18)))
4. Handle a missing field
@triggerBody()?['Phone'] @coalesce(triggerBody()?['Phone'], triggerBody()?['Alt'], 'No contact number') @if(empty(triggerBody()?['Phone']), 'Missing', triggerBody()?['Phone'])
5. Count the orders in one region
{
"trigger": { "type": "manual", "body": {} },
"actions": [
{ "name": "Orders", "type": "Compose", "input": [
{ "Region": "North", "Value": 156000 },
{ "Region": "South", "Value": 66500 },
{ "Region": "North", "Value": 14400 },
{ "Region": "East", "Value": 13000 },
{ "Region": "North", "Value": 58000 }
] },
{ "name": "North rows", "type": "FilterArray",
"from": "@outputs('Orders')",
"where": "@equals(toLower(item()?['Region']), 'north')" },
{ "name": "Answer", "type": "Compose",
"input": "@{length(outputs('North rows'))} North orders" }
]
}
6. Total a column without a variable in the loop
{
"trigger": { "type": "manual", "body": {} },
"actions": [
{ "name": "Orders", "type": "Compose", "input": [
{ "Units": 3, "Price": 52000 },
{ "Units": 7, "Price": 9500 },
{ "Units": 12, "Price": 1200 }
] },
{ "name": "Line values", "type": "Select",
"from": "@outputs('Orders')",
"map": "@mul(item()?['Units'], item()?['Price'])" },
{ "name": "Init total", "type": "InitializeVariable", "variable": "total", "value": 0 },
{ "name": "Add up", "type": "ApplyToEach", "from": "@outputs('Line values')",
"actions": [
{ "name": "Add", "type": "IncrementVariable", "variable": "total", "value": "@item()" }
] },
{ "name": "Answer", "type": "Compose",
"input": "Total @{variables('total')}, biggest @{max(outputs('Line values'))}" }
]
}
7. Yesterday’s rows only
{
"trigger": { "type": "Recurrence", "body": {} },
"actions": [
{ "name": "From", "type": "Compose", "input": "@startOfDay(addDays(utcNow(), -1))" },
{ "name": "To", "type": "Compose", "input": "@startOfDay(utcNow())" },
{ "name": "Rows", "type": "Compose", "input": [
{ "Id": 1, "Created": "2026-03-16T09:00:00Z" },
{ "Id": 2, "Created": "2026-03-17T09:00:00Z" },
{ "Id": 3, "Created": "2026-03-17T22:30:00Z" },
{ "Id": 4, "Created": "2026-03-18T07:00:00Z" }
] },
{ "name": "Yesterday", "type": "FilterArray",
"from": "@outputs('Rows')",
"where": "@and(greaterOrEquals(item()?['Created'], outputs('From')), less(item()?['Created'], outputs('To')))" },
{ "name": "Answer", "type": "Compose",
"input": "@{length(outputs('Yesterday'))} rows from @{formatDateTime(addDays(utcNow(), -1), 'dd MMM')}" }
]
}
8. Route by amount, three ways
{
"trigger": { "type": "manual", "body": { "Amount": 45000 } },
"actions": [
{ "name": "Band", "type": "Compose",
"input": "@if(greaterOrEquals(triggerBody()?['Amount'],100000),'A',if(greaterOrEquals(triggerBody()?['Amount'],25000),'B','C'))" },
{
"name": "Where to send it",
"type": "Switch",
"on": "@outputs('Band')",
"cases": {
"A": [ { "name": "Director", "type": "Compose", "input": "Director approval" } ],
"B": [ { "name": "Manager", "type": "Compose", "input": "Manager approval" } ],
"C": [ { "name": "Auto", "type": "Compose", "input": "Auto approved" } ]
},
"def": [ { "name": "Unknown", "type": "Compose", "input": "Could not band this" } ]
}
]
}
9. Multi-select into a list
@split(triggerBody()?['Interests'], ';') @length(split(triggerBody()?['Interests'], ';')) @contains(split(triggerBody()?['Interests'], ';'), 'SQL') @join(split(triggerBody()?['Interests'], ';'), ' and ')
10. Distinct values
{
"trigger": { "type": "manual", "body": {} },
"actions": [
{ "name": "Rows", "type": "Compose", "input": [
{ "Course": "Excel" }, { "Course": "SQL" },
{ "Course": "Excel" }, { "Course": "Power BI" }
] },
{ "name": "All courses", "type": "Select",
"from": "@outputs('Rows')", "map": "@item()?['Course']" },
{ "name": "Distinct", "type": "Compose",
"input": "@union(outputs('All courses'), outputs('All courses'))" },
{ "name": "Answer", "type": "Compose",
"input": "@{length(outputs('Distinct'))} distinct: @{join(outputs('Distinct'), ', ')}" }
]
}
11. Stop cleanly when there is nothing to do
{
"trigger": { "type": "Recurrence", "body": { "Rows": [] } },
"actions": [
{
"name": "Anything today?",
"type": "Condition",
"expression": "@empty(triggerBody()?['Rows'])",
"yes": [
{ "name": "Quiet day", "type": "Terminate", "status": "Succeeded",
"message": "Nothing to report today" }
],
"no": []
},
{ "name": "Build the report", "type": "Compose", "input": "Building..." },
{ "name": "Send it", "type": "SendEmail", "to": "team@dai-academy.com",
"subject": "Daily report", "body": "Attached" }
]
}
12. The whole thing
Clean, validate, calculate, route, summarise, email. This is question 11 of yesterday, condensed.
{
"trigger": { "type": "automated", "body": {
"Name": " rahul VERMA ", "Email": " Rahul@Example.com ",
"Region": " South ", "Course": "SQL", "Fee": 22000,
"Interests": "Joins;Window functions" } },
"actions": [
{ "name": "Name", "type": "Compose",
"input": "@concat(toUpper(substring(trim(triggerBody()?['Name']), 0, 1)), toLower(substring(trim(triggerBody()?['Name']), 1)))" },
{ "name": "Email", "type": "Compose", "input": "@toLower(trim(triggerBody()?['Email']))" },
{ "name": "Region", "type": "Compose", "input": "@toLower(trim(triggerBody()?['Region']))" },
{ "name": "Total", "type": "Compose",
"input": "@int(add(triggerBody()?['Fee'], mul(triggerBody()?['Fee'], 0.18)))" },
{ "name": "Route", "type": "Compose",
"input": "@if(greaterOrEquals(outputs('Total'), 25000), 'Manager approval', if(or(equals(outputs('Region'),'north'), equals(outputs('Region'),'west')), 'Fast track', 'Standard queue'))" },
{ "name": "Topics", "type": "Compose",
"input": "@join(split(triggerBody()?['Interests'], ';'), ', ')" },
{ "name": "Confirmation", "type": "SendEmail",
"to": "@outputs('Email')",
"subject": "@{triggerBody()?['Course']} - confirmed",
"body": "Dear @{outputs('Name')},\n\nFee including GST: @{outputs('Total')}\nRoute: @{outputs('Route')}\nTopics you asked about: @{outputs('Topics')}\n\nDAI ACADEMY" }
]
}
22,000 plus GST is 25,960, which clears the 25,000 threshold - so it goes to Manager approval even though the fee itself did not. Worth noticing: where you apply the threshold changes the answer.
The questions interviewers ask
What is the difference between a trigger and an action?
The trigger starts the flow and there is exactly one. Actions are the steps that follow. Triggers come in three kinds - automated, instant and scheduled.
What is the difference between a variable and a Compose?
A variable must be initialised at the top of the flow and can be changed later. A Compose just holds a worked-out value and cannot change. Prefer Compose unless the value genuinely needs to change, and never use a variable as a counter inside a parallel loop.
Why does ?[ ] matter?
?['Field'] returns null when the field is missing. ['Field'] throws and fails the run. Since fields go missing for all sorts of ordinary reasons, use the question mark everywhere and handle the null with coalesce() or empty().
How would you speed up a slow flow?
Replace loops with Filter array and Select. Fetch only the columns and rows you need rather than everything and filtering later. Use first() instead of a loop when you expect one item. Turn on concurrency where the work is genuinely independent - and turn it off where a shared variable makes it unsafe.
How do you handle errors?
Configure run after on an action, or a Try/Catch pair of Scopes: everything risky in Try, and a Catch scope set to run after Try has failed that notifies a named person with the run link. Better still, guard the inputs so it does not fail in the first place.
Why does my scheduled flow run at the wrong time?
Power Automate runs on UTC. A 9:00 recurrence fires at 2:30pm in India. Set the time zone on the trigger, or set the UTC time that corresponds to the local one you want.
What does item() do, and what about items()?
item() is the current item of the innermost Apply to each. In a nested loop, that always means the inner one, so to reach the outer loop you name it: items('Each batch').
How do you get distinct values?
union(theArray, theArray) - the same array twice. Union merges and removes duplicates, so unioning a list with itself leaves you the distinct values. There is no distinct action.
How do you total a column?
There is no sum function. Select the numbers into an array, then either loop that much smaller array or use a single expression. max() and min() do work directly on an array of numbers.
What is a connector, and what is a premium connector?
A connector is the bridge to a system - Outlook, SharePoint, Excel, Teams. Premium connectors, such as SQL Server, Dataverse and most third-party services, need a paid licence beyond what comes with Microsoft 365. Knowing which is which matters when you are scoping a project.
If you are heading towards MIS and reporting, the free Power BI tutorial and the free Advanced Excel tutorial are the natural next steps.
Try these yourself
- Do all twelve questions with the boxes cleared before you look at any solution.
- Rewrite question 6 so it also reports the average line value.
- Extend question 8 with a fourth band and a matching Switch case.
- Add error handling to question 12 so a mail failure notifies the team.
- Answer all ten interview questions out loud, without looking.
