0
0
AWScloud~20 mins

Lambda integration in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Lambda Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Lambda Function Invocation Behavior

You have an AWS Lambda function integrated with an API Gateway using the default proxy integration. When a client sends a request, what will the Lambda function receive as its event parameter?

AAn empty event object since API Gateway does not pass data by default.
BA JSON object containing HTTP method, headers, path, query parameters, and body as a string.
COnly the query parameters as a dictionary.
DThe raw HTTP request body as a string only.
Attempts:
2 left
💡 Hint

Think about what information API Gateway sends to Lambda in proxy integration.

Architecture
intermediate
2:00remaining
Choosing Lambda Integration Type

You want to integrate an AWS Lambda function with API Gateway. You need to support multiple HTTP methods and want API Gateway to handle request validation and transformation. Which integration type should you choose?

AAWS Service integration
BLambda proxy integration
CDirect HTTP integration
DLambda non-proxy (custom) integration
Attempts:
2 left
💡 Hint

Consider which integration type allows API Gateway to manage request validation and mapping templates.

security
advanced
2:00remaining
Securing Lambda Integration with API Gateway

You want to secure your Lambda function behind API Gateway so that only authenticated users can invoke it. Which of the following is the best way to enforce authentication at the API Gateway level?

AUse API Gateway Lambda authorizer to validate tokens before invoking Lambda.
BAdd authentication logic inside the Lambda function code.
CAdd an IAM policy to the Lambda function to allow only authenticated users.
DMake the Lambda function public and rely on network security groups.
Attempts:
2 left
💡 Hint

Think about where to enforce authentication to reduce Lambda load.

Configuration
advanced
2:00remaining
Configuring Lambda Integration Response

You have a Lambda function integrated with API Gateway using non-proxy integration. Your Lambda returns a JSON with a statusCode and body. How do you configure API Gateway to map the Lambda response to an HTTP 200 status with the body content?

ANo configuration needed; API Gateway automatically maps Lambda response to HTTP response.
BConfigure Lambda to return only the body string without statusCode.
CSet up a mapping template in Integration Response to extract body and set status code to 200.
DUse Lambda proxy integration instead to handle response automatically.
Attempts:
2 left
💡 Hint

Consider how API Gateway handles Lambda responses in non-proxy integration.

Best Practice
expert
2:00remaining
Optimizing Lambda Integration for Performance

You have a high-traffic API Gateway endpoint integrated with Lambda proxy integration. You notice increased latency and cold starts. Which approach best reduces latency and cold starts?

AIncrease Lambda memory size and enable provisioned concurrency.
BSwitch to Lambda non-proxy integration to reduce payload size.
CAdd retries in API Gateway integration settings.
DUse API Gateway caching to store Lambda responses indefinitely.
Attempts:
2 left
💡 Hint

Think about how to keep Lambda functions warm and improve execution speed.