Exam Information
Free practice questions with explanations
Amazon DVA-C02 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 15
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Deployment
A development team deploys a Python Lambda function through AWS CodePipeline using AWS CloudFormation. The function depends on a third-party library that is compiled with native extensions for Linux x86_64. Developers build the deployment package on macOS arm64 laptops, and the pipeline's test stage fails with an import error only when the function runs in Lambda. The team must keep the build reproducible and avoid changing the runtime. What is the BEST change to the pipeline?
Correct Answer: AExplanationNative extensions must be compiled for the Lambda execution architecture, so the dependencies should be built in a Linux x86_64 environment that matches the target, such as a CodeBuild step or a container built from the Lambda base image. Switching the function to arm64 would change the runtime architecture and would not match an x86_64 wheel. Attaching a layer built on a laptop repeats the same architecture mismatch and breaks reproducibility. Setting PYTHONPATH does not change which compiled binaries are loaded, so the import error persists.
-
2 Question 2 Single choice Deployment
A company runs a CodeDeploy blue/green deployment for an application on an Auto Scaling group behind an Application Load Balancer. The deployment's AfterAllowTestTraffic hook runs a script that calls the new environment through its test listener port. The hook intermittently fails because the new instances are not yet serving requests when the hook starts. The release manager wants the pipeline to fail fast and roll back automatically if the new version is unhealthy, while keeping the deployment to a single pipeline stage. What should the developer do?
Correct Answer: CExplanationA hook script that polls the new environment with retries until it becomes healthy, combined with automatic rollback on deployment failure, lets CodeDeploy fail the hook and roll back without a separate pipeline stage. BeforeInstall runs before the new instances exist to receive traffic, so tests there cannot validate the new environment through the test listener. Increasing the termination wait time only affects when old instances are terminated and does not fix the race. AllAtOnce removes the traffic-shifting safety that a blue/green rollout is meant to provide.
-
3 Question 3 Single choice Development with AWS Services
A developer maintains a Lambda function that processes order events from an Amazon SQS standard queue. The function is configured with batch size 10 and an event source mapping that uses ReportBatchItemFailures. Each message performs a write to a DynamoDB table with a conditional expression. Occasionally, messages are processed twice, and orders are sometimes double-charged downstream. The team cannot change the queue type, and the fix must be inside the function's code. What is the BEST change?
Correct Answer: CExplanationStandard SQS queues deliver at least once, so duplicates are expected, and idempotency must be enforced in the consumer. Recording the message ID with a conditional write makes a repeat delivery a no-op, and returning only the failed IDs in batchItemFailures avoids reprocessing successful records in the same batch. Batch size 1 reduces blast radius but does not prevent redelivery after a timeout. A longer visibility timeout only delays redelivery and cannot guarantee it never happens. Deleting at the start of the handler loses the message if processing fails.
-
4 Question 4 Single choice Development with AWS Services
A Lambda function is invoked asynchronously by an Amazon S3 event notification whenever a CSV file is uploaded. The function processes files of up to 4 GB, which requires about 3 GB of memory and runs for up to 12 minutes. The current design reads each object fully into memory with GetObject and occasionally fails with out-of-memory errors. The team must keep the Lambda architecture and minimise code changes. Which change should the developer make?
Correct Answer: BExplanationLambda allocates CPU in proportion to configured memory, and the 12-minute run fits the 15-minute maximum timeout. Streaming the GetObject body in chunks keeps memory use bounded, so the function does not need to hold 4 GB at once. Ephemeral storage is limited to 10240 MB and does not change how memory is consumed during processing, and downloading a 4 GB file would still be slow. Provisioned concurrency controls warm instances, not memory per invocation. Switching to EventBridge does not change the memory or timeout constraints.
-
5 Question 5 Single choice Security
A mobile application uses Amazon Cognito user pools for sign-in and calls an Amazon API Gateway REST API backed by Lambda. The API must allow only users in the admins group to call the POST /refunds method, and the authorization decision must use the group claim in the ID token without an extra call to a service. The developer has configured a Cognito user pool authorizer on the method. Support staff report that users in the admins group still receive 403 responses. What is the MOST likely cause, and what should be changed?
Correct Answer: DExplanationA Cognito user pool authorizer in API Gateway validates the token in the Authorization header, and the cognito:groups claim is present in the ID token but not in the access token. When the authorizer is configured to expect access tokens, the group claim is not available to the method's authorization logic, so the admins check fails. Sending a refresh token is never valid for API calls. Cognito user pool authorizers can work with group claims when the correct token is supplied, so a Lambda authorizer is unnecessary. A resource policy source IP denial would not produce group-based behaviour and was not described as present.
-
6 Question 6 Single choice Security
A healthcare startup stores patient intake forms in Amazon S3 and processes them with Lambda. Compliance requires that the service use a customer managed AWS KMS key, that the key policy restrict decrypt operations to the processing role, and that the key cannot be used by any other principal even if the bucket policy is misconfigured. The developer must also avoid storing the encryption key material in application code or environment variables. Which configuration meets these requirements?
Correct Answer: CExplanationSSE-KMS with a customer managed key ties object encryption to a key whose key policy can be scoped directly to the processing role, and kms:Decrypt must be allowed by the key policy as well as the caller's identity policy. This keeps the key outside application code and environment variables. SSE-S3 uses keys that AWS manages and cannot be restricted by a customer key policy. Storing raw key material in Secrets Manager violates the requirement to avoid key handling in code and adds manual cryptography. AWS managed keys cannot have their key policy edited, so the restriction cannot be enforced on the key itself.
-
7 Question 7 Single choice Security
A developer's Lambda function calls a third-party payments API that requires a client secret. The function currently reads the secret from an environment variable that was set in the console. A security review requires that the secret be rotated every 30 days without a code deployment, that retrieval be auditable, and that the function's cold-start latency not increase noticeably. Which approach BEST meets these requirements?
Correct Answer: CExplanationSecrets Manager supports scheduled automatic rotation and records retrievals in AWS CloudTrail, and the caching client keeps repeated reads inside the execution environment so latency stays low. Parameter Store SecureString can store the secret but does not provide built-in rotation for a third-party credential, and calling it on every invocation adds latency and cost. Encrypting an environment variable still leaves the secret set outside the rotation process and requires a redeploy to change it. Downloading from S3 has no rotation mechanism and gives weaker auditing of individual secret reads.
-
8 Question 8 Single choice Troubleshooting and Optimization
A team runs a Lambda function behind Amazon API Gateway. Users report that about 2 percent of requests return HTTP 502 errors, and the Lambda error metric shows no errors at all. The function's X-Ray traces show that successful invocations complete within 800 ms, but the API Gateway integration latency for failing requests is close to 29 seconds. API Gateway access logs show the integration status as 502 with the integration error message 'Malformed Lambda proxy response'. The function returns the response object using a custom dictionary that sometimes omits the statusCode key when an exception is caught. What is the root cause and the fix?
Correct Answer: CExplanationWith Lambda proxy integration, API Gateway expects the function to return an object with statusCode, and a missing or malformed structure produces a 502 with 'Malformed Lambda proxy response' even though Lambda reports success. The high integration latency reflects the function's response being rejected after a timeout-like wait in the reported pattern rather than a function error. A longer function timeout would not change the malformed format. Provisioned concurrency addresses cold starts, not a response-shape defect. Lowering the integration timeout would produce timeout errors rather than fix the malformed response.
-
9 Question 9 Single choice Troubleshooting and Optimization
A developer is asked to find the root cause of intermittent latency spikes in a Lambda function that calls Amazon DynamoDB. X-Ray shows that the DynamoDB subsegments occasionally take 400 ms, but the function's own code takes under 20 ms. CloudWatch shows that the function's Init Duration appears only on cold starts and is steady. The team wants to find the component causing the variance without changing the production traffic pattern. Which action is the BEST next step?
Correct Answer: CExplanationX-Ray already shows the slow DynamoDB subsegment, so the next step is to correlate it with table-level signals such as throttled requests and consumed capacity, and to inspect the subsegment for SDK retries. These steps look at the cause without altering the workload. Adding timing print statements gives only the same duration already seen in X-Ray and adds log noise. Changing memory is a tuning experiment rather than root-cause analysis, and it changes production behaviour. VPC flow logs do not show DynamoDB throttling or retry behaviour and would not explain the variance.
-
10 Question 10 Single choice Troubleshooting and Optimization
A Lambda function written in Node.js uses the AWS SDK for JavaScript v3 to call Amazon DynamoDB. The developers want consistent, structured logs that include the request ID and a correlation ID passed in the incoming event, and they want to trace SDK calls in X-Ray without modifying each client call. The function is deployed with active tracing enabled. Which change achieves this with the least code duplication?
Correct Answer: BExplanationThe Powertools logger emits structured JSON logs and can attach correlation identifiers, while the tracer integrates X-Ray instrumentation for SDK clients with minimal per-call code. Wrapping the client with the X-Ray SDK does work for tracing, but the logging portion with plain console.log remains unstructured and manual. Writing logs to /tmp and uploading to S3 adds latency and loses logs on failure. Disabling active tracing removes the requirement that X-Ray traces stay on and replaces it with a metric that does not provide SDK call traces.
-
11 Question 11 Single choice Development with AWS Services
A developer must design a data access layer for a Lambda-based order service. Orders are written by a single partition key of customerId, and the most frequent query is 'get all orders for a customer in the last 30 days, sorted by date'. The table must support a 10x traffic increase during seasonal sales without manual capacity changes, and the team wants to avoid provisioning read capacity for unused access patterns. Which table design BEST meets these requirements?
Correct Answer: DExplanationA composite primary key with customerId as partition key and an ISO 8601 orderDate sort key lets the 30-day query use a single Query with a range key condition, which is efficient and sorted by date. On-demand capacity mode absorbs sudden seasonal spikes without capacity planning. A GSI on customerId with orderId as the key does not give date ordering for that query without another sort key. A table keyed by date with customer as sort key forces Scan-based access and creates hot partitions for a single date. Relational storage is a valid pattern but does not meet the requirement to avoid provisioned capacity planning for unused access patterns.
-
12 Question 12 Multiple choice Deployment
A team deploys a serverless application with AWS SAM through AWS CodePipeline. Each release must run automated integration tests against a staging stack before production, the production deployment must roll back automatically on CloudWatch alarm breach, and the pipeline must not promote an artifact that failed the test stage. Which TWO actions together meet these requirements? (Choose two.)
Correct Answer: A, CExplanationA CodeBuild action that runs the tests and fails on a nonzero exit code stops the pipeline before promotion, which enforces the test gate. SAM's DeploymentPreference with a canary type and an alarm reference uses CodeDeploy traffic shifting and rolls back when the alarm enters the ALARM state. Artifact versioning helps traceability but does not block promotion of a failed build. Running tests against production violates the staging requirement. Provisioned concurrency keeps instances warm but does not validate correctness or trigger rollback.
-
13 Question 13 Multiple choice Security
A company exposes an Amazon API Gateway REST API that is consumed by partner applications. Each partner must be throttled independently, the API must reject requests without a valid key, and the backend Lambda function must not be callable directly by partners. The developer must also ensure that the API key values never appear in application source code. Which TWO actions together meet these requirements? (Choose two.)
Correct Answer: C, DExplanationUsage plans enforce per-key throttling and quotas, and methods that require an API key reject unauthenticated calls, which handles per-partner limits and access control at the gateway. Storing keys in Secrets Manager keeps the values out of source code and lets partners retrieve them with IAM-controlled access. Granting direct invoke rights to partners bypasses API Gateway's throttling and key checks. Embedding keys in client builds exposes them in source and build artifacts, which violates the requirement. A broad organizational resource policy on the Lambda function opens direct invocation paths that the requirement forbids.
-
14 Question 14 Multiple choice Troubleshooting and Optimization
A developer is optimising a Lambda function that processes image thumbnails and is billed at the configured memory and duration. Over one week, the function's p95 duration is 6 seconds at 512 MB, and the function is invoked 2 million times per month. The team must reduce cost without increasing p95 latency beyond 6 seconds. Which TWO actions are most likely to achieve this? (Choose two.)
Correct Answer: A, CExplanationLambda bills by memory and duration, so testing memory sizes against the latency target finds the cheapest configuration that still meets p95, and tools such as Compute Optimizer or power tuning automate that comparison. The arm64 architecture has a lower per-GB-second price, and whether it meets the latency target must be confirmed by testing. Raising memory to the maximum does not always reduce total cost because the higher per-GB-second rate may outweigh shorter duration. Placing the function in a VPC with a NAT gateway adds cost and does not reduce duration. SnapStart applies to Java and does not reduce per-invocation billing for Python.
-
15 Question 15 Single choice Deployment
A developer uses AWS CloudFormation to deploy a stack that contains an Amazon API Gateway REST API, a Lambda function, and an IAM role. The stack must be updated in a way that avoids an outage if the API's resource path changes. During a recent update, the stack entered UPDATE_ROLLBACK_FAILED because a new IAM role was created before the old one could be removed and the API deployment failed. The team wants to ensure future updates succeed even when a resource update fails. Which change to the stack or workflow BEST addresses this?
Correct Answer: AExplanationA change set shows the planned replacements before execution, and giving the AWS::ApiGateway::Deployment resource a logical ID tied to the API definition causes CloudFormation to create a fresh deployment on each relevant update, which avoids stuck deployment states. Retaining the role and disabling rollback leaves the stack in an unmanaged state and conflicts with the goal of reliable updates. Recreating the stack causes an outage and loses data for stateful resources. Moving the role out of CloudFormation removes infrastructure-as-code control, which the team did not ask for.
These are 15 of the 600 questions in the full DVA-C02 pack.
Get All 600 QuestionsGet all 600 questions & answers
Full access options for Amazon DVA-C02
Self-study
PDF Version
- 600 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 600 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 600 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the DVA-C02 Exam (AWS Certified Developer - Associate) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.