AWS Lambda Flashcards

(95 cards)

1
Q

What is AWS Lambda?

A

AWS Lambda is a serverless compute service that runs code in response to events without provisioning or managing servers.

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

What does “serverless” mean in AWS Lambda?

A

You don’t manage servers. AWS handles infrastructure, scaling, patching, and availability.

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

What triggers a Lambda function?

A

Events from services like:
Amazon S3
Amazon API Gateway
Amazon EventBridge
Amazon DynamoDB
Amazon SQS
Amazon SNS

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

Are Lambda functions stateful?

A

No. They are stateless. it stores states externally. by using:
Amazon DynamoDB
Amazon S3
Amazon ElastiCache

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

What is the maximum Lambda execution timeout?

A

15 minutes (900 seconds).

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

How is CPU allocated in Lambda?

A

CPU power scales proportionally with memory allocation (128 MB – 10,240 MB).

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

How is Lambda billed?

A

Based on:
Number of requests
Execution duration (GB-seconds)
Provisioned concurrency (if enabled)

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

What is Lambda concurrency?

A

The number of function instances serving requests simultaneously.
Number of parallel executions
Types:
Unreserved concurrency
Reserved concurrency
Provisioned concurrency

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

What is a cold start?

A

When Lambda initializes a new execution environment, causing increased latency.

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

What happens when Lambda runs inside a VPC?

A

It creates ENIs in subnets. Internet access requires a NAT Gateway.

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

How do you expose Lambda as a REST API?

A

Using Amazon API Gateway.

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

How can Lambda process uploaded files?

A

Trigger Lambda from Amazon S3 object creation events.

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

Can Lambda process streams?

A

Yes, from:
Amazon Kinesis
Amazon DynamoDB Streams

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

How does Lambda integrate with queues?

A

Lambda polls Amazon SQS automatically.

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

How do you coordinate multiple Lambda functions?

A

Using AWS Step Functions.

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

What is a Lambda execution role?

A

An IAM role that grants Lambda permission to access AWS services.

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

What are Lambda resource policies used for?

A

To allow other AWS services/accounts to invoke the Lambda function.

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

How is Lambda environment data protected?

A

Environment variables are encrypted at rest using AWS KMS.

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

Does Lambda auto-scale?

A

Yes, automatically scales per request up to account concurrency limits.

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

What happens when concurrency limit is exceeded?

A

Lambda throttles requests (HTTP 429 or retry behavior depending on trigger).

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

What’s the difference Async vs Sync Invocation?

A

Sync ? Caller waits for response (API Gateway)
Async ? Event queued and retried on failure (S3, SNS)

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

You need near real-time processing of uploaded images. What service combination?

A

S3 + Lambda

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

You need long-running workflows with retries and branching logic.

A

Lambda + Step Functions

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

Reduce cold starts for latency-sensitive APIs.

A

Enable Provisioned Concurrency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is a DLQ in Lambda?
A queue (SQS or SNS) that stores failed async events.
26
What are Lambda layers?
Shared code libraries that can be reused across multiple functions.
27
What are Lambda destinations?
Define where execution results go (success/failure).
28
How does Lambda authenticate to other AWS services?
Using an IAM execution role attached to the function.
29
How do you allow cross-account Lambda invocation?
Using Lambda resource-based policies.
29
How can you restrict Lambda network access?
Place it inside a VPC with controlled subnets and security groups.
30
What service helps centrally audit Lambda API activity?
AWS CloudTrail
31
Does Lambda run across multiple AZs?
Yes, it is automatically multi-AZ.
32
How does Lambda retry failed async invocations?
Automatically retries twice before sending to DLQ or destination.
33
What service orchestrates multiple Lambda functions with retries and branching?
AWS Step Functions
34
How do you handle failed async events?
Configure Dead Letter Queue using Amazon SQS or Amazon SNS.
35
How do you build event-driven architectures?
Use Amazon EventBridge with Lambda.
35
Which service exposes Lambda as HTTP endpoints?
Amazon API Gateway
36
When is Lambda more cost-effective than EC2?
For unpredictable or low-traffic workloads.
37
How do you reduce Lambda cost?
Optimize memory settings and execution duration.
38
What service stores Lambda logs?
Amazon CloudWatch
39
What service analyzes Lambda logs?
Amazon CloudWatch Logs Insights
40
Minimum Lambda memory allocation?
128 MB
41
Maximum Lambda memory allocation?
10240 MB
42
Default regional concurrency limit?
1000 (soft limit)
43
What is reserved concurrency?
Guarantees concurrency for a function
44
What is provisioned concurrency?
Pre-initialized execution environments
45
How does S3 trigger Lambda?
Object creation events
46
How does API Gateway integrate with Lambda?
Through Synchronous invocation
47
Which services can be used as DLQ?
SQS or SNS
48
What service monitors Lambda metrics?
Amazon CloudWatch
49
Key Lambda metrics?
Duration Errors Throttles Invocations
50
How to enable internet access in VPC Lambda?
Use NAT Gateway
51
Why does VPC Lambda increase cold start?
ENI creation overhead
52
What file system can Lambda mount?
EFS
53
Max package size zipped?
50 MB direct upload
54
Max unzipped deployment size?
250 MB
55
Max container image size?
10 GB
56
Languages supported by Lambda?
Python Node.js Java Go .NET Ruby
57
When to use layers?
Shared dependencies across functions
58
What is event source mapping?
Connects event source to Lambda
59
Does Lambda poll SQS?
Yes
60
Does Lambda poll Kinesis?
Yes
61
How does Lambda scale with SQS?
Based on queue depth
62
Max batch size for SQS trigger?
Up to 10000 (standard queue)
63
What happens if Lambda times out?
Execution stops and error recorded
64
What is idempotency?
Ensuring repeated execution has same result
65
Why design Lambda idempotent?
Because retries can occur
66
When is Lambda cost-effective?
Low or unpredictable workloads
67
When is EC2 better than Lambda?
Long-running workloads
68
When is Fargate better than Lambda?
Containerized long-running tasks
69
Best use case for Lambda?
Event-driven processing
70
What is Step Functions used for?
Workflow orchestration
71
What is EventBridge used for?
Event routing
72
What is throttling?
Limiting execution beyond concurrency
73
How to increase concurrency limit?
Request quota increase
74
Can Lambda access RDS?
Yes inside VPC
75
Can Lambda run continuously?
No. Max 15 minutes
76
How to schedule Lambda execution?
EventBridge schedule rule
77
What is Lambda@Edge?
Runs Lambda at CloudFront edge locations
78
Best use case for Lambda@Edge?
Modify HTTP requests at edge
79
What is Lambda's ephemeral storage default?
512 MB
80
Lambda's Max configurable ephemeral storage?
10 GB
81
How to process large files?
Use S3 streaming or EFS
82
How does Lambda scale with Kinesis?
Based on shard count
83
How many concurrent executions per shard?
One per shard
84
What happens to failed stream processing?
Retries until data expires
85
How to reduce Lambda duration?
Optimize code and memory
86
Why increasing memory can reduce cost?
Shorter duration reduces GB-seconds
87
What is container image Lambda?
Deploy Lambda using Docker image
88
How to monitor Lambda failures?
CloudWatch alarms
89
How to trace Lambda execution?
AWS X-Ray
90
What is X-Ray used for?
Distributed tracing
91
What is a common exam pattern for image processing?
S3 trigger + Lambda
92
What is best solution for complex workflows?
Lambda + Step Functions
93
What handles high-throughput messaging decoupling?
SQS + Lambda