λ AWS Lambda - DVA-C02 Practice Questions

Master AWS Lambda for serverless compute — function configuration, runtimes, layers, concurrency, event sources, error handling, environment variables, and cold starts.

96Questions Available
3Exam Domains

Practice Lambda Questions Now

Start a timed practice session focusing on AWS Lambda topics from the DVA-C02 question bank.

Start DVA-C02 Practice Quiz →

DVA-C02 Lambda Question Bank (96 Questions)

Browse all 96 practice questions covering AWS Lambda for the DVA-C02 certification exam. Answers are intentionally hidden on this page so you can self-test first before checking results in quiz mode.

  1. Question 1Deployment

    A developer wants to version their Lambda function and create a stable alias 'production' that points to a tested version. If a new version has issues, they want to instantly roll back with zero downtime. Which Lambda feature enables this?

    ALambda Layers
    BLambda Aliases with weighted traffic shifting
    CLambda Environment Variables
    DLambda Destinations

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  2. Question 2Deployment

    A developer wants to test a new Lambda function alias configuration without affecting production traffic. Which Lambda feature allows routing a percentage of traffic to a new version?

    ALambda environment variables
    BLambda alias routing configuration (weighted alias)
    CLambda layers
    DLambda reserved concurrency

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  3. Question 3Development with AWS Services

    A developer creates a Lambda function and deploys it with an alias 'prod' pointing to version 5. They update the function and publish version 6. Does the 'prod' alias automatically point to version 6?

    AYes — aliases always point to the latest version
    BNo — the developer must manually update the alias to point to version 6
    CYes — if the function uses $LATEST
    DNo — aliases cannot be updated

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  4. Question 4Troubleshooting and Optimization

    A developer notices their Lambda function is experiencing cold starts in production. What is the MOST effective way to reduce cold start latency for critical functions?

    AIncrease Lambda timeout
    BEnable Lambda Provisioned Concurrency
    CReduce Lambda function package size
    DUse a different runtime

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  5. Question 5Development with AWS Services

    A developer wants to reduce Lambda function cold start times by keeping execution environments warm. Which approach is production-appropriate?

    APing Lambda every minute with a CloudWatch Events rule
    BUse Lambda Provisioned Concurrency
    CIncrease Lambda timeout to 15 minutes
    DDeploy Lambda in multiple regions

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  6. Question 6Deployment

    A developer deploys a new Lambda function version using CodeDeploy Canary10Percent5Minutes. What happens after 5 minutes?

    ADeployment is rolled back automatically
    B100% of traffic shifts to the new version if no alarms fire
    CAnother 10% shifts to the new version
    DThe deployment pauses for manual approval

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  7. Question 7Troubleshooting and Optimization

    A developer discovers that their Lambda function's reserved concurrency is 10, but the function receives bursts of 100 concurrent requests. What happens to the excess requests?

    AThey are queued automatically
    BThey receive a 429 (TooManyRequests) throttle error
    CLambda scales beyond the reserved concurrency
    DThey are dropped silently

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  8. Question 8Troubleshooting and Optimization

    A developer deploys a new Lambda function version. Users report 5xx errors from API Gateway. Without redeploying, how can they roll back instantly?

    ADelete the new Lambda version
    BUpdate the Lambda alias to point to the previous version
    CRedeploy the old CloudFormation stack
    DClear the API Gateway cache

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  9. Question 9Development with AWS Services

    A developer builds a Lambda function that must not exceed a specific concurrency to protect a downstream database. Which Lambda feature limits concurrent executions?

    ALambda memory limit
    BReserved concurrency
    CProvisioned concurrency
    DLambda timeout

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  10. Question 10Development with AWS Services

    A developer wants to trigger a Lambda function whenever a new object is uploaded to a specific S3 prefix. Which Lambda configuration enables this?

    ALambda Destinations
    BLambda Layers
    CS3 Event Notification
    DLambda Dead Letter Queue

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  11. Question 11Development with AWS Services

    A developer needs to call multiple AWS services from within a Lambda function using temporary credentials without hardcoding access keys. Which approach follows AWS best practices?

    AStore credentials in Lambda environment variables
    BEmbed credentials in the deployment package
    CAssign an IAM execution role to the Lambda function
    DUse AWS Secrets Manager with hardcoded ARN in code

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  12. Question 12Security

    A developer stores database passwords and API keys. They need these values to be encrypted, automatically rotated, and retrieved by Lambda at runtime. Which service is most appropriate?

    AAWS Systems Manager Parameter Store (Standard)
    BAWS Secrets Manager
    CAWS KMS Key Store
    DLambda Environment Variables with encryption helpers

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  13. Question 13Security

    A developer needs to grant a Lambda function read access to a specific S3 bucket. Following least privilege, which approach is best?

    AAttach AdministratorAccess to the Lambda execution role
    BCreate an IAM user with S3 access and pass credentials to Lambda
    CCreate an IAM execution role with S3:GetObject scoped to the specific bucket
    DMake the S3 bucket public

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  14. Question 14Deployment

    A developer uses AWS SAM to define Lambda functions and API Gateway resources as code. Which AWS service does SAM use to deploy the infrastructure?

    AAWS Elastic Beanstalk
    BAWS CodeDeploy
    CAWS CloudFormation
    DAWS Systems Manager

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  15. Question 15Troubleshooting and Optimization

    A Lambda function intermittently throws timeouts when connecting to an RDS database. Analysis shows it takes 2-3 seconds to establish a new connection on each invocation. Which optimization reduces this overhead?

    AIncrease Lambda memory allocation
    BEnable Lambda Provisioned Concurrency
    CMove database connection initialization outside the handler function
    DUse Lambda@Edge instead

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  16. Question 16Troubleshooting and Optimization

    A Lambda function processes messages from an SQS queue. Messages are being processed multiple times, causing duplicate operations. Which approach prevents duplicate processing?

    AIncrease Lambda concurrency
    BSwitch to an SQS FIFO queue with exactly-once processing
    CEnable SQS long polling
    DDecrease the visibility timeout

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  17. Question 17Troubleshooting and Optimization

    A Lambda function processes images uploaded to S3. Processing time ranges from 2-8 seconds, causing some invocations to time out with a 5-second limit. What is the most appropriate fix?

    AIncrease Lambda memory to always reduce execution time
    BEnable Lambda Provisioned Concurrency
    CIncrease the Lambda function timeout and profile the processing logic
    DMove image processing to EC2

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  18. Question 18Development with AWS Services

    A Lambda function needs to process messages from an SQS queue but should stop processing when the queue is empty. Which Lambda trigger behavior handles this automatically?

    ALambda polls the queue and scales down to zero when no messages are available
    BLambda uses long-polling and the event source mapping scales concurrency based on queue depth
    CLambda must be invoked manually when messages arrive
    DSQS sends a push notification to Lambda when messages are enqueued

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  19. Question 19Development with AWS Services

    A Lambda function requires access to a relational database. The function runs 500 concurrent executions and is causing too many database connections. What is the BEST solution?

    AIncrease Lambda memory to reduce cold starts
    BUse Amazon RDS Proxy to pool database connections
    CEnable Lambda provisioned concurrency
    DMove the database to DynamoDB

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  20. Question 20Development with AWS Services

    An S3 event triggers a Lambda function whenever a new object is uploaded. A developer notices some events are being processed twice. What should they implement?

    AEnable S3 versioning
    BAdd idempotency logic in the Lambda handler
    CSwitch to SQS instead of S3 triggers
    DReduce Lambda concurrency to 1

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  21. Question 21Development with AWS Services

    A Lambda function needs to call an AWS service API. What is the MOST secure way to grant it permissions?

    AEmbed AWS access keys in the function code
    BStore credentials in environment variables
    CAssign an IAM execution role to the Lambda function
    DUse a hardcoded IAM user ARN in the function

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  22. Question 22Development with AWS Services

    A developer needs to invoke a Lambda function asynchronously and doesn't need the result. Which invocation type should they use?

    ARequestResponse
    BEvent
    CDryRun
    DSynchronous

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  23. Question 23Development with AWS Services

    A developer wants to use API Gateway to expose a Lambda function as an HTTP endpoint without managing routing logic. Which integration should they choose?

    AREST API with HTTP integration
    BHTTP API with Lambda proxy integration
    CREST API with MOCK integration
    DWebSocket API

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  24. Question 24Development with AWS Services

    A developer builds a Lambda function triggered by API Gateway. The function needs to return binary image data. What must be configured?

    AEnable binary support in API Gateway and Base64-encode the response body
    BReturn the image as a URL only
    CUse a CloudFront distribution for binary responses
    DSwitch to ALB as the trigger

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  25. Question 25Security

    A Lambda function needs to access an encrypted S3 object using AWS KMS. The function receives an 'AccessDenied' error. What is the MOST likely cause?

    AS3 bucket policy denies Lambda
    BLambda execution role lacks kms:Decrypt permission on the KMS key
    CS3 object is using SSE-S3 instead of SSE-KMS
    DLambda is in a different region from S3

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  26. Question 26Security

    Which Cognito feature allows adding custom claims to JWT tokens during authentication via a Lambda function?

    APre-authentication trigger
    BPost-confirmation trigger
    CPre-token-generation trigger
    DCustom message trigger

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  27. Question 27Security

    A developer needs to encrypt an environment variable in a Lambda function so it's not visible in the console. Which approach is correct?

    AStore the value in plain text — Lambda encrypts all environment variables by default
    BEnable KMS encryption for the environment variable with a customer-managed key
    CUse Lambda layers to store secrets
    DUse S3 to store secrets and reference by name

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  28. Question 28Security

    A developer discovers that their Lambda function's environment variables containing secrets are visible in CloudTrail logs. How should this be mitigated?

    ADisable CloudTrail logging
    BUse AWS Secrets Manager or Parameter Store and fetch values at runtime
    CRotate environment variables daily
    DUse VPC endpoints to prevent logging

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  29. Question 29Deployment

    Which SAM resource type creates a Lambda function, an API Gateway endpoint, and the required permissions in a single declaration?

    AAWS::Serverless::Api
    BAWS::Serverless::Function with an Api event source
    CAWS::Lambda::Function
    DAWS::Serverless::Application

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  30. Question 30Deployment

    A developer wants to deploy Lambda function updates using traffic shifting with automatic rollback if errors exceed a threshold. Which service combination achieves this?

    ACodeDeploy with Lambda deployment group and CloudWatch alarms
    BCodePipeline with manual approval
    CCloudFormation with Lambda version ARN
    DElastic Beanstalk with Lambda backend

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  31. Question 31Troubleshooting and Optimization

    A Lambda function logs errors intermittently. A developer wants to trace requests end-to-end through Lambda, API Gateway, and DynamoDB. Which AWS service should they use?

    ACloudWatch Logs
    BAWS X-Ray
    CCloudTrail
    DVPC Flow Logs

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  32. Question 32Troubleshooting and Optimization

    A Lambda function's execution time is approaching the 15-minute limit due to a large data processing job. What is the BEST architectural solution?

    AIncrease Lambda memory to reduce execution time
    BBreak the job into smaller tasks using Step Functions
    CUse provisioned concurrency
    DIncrease Lambda timeout to 30 minutes

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  33. Question 33Troubleshooting and Optimization

    A Lambda function writes to DynamoDB but occasionally fails with a 'ProvisionedThroughputExceededException'. What should the developer do?

    ACatch the exception and implement exponential backoff before retrying
    BSwitch to a scan operation
    CReduce the Lambda concurrency limit
    DIncrease the Lambda memory

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  34. Question 34Troubleshooting and Optimization

    A developer needs to set an alert when a Lambda function's error rate exceeds 5% over 5 minutes. Which service is used?

    AAWS X-Ray
    BCloudWatch Alarm on Errors metric
    CAWS Config rule
    DCloudTrail event rule

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  35. Question 35Troubleshooting and Optimization

    A developer deploys a Lambda function and notices the function runs correctly locally but fails with a 'module not found' error in AWS. What is the MOST likely cause?

    ALambda timeout is too short
    BThe dependency is not included in the deployment package
    CLambda has insufficient memory
    DThe function needs a VPC

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  36. Question 36Troubleshooting and Optimization

    A CloudWatch log group is filling up with debug logs from a Lambda function in production, increasing storage costs. What is the BEST solution?

    ADisable CloudWatch logging for the function
    BSet a CloudWatch log group retention policy to expire logs after 7 days
    CReduce Lambda concurrency
    DMove logs to S3

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  37. Question 37Troubleshooting and Optimization

    A Lambda function processes SQS messages but is timing out on 20% of invocations. The function reads from an RDS instance. What is the MOST likely bottleneck?

    ASQS queue has too many messages
    BRDS connection pool is exhausted due to high Lambda concurrency
    CLambda memory is too low
    DSQS visibility timeout is too short

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  38. Question 38Troubleshooting and Optimization

    A developer wants to automatically scale Lambda concurrency based on SQS queue depth. What is the correct statement?

    ALambda auto-scales automatically based on the number of messages in the SQS queue when using event source mapping
    BThe developer must configure Application Auto Scaling for Lambda
    CLambda concurrency is fixed and cannot be auto-scaled
    DOnly FIFO queues support Lambda auto-scaling

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  39. Question 39Troubleshooting and Optimization

    A Lambda function is hitting the 512 MB /tmp storage limit during processing. What is the BEST solution?

    AIncrease Lambda memory to increase /tmp size
    BConfigure Lambda /tmp storage up to 10 GB in function settings
    CUse an EFS mount for additional storage
    DSwitch from Lambda to EC2

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  40. Question 40Development with AWS Services

    An application publishes 100 messages per second to an SNS topic. Several Lambda functions subscribe. How does SNS deliver messages to Lambda?

    ALambda polls SNS for messages
    BSNS pushes messages to Lambda, invoking each subscriber function asynchronously
    CLambda reads from the SNS queue using long-polling
    DSNS batches messages and delivers them once per minute

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  41. Question 41Development with AWS Services

    A developer needs to share common code (e.g., a validation library) across multiple Lambda functions. What is the BEST approach?

    ACopy the code into each Lambda function package
    BUse Lambda Layers to share common code
    CDeploy the code as a separate Lambda function
    DStore the code in S3 and download at runtime

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  42. Question 42Development with AWS Services

    A developer builds a Lambda function that processes S3 upload events. The function should retry on failure but avoid processing duplicate events. What pattern should be used?

    ASynchronous invocation with retry logic
    BAsynchronous invocation with Lambda destinations for failures
    CS3 → SQS → Lambda with idempotency key tracking
    DDirect S3 trigger with Lambda reserved concurrency of 1

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  43. Question 43Development with AWS Services

    A Lambda function needs to access resources in a private VPC (RDS, ElastiCache). What configuration is required?

    AEnable Lambda VPC configuration with subnet IDs and security group IDs
    BUse a NAT Gateway for Lambda internet access
    CPeer the Lambda execution VPC with the resource VPC
    DUse AWS PrivateLink

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  44. Question 44Development with AWS Services

    A developer deploys a Lambda function that reads from a parameter in AWS Systems Manager Parameter Store on each invocation, causing latency. How should they optimize this?

    AStore the parameter in the Lambda environment variables
    BCache the parameter value in the Lambda execution context (outside handler) and refresh on TTL expiry
    CStore the parameter in DynamoDB
    DRead the parameter once using CloudFormation

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  45. Question 45Security

    A Lambda function uses an IAM role with AmazonDynamoDBFullAccess but an SCP in the organization denies DynamoDB writes. Can the function write to DynamoDB?

    AYes — IAM role permissions override SCPs
    BNo — SCPs apply as an additional guard; both must allow the action
    CYes — Lambda is exempt from SCPs
    DNo — SCPs override all IAM policies including roles

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  46. Question 46Security

    A Lambda function in a VPC needs to access AWS KMS. Which network configuration avoids routing traffic over the internet?

    ANAT Gateway
    BVPC endpoint for KMS (Interface Endpoint)
    CInternet Gateway
    DTransit Gateway

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  47. Question 47Security

    A developer needs to securely pass a database password to a Lambda function at deploy time. The password must not be visible in CloudFormation or Lambda console. What should they do?

    APass it as a Lambda environment variable
    BStore it in Secrets Manager and reference it dynamically in Lambda at runtime
    CEncode it as Base64 in the CloudFormation template
    DStore it in a private S3 object

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  48. Question 48Deployment

    A developer uses AWS SAM local for local testing. Which command invokes a Lambda function locally?

    Asam build
    Bsam deploy
    Csam local invoke
    Dsam package

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  49. Question 49Deployment

    A developer builds a multi-stage Docker image for a Lambda function. Which base image should they use for production Lambda deployments?

    Aubuntu:latest
    BAn AWS-provided Lambda base image from ECR Public (public.ecr.aws/lambda/python:3.12)
    Calpine:latest
    Damazonlinux:2

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  50. Question 50Troubleshooting and Optimization

    A Lambda function with 256 MB memory takes 3 seconds to complete. A developer increases the memory to 1024 MB. What is the EXPECTED outcome?

    AExecution time increases because more memory is allocated
    BExecution time decreases and cost may also decrease if CPU-bound work completes faster
    CNo change — Lambda performance is independent of memory
    DCost always increases linearly with memory

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  51. Question 51Troubleshooting and Optimization

    A developer notices a Lambda function is intermittently failing with 'TooManyRequestsException'. What should they do?

    AIncrease Lambda memory
    BRequest a Lambda concurrency limit increase or implement an SQS queue buffer
    CIncrease the function timeout
    DEnable Lambda provisioned concurrency

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  52. Question 52Troubleshooting and Optimization

    A Lambda function uses AWS SDK calls that occasionally fail. A developer wants to monitor the retry behavior. Which SDK feature provides visibility into retries?

    AEnabling X-Ray tracing on the SDK
    BSetting the SDK logger to DEBUG level
    CUsing CloudTrail to log all SDK calls
    DMonitoring Lambda timeout metrics

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  53. Question 53Troubleshooting and Optimization

    A developer wants to test an SQS-triggered Lambda function locally. Which SAM CLI command runs the function locally?

    Asam local invoke with an SQS event JSON payload
    Bsam remote invoke
    Csam local start-api
    Dsam sync

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  54. Question 54Troubleshooting and Optimization

    A developer wants to measure custom business metrics (e.g., orders processed) from a Lambda function. Which is the MOST efficient approach?

    AWrite the metric to DynamoDB and query later
    BUse CloudWatch PutMetricData API or CloudWatch Embedded Metric Format (EMF)
    CLog the metric value as plain text
    DUse CloudTrail for business event tracking

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  55. Question 55Troubleshooting and Optimization

    A developer wants to identify the most time-consuming downstream service call in a Lambda function. Which X-Ray concept shows this?

    AX-Ray sampling rate
    BX-Ray subsegment with timing for each downstream call
    CX-Ray annotations
    DX-Ray groups

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  56. Question 56Troubleshooting and Optimization

    A Lambda function processes an SQS batch of 10 messages. Message #5 fails. If the function throws an exception, what happens to all 10 messages?

    AOnly message #5 is retried
    BAll 10 messages become visible again after the visibility timeout and are retried
    CMessages 1-4 are deleted; messages 5-10 are retried
    DAll 10 messages are sent to the DLQ

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  57. Question 57Troubleshooting and Optimization

    A developer wants to alert when the P99 latency of a Lambda function exceeds 2 seconds. Which CloudWatch feature is needed?

    ACloudWatch Standard Resolution metric alarm
    BCloudWatch metric math with P99(Duration) statistic in the alarm
    CX-Ray latency histogram
    DCloudWatch Logs Insights alert

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  58. Question 58Development with AWS Services

    A developer writes a Lambda function that calls third-party APIs. The function must retry up to 3 times with exponential backoff on transient failures. Which approach is correct?

    AConfigure Lambda's maximum retry attempts to 3 in the event source mapping
    BImplement retry logic with exponential backoff inside the function handler
    CUse SQS DLQ to automatically retry
    DSet Lambda timeout to 3 minutes to allow retries

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  59. Question 59Development with AWS Services

    An application uses SQS and Lambda. The developer sets the Lambda event source mapping BatchSize to 10. What does this mean?

    ALambda polls SQS 10 times per second
    BLambda receives up to 10 messages per invocation
    CLambda runs 10 concurrent functions
    DLambda waits for 10 seconds before polling

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  60. Question 60Development with AWS Services

    A developer wants API Gateway to return a custom error message when the Lambda function returns a specific error string. Which feature maps Lambda errors to HTTP responses?

    AAPI Gateway resource policy
    BAPI Gateway integration response with regular expression mapping
    CLambda Destinations
    DAPI Gateway usage plan

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  61. Question 61Development with AWS Services

    A developer uses AWS AppConfig to manage feature flags for a Lambda function. How does the function retrieve the latest configuration?

    ALambda restarts automatically when AppConfig changes
    BThe function uses the AppConfig Lambda extension or AWS SDK to fetch configuration on startup and poll for updates
    CAppConfig pushes configuration to Lambda environment variables
    DLambda reads configuration from an S3 bucket

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  62. Question 62Development with AWS Services

    A developer wants to test Lambda function behavior for a specific event payload without deploying. Which approach requires NO deployment?

    ADeploy the function and invoke with the AWS CLI
    BUse 'sam local invoke' with the event JSON
    CUse the Lambda console test tab with a configured test event
    DBoth B and C

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  63. Question 63Security

    A developer finds that a Lambda function can access resources it should not. How should they audit the effective permissions?

    AReview the Lambda execution role's attached policies using IAM
    BCheck CloudTrail for all Lambda API calls
    CUse AWS Config to list Lambda resources
    DReview VPC security groups

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  64. Question 64Security

    A developer creates a resource policy on a Lambda function. What is the primary use case?

    AGranting Lambda execution permissions to an IAM role
    BAllowing external AWS services (S3, API Gateway, EventBridge) or accounts to invoke the function
    CDefining Lambda environment variables
    DRestricting Lambda VPC access

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  65. Question 65Security

    An organization requires that all Lambda functions use customer-managed KMS keys for environment variable encryption. How is this enforced at scale?

    AManually configure each Lambda function
    BUse an AWS Config rule or SCP to enforce KMS key usage for Lambda
    CEnable default KMS encryption in the AWS account
    DUse AWS Secrets Manager for all variables

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  66. Question 66Deployment

    A developer uses CloudFormation to create a Lambda function. The function needs the ARN of an SQS queue created in the same stack. How should they reference it?

    AHardcode the SQS queue ARN
    BUse Fn::GetAtt: [MySQSQueue, Arn]
    CUse a CloudFormation Mapping
    DUse a Parameter for the SQS ARN

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  67. Question 67Troubleshooting and Optimization

    A Lambda function has a 3-second execution time but is billed for 5 seconds. What is the MOST likely cause?

    ALambda charges a minimum of 5 seconds per invocation
    BCold start time is included in billing duration
    CThe function is using provisioned concurrency
    DLambda bills in 100ms increments rounded up

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  68. Question 68Troubleshooting and Optimization

    A developer uses CloudWatch Logs and wants to find all ERROR log lines from a Lambda function in the last hour. Which tool provides this fastest?

    ACloudWatch Metrics
    BCloudWatch Logs Insights with a query filtering for ERROR
    CAWS X-Ray trace search
    DCloudTrail event history

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  69. Question 69Troubleshooting and Optimization

    An application experiences intermittent failures in Lambda with 'Task timed out after X seconds'. The function calls an external API. What is the BEST fix?

    AIncrease Lambda timeout to 15 minutes
    BSet a connection and read timeout on the external HTTP client, shorter than the Lambda timeout; implement a fallback
    CUse SQS to buffer the requests
    DEnable Lambda provisioned concurrency

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  70. Question 70Troubleshooting and Optimization

    A developer wants to optimize cost for a Lambda function that runs 10 million times/month with execution duration under 100ms. Which configuration change could help?

    AIncrease Lambda timeout
    BReduce Lambda memory to the minimum required for reliable execution using Lambda Power Tuning
    CEnable provisioned concurrency
    DSwitch to Graviton2 architecture

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  71. Question 71Troubleshooting and Optimization

    A developer wants to measure the impact of a code optimization on Lambda cold start times. Which metric should they track?

    ALambda Duration
    BLambda Init Duration (reported in CloudWatch Logs for cold starts)
    CLambda ConcurrentExecutions
    DLambda Throttles

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  72. Question 72Development with AWS Services

    A developer uses Lambda with a VPC. After adding VPC configuration, the function can no longer reach the internet. What is missing?

    AA public subnet for Lambda
    BA NAT Gateway in a public subnet with a route from Lambda's private subnet
    CAn Internet Gateway attached to Lambda's subnet
    DA VPC endpoint for internet access

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  73. Question 73Development with AWS Services

    A Lambda function triggered by API Gateway needs to return a binary PDF response. What must the developer configure?

    ASet Content-Type to text/pdf in the Lambda response
    BEnable binary media type 'application/pdf' in API Gateway and return Base64-encoded body with isBase64Encoded:true
    CStore the PDF in S3 and return a redirect URL
    DUse a WebSocket API for binary data

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  74. Question 74Development with AWS Services

    A developer uses API Gateway REST API. The backend integration is a Lambda function. To avoid re-invoking Lambda for identical requests within 5 minutes, what should they configure?

    ALambda provisioned concurrency
    BAPI Gateway response caching with a 300-second TTL
    CCloudFront caching in front of API Gateway
    DLambda environment variable caching

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  75. Question 75Development with AWS Services

    A developer uses API Gateway with a Lambda proxy integration. The Lambda function returns a response without a 'statusCode' field. What does API Gateway return to the client?

    A200 OK with the raw Lambda response
    B502 Bad Gateway — Lambda response format is invalid
    C400 Bad Request
    D500 Internal Server Error

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  76. Question 76Development with AWS Services

    A developer uses Lambda and needs to run initialization code only once per cold start (e.g., loading a configuration file). Where should this code be placed?

    AInside the handler function
    BIn the module-level scope (outside the handler function)
    CIn a Lambda Layer
    DIn a CloudFormation custom resource

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  77. Question 77Security

    A developer uses a Lambda function and accidentally exposes the execution role ARN in logs. What risk does this create?

    ANo risk — ARNs are not sensitive
    BAn attacker with knowledge of the ARN could attempt to assume the role if the trust policy allows it
    CThe ARN can be used to steal KMS keys
    DThe ARN leaks the AWS account ID

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  78. Question 78Security

    A developer stores secrets in AWS Secrets Manager and wants automatic rotation with a Lambda function. Which IAM permission does the rotation Lambda function need on Secrets Manager?

    Asecretsmanager:GetSecretValue only
    Bsecretsmanager:DescribeSecret, GetSecretValue, PutSecretValue, UpdateSecretVersionStage
    Csecretsmanager:RotateSecret only
    DFull secretsmanager:* permissions

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  79. Question 79Security

    A developer has a Lambda function with IAM-based API Gateway auth. The function returns a successful response, but the client receives 403. What is the cause?

    AThe Lambda function has insufficient memory
    BThe client's IAM credentials lack execute-api:Invoke permission on the API method ARN
    CThe API Gateway is in a different region
    DThe Lambda execution role denies the call

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  80. Question 80Security

    A developer uses Lambda and wants to restrict which VPCs can connect to the function's URL. Which mechanism controls this?

    ALambda resource policy with VPC condition
    BLambda function URL with AuthType: AWS_IAM and a resource policy restricting VPC endpoints
    CSecurity group for Lambda VPC interface
    DVPC endpoint policy for Lambda

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  81. Question 81Deployment

    A developer creates a SAM template with an API Gateway and Lambda. After deployment, they update only the Lambda function code. What is the FASTEST way to redeploy?

    Asam deploy
    Bsam sync --code (deploys only the code change, bypassing CloudFormation)
    Caws cloudformation update-stack
    DManually zip and upload to Lambda

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  82. Question 82Deployment

    A developer wants to package and deploy a Lambda function along with its dependencies as a container image. What is the maximum container image size?

    A250 MB
    B512 MB
    C10 GB
    D1 GB

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  83. Question 83Deployment

    A developer uses CloudFormation and wants to output the Lambda function ARN for use by other teams. Which section and function accomplish this?

    AResources section with Fn::GetAtt
    BOutputs section with Fn::GetAtt or !GetAtt and optional Export
    CParameters section with AllowedValues
    DMappings section

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  84. Question 84Deployment

    A developer uses CloudFormation. A Lambda function requires the ARN of an SNS topic created in the same template. Which method is MOST appropriate?

    AHardcode a placeholder ARN
    BUse Ref (for SNS topic ARN) or Fn::GetAtt in the Lambda environment variables
    CCreate the SNS topic in a separate stack
    DUse a CloudFormation mapping with the ARN

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  85. Question 85Deployment

    A developer wants to run integration tests against a deployed Lambda function as part of the CodePipeline after deployment. Which approach is BEST?

    ARun tests in the CodeBuild build stage before deployment
    BAdd a Test stage after Deploy, using CodeBuild to invoke Lambda endpoints and validate responses
    CUse CloudWatch alarms to detect test failures
    DAdd a manual approval stage for testing

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  86. Question 86Deployment

    A developer uses SAM and wants to grant the Lambda function permission to read from an SQS queue. Which SAM feature simplifies this?

    AManually attach an IAM policy to the role
    BUse SAM Policy Templates (SQSPollerPolicy) in the function's Policies property
    CUse IAM managed policy AmazonSQSFullAccess
    DAdd an event source mapping only

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  87. Question 87Troubleshooting and Optimization

    A developer wants to trace all Lambda cold starts over the past 24 hours. Which CloudWatch filter identifies cold starts?

    AFilter @message like /TIMEOUT/
    BFilter @message like /Init Duration/
    CFilter @message like /COLD_START/
    DFilter @message like /START RequestId/

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  88. Question 88Troubleshooting and Optimization

    A developer's Lambda function processes S3 events but some events are never processed and no errors appear in logs. What should they check?

    ALambda timeout is too short
    BS3 event notifications for delivery failures; check Lambda concurrency limits and the Lambda async invocation queue
    CCloudTrail for denied S3 events
    DThe Lambda function's VPC configuration

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  89. Question 89Troubleshooting and Optimization

    A developer finds that an API Gateway endpoint's latency increased after a Lambda function update. How should they identify the cause?

    ARoll back the Lambda update immediately
    BCompare X-Ray traces before and after the update to identify which subsegment increased
    CIncrease Lambda memory to compensate
    DCheck VPC Flow Logs for network issues

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  90. Question 90Troubleshooting and Optimization

    A developer deploys a Lambda function and finds that execution time increases linearly with input size, suggesting an O(n²) algorithm. What tools help confirm this?

    ACloudTrail logs
    BLambda Duration metric and X-Ray traces with custom subsegments around the suspected algorithm
    CS3 access logs
    DVPC Flow Logs

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  91. Question 91Troubleshooting and Optimization

    A developer is troubleshooting a Lambda function that occasionally returns incorrect results, but logs show no errors. What should they suspect?

    ALambda cold starts are corrupting state
    BGlobal/module-level state is persisted across invocations (execution context reuse) and becoming stale
    CLambda memory is too low
    DCloudWatch Logs are missing entries

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  92. Question 92Troubleshooting and Optimization

    A developer is profiling a Lambda function and discovers that 60% of time is spent loading a 50 MB ML model on each invocation. What is the BEST optimization?

    AIncrease Lambda memory to 10 GB
    BLoad the model in the module-level initialization code so it's cached across warm invocations
    CStore the model in DynamoDB
    DMove to an EC2 instance

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  93. Question 93Troubleshooting and Optimization

    A Lambda function uses a library that logs extensively at DEBUG level, filling CloudWatch Logs with noise. What is the BEST approach to reduce log volume?

    ADisable CloudWatch Logs for the function
    BSet the library's log level to WARNING or ERROR programmatically in the handler initialization
    CUse a custom Lambda runtime
    DMove the function to EC2

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  94. Question 94Troubleshooting and Optimization

    A developer uses Lambda and wants to prevent the function from being invoked if a downstream service is degraded. Which pattern implements circuit-breaking?

    AReduce Lambda concurrency to 0
    BTrack failure counts in ElastiCache/DynamoDB and stop calling the downstream service when failures exceed a threshold
    CUse Lambda retry on failure
    DUse CloudWatch alarm to disable the Lambda trigger

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  95. Question 95Troubleshooting and Optimization

    A developer uses Lambda with SQS event source mapping and wants to improve throughput processing messages faster. Which configuration change helps?

    AIncrease Lambda timeout
    BIncrease BatchSize and enable concurrent batches (MaximumConcurrency) for the event source mapping
    CIncrease SQS message size
    DSwitch to FIFO queue

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  96. Question 96Troubleshooting and Optimization

    A developer discovers a memory leak in a Lambda function — memory usage grows with each warm invocation. What is the root cause?

    ALambda's memory limit is too low
    BModule-level objects accumulating state across warm invocations without cleanup
    CLambda doesn't support garbage collection
    DThe Lambda runtime has a bug

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz

