lambda_intermediate_scenarios Flashcards

(20 cards)

1
Q

Lambda function needs 15 seconds to complete money transfer verification. What’s your design approach?

A

Async pattern: First Lambda invokes second Lambda async and returns immediately with tracker ID in DynamoDB. Second Lambda processes transfer and updates tracker. Third Lambda checks tracker status later in flow. Total flow stays under 20 second sequence limit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Customer experiencing intermittent Lambda validation failures. Second attempt always succeeds. What do you implement?

A

Add retry mechanism on error branch. Use Play prompt to ask caller to try again. Helps with intermittent network or API issues without routing to agent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lambda function calling external API sometimes times out. How do you handle this gracefully in the flow?

A

Lambda should catch timeout and return formatted error: {result: “failed”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You have 18-22 minute transaction verification process. Customers keep abandoning. What’s the solution?

A

Use Step Functions for async security checks. Don’t make customer wait on line. Send SMS or create callback task when verification completes. Customer gets confirmation via preferred contact method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Flow logs show Lambda invocations succeeding but customers reporting incorrect behavior. Where do you look?

A

Check Lambda CloudWatch logs for function errors. Lambda invocation can succeed but function code can fail. Look for unhandled exceptions or incorrect response formatting in function logs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you monitor if external payment API is timing out frequently?

A

Use CloudWatch Logs Insights query: filter for result = “failed” AND error = “endpointTimeout”. Create alarm when count exceeds threshold. Add to operational dashboard for proactive monitoring.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Lambda function returns response but flow takes error branch. What are the possible causes?

A

Response format doesn’t match validation setting (JSON vs STRING_MAP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

You need to process order that involves 3 external APIs taking 5 seconds each. Design approach?

A

Async pattern with Step Functions. First Lambda starts Step Function workflow and returns. Step Function orchestrates 3 API calls sequentially or parallel. Third Lambda checks Step Function status later in flow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Customer complains payment verification isn’t working. How do you troubleshoot using CloudWatch?

A

Search flow logs for customer’s ContactId. Find Invoke Lambda block events. Check if error branch triggered. Look at Parameters sent and ExternalResults received. Compare with Lambda function logs for same RequestId.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Lambda function needs to return either customer name OR error message about account not found. How do you format this?

A

When Lambda needs to return either customer name OR an error message to Connect, you must include a result property with specific formatting. Connect contact flows check this result property to determine success or failure, then access the returned data through contact attributes. The standard format is {result: “success”, customerName: “John Doe”} or {result: “error”, errorMessage: “Account not found”}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Your contact center has 50% of calls routing to agents because Lambda validation keeps failing. What’s your investigation approach?

A

Check CloudWatch ContactFlowErrors metric for spike. Use Logs Insights to filter Lambda invocation errors. Check if error is consistent or intermittent. Review Lambda function logs for root cause. Implement retry if intermittent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you handle situation where Lambda function processes successfully but external API returns business logic error like insufficient funds?

A

Lambda should return success status with business error details: {result: “success”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You want to track how many Lambda timeouts vs invalid responses vs too large responses you’re getting. How?

A

Use CloudWatch Logs Insights with filter patterns for each error type. Create separate queries and add as widgets to dashboard. Set up individual alarms for each error type with different thresholds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Lambda function works in test but fails in production flow. What could be wrong?

A

Flow block timeout might be lower than test timeout. IAM permissions might be different between test and production. Environment variables might not be set in production. Alias might be pointing to old version.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Customer needs to wait for bank transfer confirmation that takes 10 minutes. How do you keep them engaged while process runs?

A

Use loop with Wait block and Play prompt. Check process tracker in DynamoDB every 30-60 seconds. Play progress updates to customer. Offer callback option if customer wants to hang up and receive call when complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you ensure your Lambda error responses help with troubleshooting later?

A

Always include operation property (what function was trying to do)

17
Q

Your Lambda function queries on-premises database that sometimes has 5 second latency. Sync or async?

A

Depends on how often. If occasional 5 second spike use sync with 8 second timeout and retry logic. If regularly over 8 seconds use async pattern to avoid timeout issues.

18
Q

Developer says Lambda function processed successfully but flow took error path. How do you verify this claim?

A

Check flow logs for ExternalResults field. If empty means Lambda didn’t return proper response. Check Lambda logs for same RequestId to see if function threw exception or returned malformed response.

19
Q

You see ContactFlowFatalErrors metric spiking. What does this mean and what do you check?

A

Flow failed to run because of system error not Lambda error. Check if flows are published correctly

20
Q

Lambda function creates DynamoDB tracker record but second async Lambda never updates it. How do you debug?

A

Check if second Lambda has DynamoDB write permissions. Verify first Lambda is actually invoking second Lambda async (check CloudWatch metrics for second function). Check second Lambda logs for errors.