MCQs on Error Handling and Monitoring | AWS Lambda MCQs

Explore the essential aspects of AWS Lambda error handling and monitoring with our specially curated set of 30 multiple-choice questions. This collection covers topics like monitoring Lambda functions with CloudWatch, logging errors, setting alarms, and utilizing Dead Letter Queues. Use these AWS Lambda MCQ questions and answers to test and improve your knowledge. Check the answers at the end for a quick review.


Chapter 5: Error Handling and Monitoring

1. Monitoring Lambda Functions with AWS CloudWatch

  1. Which AWS service is used to monitor Lambda functions in real-time?
    a. Amazon S3
    b. AWS CloudTrail
    c. AWS CloudWatch
    d. AWS CodeDeploy
  2. CloudWatch Metrics for Lambda include which of the following?
    a. Memory usage
    b. Total invocations
    c. Throttles
    d. All of the above
  3. What is the default retention period for Lambda function logs in CloudWatch?
    a. 7 days
    b. 30 days
    c. 60 days
    d. 90 days
  4. Which Lambda metric indicates how often the function execution was throttled?
    a. Errors
    b. Invocations
    c. Throttles
    d. Duration
  5. What CloudWatch feature helps analyze Lambda function performance over time?
    a. CloudWatch Dashboards
    b. CloudWatch Logs Insights
    c. CloudWatch Metrics
    d. CloudWatch Events

2. Logging in Lambda Functions with CloudWatch Logs

  1. What is the primary service used for logging Lambda function output?
    a. AWS CloudWatch Logs
    b. Amazon S3
    c. Amazon Elasticsearch
    d. AWS X-Ray
  2. Which log level is commonly used in Lambda functions for detailed troubleshooting?
    a. INFO
    b. ERROR
    c. DEBUG
    d. TRACE
  3. Which API action is used to send logs from Lambda to CloudWatch?
    a. PutLogEvents
    b. SendLogEvents
    c. PutCloudWatchLogs
    d. LogCloudWatchEvent
  4. By default, which log group is created in CloudWatch for each Lambda function?
    a. /aws/lambda/function_name
    b. /aws/logs/function_name
    c. /aws/lambda/logs
    d. /cloudwatch/logs/function_name
  5. How can you view logs for a Lambda function in the AWS Management Console?
    a. Through AWS X-Ray
    b. In CloudWatch Logs under the log group
    c. In the Lambda function configuration page
    d. In CloudTrail logs

3. Setting up Alarms for Lambda Errors

  1. What type of CloudWatch alarm would you set to monitor Lambda function failures?
    a. Alarm for function invocation
    b. Alarm for function duration
    c. Alarm for error count
    d. Alarm for memory usage
  2. Which CloudWatch metric is used to trigger an alarm for Lambda errors?
    a. Duration
    b. Errors
    c. Throttles
    d. Invocations
  3. To receive notifications when an alarm is triggered for Lambda errors, you must configure:
    a. Amazon SNS
    b. Amazon SES
    c. AWS SQS
    d. AWS Lambda destination
  4. How do you set a threshold for Lambda error rate in CloudWatch?
    a. Set an error count threshold in the alarm configuration
    b. Set a memory usage threshold
    c. Set a function duration threshold
    d. Set a threshold for invocation count
  5. What is the first step to create a CloudWatch alarm for Lambda?
    a. Choose the error metric for Lambda function
    b. Create a CloudTrail event
    c. Set up an SQS queue
    d. Enable detailed logging

