Lamdba (Compute) Flashcards

1
Q

What does Lambda do?

A

You upload some code and it runs it for you

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

When do you pay for Lambda?

A

You only pay for Lambda when code runs

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

What is key difference between Elastic Beanstalk and Lambda

A

Elastic Beanstalk is going to create and manage infrastructure for you and is going to use EC2 instances. Meant to do a full task or job.

Lambda you have no access to underlying hardware so it’s known as serverless. Does a single function well

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

Cloud Formation vs Elastic Beanstalk

A

Cloud Formation you still need to do deployments you would need to set up to deploy it. Cloud Formation is like blue print.

You can deploy it in Elastic Beanstalk. It uses Cloud Formation under the hood

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

What can Lambda help with?

A

Building an event driven architecture

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

Do the Autoscaling Group and Load Balancer work together

A

Yes

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

What is the serverless application model (SAM)

A

SAM is a way that you can define your infrastructure that is serverless ie., lambda and code

So it updates maintains etc

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

Java code and it’s dependencies are deployed in a lambda function, but it fails because the package size is too big

What should you do that wouldn’t need major QA testing

A

Create a Lambda layer for the dependencies

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

Popular serverless app that predicts stock prices has runtime of 100s and 60 requests per second

Its performance decrease during trading times

What solution could overcome performance issue

A

Initiate a Service Limit Increase Request

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

How can a start up switch between new versions of lambda function and rollback easily?

A
  • Create alias with current version
  • Point app to the alias created for Lambda function
  • When you want to refresh app with next version, update alias
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What causes a Lambda job to land in a DLQ?

A
  1. Function times out when processing
  2. The function fails to retrieve inputs from the event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A developer is using all at once deployment policy which causes all services to be out temporarily

What could they use instead

A

Rolling with an additional batch

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

If you are using Lambda for mobile app deployment. How would you do different font themes based on if its android or ios?

A

Use the “context” object in mobile SDK because it gives the lambda function automatic access to device and app info

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

How would you update SAM template used to deploy a lambda function to instantly switch traffic once it has been built and tested?

A

AutoPublishAlias: live

https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorial-lambda-sam-template.html

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

If your output lambda is in a different format by mistake what error code will you get?

A

502

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

If you have many lambda functions that read from Kinesis Streams which is slowing down your app. How do you increase read throughput and reduce latency in your app?

A

Create a data stream consumer