Practice Test

When deploying a AWS Lambda function, you can use an S3 bucket to store and retrieve the deployment package.

  • 1) True
  • 2) False

Answer: True

Explanation: S3 is a common way to store and retrieve Lambda deployment packages. The S3 bucket where the package is stored must be in the same region as the Lambda function.

You cannot use AWS Lambda layers for sharing common code across different Lambda functions.

  • 1) True
  • 2) False

Answer: False

Explanation: Lambda layers are a distribution mechanism for libraries, custom runtimes, and other function dependencies, allowing for code sharing and separation of responsibilities across multiple functions.

Which AWS services could trigger a Lambda function? Select all that apply.

  • 1) Amazon S3
  • 2) Amazon DynamoDB
  • 3) Amazon EC2
  • 4) Amazon SNS

Answer: Amazon S3, Amazon DynamoDB, Amazon SNS

Explanation: While EC2 can interact with Lambda, it cannot directly trigger a Lambda function. Amazon S3, DynamoDB, and SNS are all capable of triggering a Lambda function.

AWS Lambda functions can be written in multiple programming languages.

  • 1) True
  • 2) False

Answer: True

Explanation: Yes, AWS Lambda supports multiple programming languages including Node.js, Python, Java, C#, Go and Powershell.

An AWS Lambda function can access resources within a VPC.

  • 1) True
  • 2) False

Answer: True

Explanation: By default, a Lambda function can access resources over the public internet, but it can also access resources in a VPC with the correct permissions and configuration.

You can only use AWS Step Functions to model and orchestrate your application workflows.

  • 1) True
  • 2) False

Answer: False

Explanation: AWS Step Functions is one service available to model and orchestrate workflows, but it is not the only one. You can also use Amazon SWF (Simple Workflow Service) depending on your specific use case.

By default, Lambda functions are limited to 1 GB of memory.

  • 1) True
  • 2) False

Answer: False

Explanation: A Lambda function can have from 128 MB to 10,240 MB of memory.

AWS Lambda automatically tracks the number of requests that your function receives and can provide metrics.

  • 1) True
  • 2) False

Answer: True

Explanation: AWS Lambda automatically tracks metrics through Amazon CloudWatch, including the number of requests (invocations), the duration of your functions, and more.

In Lambda function, Layers and Extensions are the same.

  • 1) True
  • 2) False

Answer: False

Explanation: Layers are a distribution mechanism for libraries and function dependencies. Extensions, on the other hand, allow you to augment your function with additional functionality, tooling, or logic.

All AWS Lambda resources are deleted when AWS CloudFormation stack is deleted.

  • 1) True
  • 2) False

Answer: True

Explanation: If a Lambda resource is created with an AWS CloudFormation stack, then that resource will be deleted when the stack is deleted.

Interview Questions

What is AWS Lambda deployment package?

A deployment package is a ZIP archive that contains your code and any dependencies. The deployment package is uploaded to AWS Lambda to deploy the function.

What are the AWS Lambda layers?

AWS Lambda layers are a distribution mechanism for libraries, custom runtimes, and other function dependencies. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic.

Can you modify a version of a AWS Lambda layer after it has been published?

No, after a layer version is published, it cannot be modified. Instead, you need to create a new version.

What are some of the OS-level configurations that you can specify for an AWS Lambda Function?

You can specify various things such as memory allocation, timeout settings, and environment variables for an AWS Lambda function.

What is the maximum amount of memory you can allocate to a Lambda function?

You can allocate up to 10,240 MB (10 GB) to a Lambda function.

What is the default timeout for Lambda functions?

The default timeout is 3 seconds. However, you can set the timeout to any value between 1 second and 15 minutes.

How do you define environment variables for a Lambda function?

You can define them in the AWS Lambda console, AWS CLI, or as part of your function’s deployment package.

What is the maximum size for a deployment package in AWS Lambda?

The maximum size of a deployment package is 50 MB for direct upload and 250 MB for uploaded unzipped, including layers.

Can we use environment variables for sensitive data encryption in AWS Lambda?

Yes. AWS Lambda encrypts environment variables at rest and in transit. To enable this, you should use a customer-managed key instead of a default Lambda service key.

How does AWS Lambda support VPC?

AWS Lambda supports running a function in an Amazon VPC, which enables your function to access resources within your VPC. This is done by setting up VPC configurations.

Can you specify the trusted entities for a role in the execution role of an AWS Lambda function?

Yes, in the execution role of a Lambda function, you can specify the trusted entities. For AWS Lambda, lambda.amazonaws.com is the service principal.

Can an AWS Lambda function run without an execution role?

No. An AWS Lambda function needs an execution role so that it can interact with different AWS services as per the assigned permissions.

How to choose the runtime for AWS Lambda function in configuration settings?

While configuring an AWS Lambda function, AWS provides a list of runtimes to choose from. The choice should be appropriate for the programming language that the Lambda function is written in.

Can we enable X-Ray for a Lambda function through configuration settings?

Yes. To enable active tracing for your Lambda function, you can check the Enable active tracing box on the Configuration tab.

How can we troubleshoot a failed AWS Lambda function deployment?

AWS Lambda provides CloudWatch log streams that can help to troubleshoot a deployment failure. A deployment might fail due to reasons like, the function’s deployment package is too large, or an error occurred while extracting a layer version, among other reasons.

Leave a Reply

Your email address will not be published. Required fields are marked *