MCQs on AWS Lambda Function Basics | AWS Lambda Quiz

AWS Lambda MCQ Questions and Answers: A Comprehensive Guide

Looking to boost your understanding of AWS Lambda? This set of AWS Lambda MCQ questions and answers will help you understand key concepts such as Lambda function configuration, memory, timeout, function handler, event objects, and testing Lambda functions both locally and in the console. Use these questions to prepare for exams or enhance your AWS skills.

Chapter 3: AWS Lambda Function Basics – MCQs

1. What is the default timeout for an AWS Lambda function?

a) 1 minute
b) 5 minutes
c) 3 minutes
d) 15 minutes

2. Which of the following defines the AWS Lambda function’s runtime environment?

a) Execution environment
b) Container environment
c) Instance environment
d) Virtual machine environment

3. The memory for an AWS Lambda function is allocated in:

a) Megabytes
b) Gigabytes
c) Kilobytes
d) Terabytes

4. What happens if an AWS Lambda function exceeds its timeout?

a) It logs an error
b) It restarts automatically
c) It is terminated and fails
d) It continues to execute

5. Which of the following is NOT a supported AWS Lambda runtime environment?

a) Python
b) Java
c) C++
d) Node.js

6. How is the function handler specified in AWS Lambda?

a) By providing the handler name in the Lambda console
b) By using an environment variable
c) By defining it in the AWS CLI only
d) By selecting the runtime environment

7. The event object in AWS Lambda is:

a) Passed automatically to the function
b) Only for debugging purposes
c) A manual input from the developer
d) Never used in Lambda functions

8. Which statement is true about Lambda versions?

a) Lambda versions cannot be published
b) Lambda versions are immutable
c) A version can be modified after publishing
d) Lambda versions are only for testing

9. What is the role of Lambda aliases?

a) To create multiple versions of a function
b) To associate a function with different event triggers
c) To provide an easier way to manage Lambda versions
d) To run Lambda functions in multiple regions

10. What happens when you update a Lambda function alias?

a) It creates a new version of the function
b) It updates all the versions of the function
c) It points the alias to a new version
d) It disables the function temporarily

11. How can environment variables in AWS Lambda be accessed?

a) Through the Lambda console only
b) By hardcoding the values in the function code
c) Using the Lambda API to retrieve them
d) By using the process.env in Node.js or os.environ in Python

12. Which Lambda feature allows you to track the function’s version and manage it more easily?

a) Aliases
b) Environment variables
c) Memory allocation
d) Execution role

13. What does the Lambda function configuration define?

a) The maximum number of retries
b) The memory, timeout, and handler
c) The event types
d) The execution role permissions

14. What is the maximum amount of memory that can be allocated to a Lambda function?

a) 1024 MB
b) 4096 MB
c) 512 MB
d) 10240 MB

15. Which AWS service can be used for monitoring Lambda function metrics?

a) Amazon CloudWatch
b) AWS X-Ray
c) AWS CloudTrail
d) AWS GuardDuty

16. How can you test an AWS Lambda function locally before deploying it?

a) Using AWS CLI only
b) By deploying it in a sandbox environment
c) Using AWS SAM or Docker
d) It cannot be tested locally

17. In AWS Lambda, what happens if a function execution fails after the retry attempts?

a) Lambda automatically restarts the function
b) An error is logged in CloudWatch Logs
c) It stops execution and triggers a failure notification
d) The function is disabled permanently

18. Which of the following is NOT true about Lambda function timeout?

a) Timeout can be set to a minimum of 1 second
b) Timeout can be set up to 15 minutes
c) Timeout is automatically set based on the function’s memory
d) Timeout defines how long Lambda will wait before terminating a function

19. How does AWS Lambda handle the event object?

a) It needs to be created manually by the user
b) It is automatically passed to the function on each invocation
c) It is fetched from S3 every time
d) It is stored in a database for future use

20. Can AWS Lambda functions be executed in a specific AWS region?

a) Yes, based on the Lambda configuration
b) No, Lambda functions are global
c) Only in the US region
d) Only in the EU region

21. Which of the following is an example of a Lambda function trigger?

a) S3 event
b) EC2 instance
c) DynamoDB
d) All of the above

22. Which Lambda runtime environment is specifically designed for Node.js applications?

a) Node.js 10.x
b) Python 3.8
c) Java 8
d) Ruby 2.7

23. Which function in AWS Lambda allows developers to fetch environment variables?

a) os.getenv()
b) os.environ.get()
c) process.env
d) fetch_env()

24. What is an alias in AWS Lambda primarily used for?

a) Providing a unique identifier for function versions
b) Allowing you to quickly test functions
c) Versioning and managing Lambda functions more efficiently
d) Restricting access to Lambda functions

25. Can you create multiple versions of the same Lambda function?

a) Yes
b) No
c) Only in the AWS Management Console
d) Only using Lambda API

26. What happens when an AWS Lambda function is successfully invoked?

a) It triggers another Lambda function
b) It returns an HTTP status code 200
c) It outputs logs to CloudWatch
d) It only outputs results to S3

27. What is the purpose of the Lambda function handler in AWS?

a) To initialize the Lambda function environment
b) To handle the incoming event request and process it
c) To fetch logs from CloudWatch
d) To manage environment variables

28. Which Lambda feature allows you to automatically scale the function based on usage?

a) Memory scaling
b) Event-driven architecture
c) Auto-scaling based on Lambda invocations
d) Function timeout

29. Can you specify different configurations for different versions of a Lambda function?

a) Yes
b) No
c) Only in aliases
d) Only in the AWS Management Console

30. How can you view the logs generated by a Lambda function?

a) Through AWS CloudWatch Logs
b) Only through Lambda Console
c) By sending logs to an S3 bucket
d) By using Lambda API


Answer Key:

QnoAnswer (Option with the text)
1b) 5 minutes
2a) Execution environment
3a) Megabytes
4c) It is terminated and fails
5c) C++
6a) By providing the handler name in the Lambda console
7a) Passed automatically to the function
8b) Lambda versions are immutable
9c) To provide an easier way to manage Lambda versions
10c) It points the alias to a new version
11d) By using the process.env in Node.js or os.environ in Python
12a) Aliases
13b) The memory, timeout, and handler
14b) 4096 MB
15a) Amazon CloudWatch
16c) Using AWS SAM or Docker
17b) An error is logged in CloudWatch Logs
18c) Timeout is automatically set based on the function’s memory
19b) It is automatically passed to the function on each invocation
20a) Yes, based on the Lambda configuration
21d) All of the above
22a) Node.js 10.x
23b) os.environ.get()
24c) Versioning and managing Lambda functions more efficiently
25a) Yes
26c) It outputs logs to CloudWatch
27b) To handle the incoming event request and process it
28c) Auto-scaling based on Lambda invocations
29a) Yes
30a) Through AWS CloudWatch Logs

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