4. Retries and Dead Letter Queues (DLQs)

  1. What happens when a Lambda function execution fails and retries are enabled?
    a. The function execution stops permanently
    b. Lambda retries the execution until it succeeds
    c. The error is logged and no retries occur
    d. The error is sent to CloudWatch logs
  2. What is the purpose of using a Dead Letter Queue (DLQ) in AWS Lambda?
    a. To retry failed Lambda executions
    b. To store logs for Lambda functions
    c. To capture failed event invocations
    d. To scale Lambda functions automatically
  3. What service is typically used for configuring a Dead Letter Queue with Lambda?
    a. Amazon SQS
    b. AWS SNS
    c. AWS Step Functions
    d. Amazon DynamoDB
  4. How do you configure a DLQ for a Lambda function?
    a. By linking a CloudWatch alarm
    b. By specifying an SQS queue or SNS topic in the function’s configuration
    c. By using the Lambda API
    d. By setting a Lambda timeout
  5. What happens to events sent to a Dead Letter Queue?
    a. They are automatically retried
    b. They are deleted after 24 hours
    c. They are captured for later analysis
    d. They are escalated to AWS support

5. Handling Function Failures Gracefully

  1. Which Lambda setting helps minimize the impact of function errors?
    a. Retry policy
    b. Timeout setting
    c. Memory allocation
    d. Concurrency settings
  2. What is the best practice for Lambda functions that need to handle transient errors?
    a. Setting a long timeout
    b. Enabling retries
    c. Disabling error logging
    d. Using AWS Step Functions
  3. To handle failures in Lambda gracefully, what is the primary mechanism to ensure success?
    a. Dead Letter Queues
    b. AWS Step Functions
    c. API Gateway integration
    d. S3 event triggers
  4. Which Lambda retry strategy ensures that no event is lost during transient failures?
    a. Linear backoff
    b. Exponential backoff
    c. Immediate retries
    d. No retries
  5. Which AWS service provides insight into the error stack traces of Lambda failures?
    a. AWS X-Ray
    b. AWS Config
    c. CloudWatch Events
    d. AWS Systems Manager
  6. How can Lambda failures be logged for troubleshooting and later analysis?
    a. By using Amazon S3
    b. By integrating with AWS X-Ray
    c. By capturing logs in CloudWatch Logs
    d. By using Amazon RDS
  7. What happens if a Lambda function exceeds its maximum retries?
    a. The function is terminated
    b. The event is automatically rerouted to another function
    c. The event is sent to a Dead Letter Queue
    d. The event is lost forever
  8. In what case should you avoid using retries in Lambda?
    a. When the function is stateless
    b. When the function handles critical data
    c. When the function should not fail gracefully
    d. When retrying the failure could result in duplicate actions
  9. How does AWS Lambda handle failures when the retry limit is exceeded?
    a. The function is marked as failed and ignored
    b. The function fails permanently and no further retries are attempted
    c. The event is moved to a Dead Letter Queue
    d. The error is reported via Amazon SNS
  10. Which AWS service helps you orchestrate retries and failure handling with Lambda?
    a. AWS CloudFormation
    b. AWS Step Functions
    c. AWS Batch
    d. AWS AppSync

Answer Key

QNoAnswer
1c. AWS CloudWatch
2d. All of the above
3b. 30 days
4c. Throttles
5b. CloudWatch Logs Insights
6a. AWS CloudWatch Logs
7c. DEBUG
8a. PutLogEvents
9a. /aws/lambda/function_name
10b. In CloudWatch Logs under the log group
11c. Alarm for error count
12b. Errors
13a. Amazon SNS
14a. Set an error count threshold in the alarm configuration
15a. Choose the error metric for Lambda function
16b. Lambda retries the execution until it succeeds
17c. To capture failed event invocations
18a. Amazon SQS
19b. By specifying an SQS queue or SNS topic in the function’s configuration
20c. They are captured for later analysis
21a. Retry policy
22b. Enabling retries
23b. AWS Step Functions
24b. Exponential backoff
25a. AWS X-Ray
26c. By capturing logs in CloudWatch Logs
27c. The event is sent to a Dead Letter Queue
28d. When retrying the failure could result in duplicate actions
29c. The event is moved to a Dead Letter Queue
30b. AWS Step Functions

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top