Key Lambda Concepts for DVA-C02

lambdaserverlessfunctionruntimelayerconcurrencycold startevent source mappingaliasversion

DVA-C02 Lambda Exam Tips

AWS Lambda questions in DVA-C02 are typically scenario-based. Focus on application development patterns, event-driven integration, and secure coding on AWS. Priority concepts: lambda, serverless, function, runtime, layer, concurrency.

What DVA-C02 Expects

  • Anchor your answer in select developer-friendly managed services and patterns that minimize custom undifferentiated code.
  • Lambda scenarios for DVA-C02 are frequently mapped to Domain 1 (32%), Domain 3 (24%), Domain 4 (18%), so read the objective carefully before picking controls or architecture.
  • Expect multi-topic scenarios where Lambda interacts with IAM, networking, storage, or observability patterns rather than appearing as an isolated question.
  • When two options are both technically valid, prefer the choice that best aligns with the exam's operational scope (Associate) and vendor best practices.

High-Value Lambda Concepts

  • Know the core Lambda building blocks cold: lambda, serverless, function, runtime.
  • Review the edge-case features and limits for layer, concurrency; these details are commonly used to differentiate answer choices.
  • Practice service-integration reasoning: how Lambda pairs with API Gateway, DynamoDB, SQS, Step Functions in real deployment patterns.
  • For DVA-C02, explain why the chosen Lambda design meets reliability, security, and cost expectations better than the alternatives.

Common DVA-C02 Traps

  • Watch for using infrastructure-centric answers instead of application-centric ones.
  • Questions in Development with AWS Services often include distractors that look correct for Lambda but violate least-privilege, durability, or availability requirements.
  • Avoid picking options purely by feature name; validate data path, failure handling, and governance impact before answering.
  • If the prompt hints at automation or repeatability, eliminate manual-only operational answers first.

Fast Review Checklist

  • Can you compare at least two Lambda implementation paths and justify which one best fits the scenario?
  • Can you map the chosen answer back to Development with AWS Services (32%) outcomes for DVA-C02?
  • Can you explain security and access boundaries for Lambda without relying on default-open assumptions?
  • Can you describe how Lambda integrates with API Gateway and DynamoDB during failure, scaling, and monitoring events?

Exam Domains Covering Lambda

Related Resources

More DVA-C02 Study Resources