DVA-C02 sample exam questions

15 exam-style questions for AWS DVA-C02: Developer Associate, with answers and explanations. Take them as a timed practice exam first if you want a score out of 1000.

  1. Question 1Single choiceDevelopment with AWS Services
    A developer is creating a template that uses AWS CloudFormation to deploy an application. The application is serverless and uses Amazon API Gateway, Amazon DynamoDB, and AWS Lambda.
    Which AWS service or tool should the developer use to define serverless resources in YAML?
    1. A
      CloudFormation serverless intrinsic functions
    2. B
      AWS Elastic Beanstalk
    3. C
      AWS Serverless Application Model (AWS SAM)
    4. D
      AWS Cloud Development Kit (AWS CDK)
    Show answer

    Correct answer: C

    Why

    AWS SAM extends CloudFormation with a short YAML syntax for serverless resources. CloudFormation has no serverless intrinsic functions, Elastic Beanstalk runs applications on servers, and AWS CDK defines infrastructure in programming languages.

  2. Question 2Single choiceDeployment
    A development team wants to build a continuous integration/continuous delivery (CI/CD) pipeline. The team is using AWS CodePipeline to automate the code build and deployment. The team wants to store the program code to prepare for the CI/CD pipeline.
    Which AWS service should the team use to store the program code?
    1. A
      AWS CodeDeploy
    2. B
      AWS CodeArtifact
    3. C
      AWS CodeCommit
    4. D
      Amazon CodeGuru
    Show answer

    Correct answer: C

    Why

    AWS CodeCommit is a source control repository for program code, which can be a pipeline's source. CodeDeploy deploys, CodeArtifact stores packages, and CodeGuru reviews code. AWS has since limited CodeCommit for new customers, so this question reflects an older recommendation.

  3. Question 3Single choiceDeployment
    A company has deployed an application on AWS Elastic Beanstalk. The company has configured the Auto Scaling group that is associated with the Elastic Beanstalk environment to have five Amazon EC2 instances. If the capacity is fewer than four EC2 instances during the deployment, application performance degrades. The company is using the all-at-once deployment policy.
    What is the MOST cost-effective way to solve the deployment issue?
    1. A
      Change the Auto Scaling group to six desired instances.
    2. B
      Change the deployment policy to traffic splitting. Specify an evaluation time of 1 hour.
    3. C
      Change the deployment policy to rolling with additional batch. Specify a batch size of 1.
    4. D
      Change the deployment policy to rolling. Specify a batch size of 2.
    Show answer

    Correct answer: C

    Why

    Rolling with additional batch adds one new instance first, so capacity stays at five during deployment. Rolling with a batch size of 2 drops capacity to 3, traffic splitting doubles instances for longer, and keeping six instances costs more all the time.

  4. Question 4Single choiceDevelopment with AWS Services
    A company is planning to deploy an application on AWS behind an Elastic Load Balancer. The application uses an HTTP/HTTPS listener and must access the client IP addresses.

    Which load-balancing solution meets these requirements?
    1. A
      Use an Application Load Balancer and the X-Forwarded-For headers.
    2. B
      Use a Network Load Balancer (NLB). Enable proxy protocol support on the NLB and the target application.
    3. C
      Use an Application Load Balancer. Register the targets by the instance ID.
    4. D
      Use a Network Load Balancer and the X-Forwarded-For headers.
    Show answer

    Correct answer: A

    Why

    An ALB handles HTTP and HTTPS and passes the client's address in the X-Forwarded-For header. An NLB does not use HTTP headers, and registering targets by instance ID alone does not give an application the client IP in this case.

  5. Question 5Single choiceSecurity
    A developer is building a highly secure healthcare application using serverless components. This application requires writing temporary data to /tmp storage on an AWS Lambda function.

    How should the developer encrypt this data?
    1. A
      Enable Amazon EBS volume encryption with an AWS KMS key in the Lambda function configuration so that all storage attached to the Lambda function is encrypted.
    2. B
      Set up the Lambda function with a role and key policy to access an AWS KMS key. Use the key to generate a data key used to encrypt all data prior to writing to /tmp storage.
    3. C
      Use OpenSSL to generate a symmetric encryption key on Lambda startup. Use this key to encrypt the data prior to writing to /tmp.
    4. D
      Use an on-premises hardware security module (HSM) to generate keys, where the Lambda function requests a data key from the HSM and uses that to encrypt data on all requests to the function.
    Show answer

    Correct answer: B

    Why

    A KMS key with a role and key policy can generate a data key to encrypt data before writing to /tmp. Lambda does not use EBS volumes, a key generated with OpenSSL is not managed or protected, and on-premises HSM calls add latency and complexity.

  6. Question 6Single choiceDeployment
    A developer is creating a Ruby application and needs to automate the deployment, scaling, and management of an environment without requiring knowledge of the underlying infrastructure.

    Which service would best accomplish this task?
    1. A
      AWS CodeDeploy
    2. B
      AWS CloudFormation
    3. C
      AWS OpsWorks
    4. D
      AWS Elastic Beanstalk
    Show answer

    Correct answer: D

    Why

    AWS Elastic Beanstalk deploys, scales and manages Ruby applications and hides the infrastructure. CodeDeploy only deploys code, CloudFormation requires defining resources, and OpsWorks requires configuration management knowledge.

  7. Question 7Single choiceSecurity
    A company built a new application in the AWS Cloud. The company automated the bootstrapping of new resources with an Auto Scaling group by using AWS CloudFormation templates. The bootstrap scripts contain sensitive data.

    The company needs a solution that is integrated with CloudFormation to manage the sensitive data in the bootstrap scripts.

    Which solution will meet these requirements in the MOST secure way?
    1. A
      Put the sensitive data into a CloudFormation parameter. Encrypt the CloudFormation templates by using an AWS Key Management Service (AWS KMS) key.
    2. B
      Put the sensitive data into an Amazon S3 bucket. Update the CloudFormation templates to download the object from Amazon S3 during bootstrap.
    3. C
      Put the sensitive data into AWS Systems Manager Parameter Store as a secure string parameter. Update the CloudFormation templates to use dynamic references to specify template values.
    4. D
      Put the sensitive data into Amazon Elastic File System (Amazon EFS). Enforce EFS encryption after file system creation. Update the CloudFormation templates to retrieve data from Amazon EFS.
    Show answer

    Correct answer: C

    Why

    A secure string in Parameter Store with a dynamic reference keeps sensitive data out of the template. A CloudFormation parameter does not store it securely, and S3 or EFS downloads do not integrate this way and need separate protection.

  8. Question 8Single choiceDevelopment with AWS Services
    Given the following AWS CloudFormation template:



    What is the MOST efficient way to reference the new Amazon S3 bucket from another AWS CloudFormation template?
    1. A
      Add an Export declaration to the Outputs section of the original template and use ImportValue in other templates.
    2. B
      Add Exported: true to the Content.Bucket in the original template and use ImportResource in other templates.
    3. C
      Create a custom AWS CloudFormation resource that gets the bucket name from the ContentBucket resource of the first stack.
    4. D
      Use Fn::Include to include the existing template in other templates and use the ContentBucket resource directly.
    Show answer

    Correct answer: A

    Why

    An Export in the Outputs section with Fn::ImportValue in other templates is CloudFormation's built-in way to reference across stacks. There is no Exported property or ImportResource for this, a custom resource adds work, and Fn::Include would not reference the existing bucket.

  9. Question 9Single choiceSecurity
    A developer is writing an application that will retrieve sensitive data from a third-party system. The application will format the data into a PDF file. The PDF file could be more than 1 MB. The application will encrypt the data to disk by using AWS Key Management Service (AWS KMS). The application will decrypt the file when a user requests to download it. The retrieval and formatting portions of the application are complete.

    The developer needs to use the GenerateDataKey API to encrypt the PDF file so that the PDF file can be decrypted later. The developer needs to use an AWS KMS symmetric customer managed key for encryption.

    Which solutions will meet these requirements?
    1. A
      Write the encrypted key from the GenerateDataKey API to disk for later use. Use the plaintext key from the GenerateDataKey API and a symmetric encryption algorithm to encrypt the file.
    2. B
      Write the plain text key from the GenerateDataKey API to disk for later use. Use the encrypted key from the GenerateDataKey API and a symmetric encryption algorithm to encrypt the file.
    3. C
      Write the encrypted key from the GenerateDataKey API to disk for later use. Use the plaintext key from the GenerateDataKey API to encrypt the file by using the KMS Encrypt API.
    4. D
      Write the plain text key from the GenerateDataKey API to disk for later use. Use the encrypted key from the GenerateDataKey API to encrypt the file by using the KMS Encrypt API.
    Show answer

    Correct answer: A

    Why

    Encrypt the file with the plaintext data key and a symmetric algorithm, then keep only the encrypted key for later decryption. A plaintext key must never be stored on disk, and the KMS Encrypt API handles only up to 4 KB of data.

  10. Question 10Single choiceTroubleshooting and Optimization
    A developer created an AWS Lambda function that performs a series of operations that involve multiple AWS services. The function's duration time is higher than normal. To determine the cause of the issue, the developer must investigate traffic between the services without changing the function code.

    Which solution will meet these requirements?
    1. A
      Enable AWS X-Ray active tracing in the Lambda function. Review the logs in X-Ray.
    2. B
      Configure AWS CloudTrail. View the trail logs that are associated with the Lambda function.
    3. C
      Review the AWS Config logs in Amazon CloudWatch.
    4. D
      Review the Amazon CloudWatch logs that are associated with the Lambda function.
    Show answer

    Correct answer: A

    Why

    X-Ray active tracing records calls from a function to other services with no code changes for this basic view. CloudTrail records API activity rather than timing, AWS Config tracks resource configuration, and function logs do not show traffic between services.

  11. Question 11Single choiceTroubleshooting and Optimization
    A company used AWS to develop an application for customers. The application includes an Amazon API Gateway API that invokes AWS Lambda functions. The Lambda functions process data and store the data in Amazon DynamoDB tables.

    The company must monitor the entire application to identify potential bottlenecks in the architecture that can negatively affect customers.

    Which solution will meet this requirement with the LEAST development effort?
    1. A
      Instrument the application with AWS X-Ray. Inspect the service map to identify errors and issues.
    2. B
      Configure Lambda exceptions and additional logging to Amazon CloudWatch. Use CloudWatch Logs Insights to query the logs.
    3. C
      Configure API Gateway to log responses to Amazon CloudWatch. Create a metric filter for the TooManyRequestsException error message.
    4. D
      Use Amazon CloudWatch metrics for the DynamoDB tables to identify all the ProvisionedThroughputExceededException error messages.
    Show answer

    Correct answer: A

    Why

    AWS X-Ray works with API Gateway, Lambda and DynamoDB, and its service map shows bottlenecks across the application. Logs and metrics in the other options each cover only part of the application or require more work.

  12. Question 12Single choiceDeployment
    A developer is creating an application on Amazon Elastic Container Service (Amazon ECS). The developer needs to configure the application parameters. The developer must configure limits for the application's maximum number of simultaneous connections and maximum number of transactions per second.

    The maximum number of connections and transactions can change in the future. The developer needs a solution that can automatically deploy these changes to the application, as needed, without causing downtime.

    Which solution will meet these requirements?
    1. A
      Make the configuration changes for the application. Use AWS CodeDeploy to create a deployment configuration. Specify an in-place deployment to deploy the changes.
    2. B
      Bootstrap the application to use the AWS Cloud Development Kit (AWS CDK) and make the configuration changes. Specify the ECSCanary10Percent15Minutes launch type in the properties section of the ECS resource. Deploy the application by using the AWS CDK to implement the changes.
    3. C
      Install the AWS AppConfig agent on Amazon ECS. Configure an IAM role with access to AWS AppConfig. Make the deployment changes by using AWS AppConfig. Specify Canary10Percent20Minutes as the deployment strategy.
    4. D
      Create an AWS Lambda function to make the configuration changes. Create an Amazon CloudWatch alarm that monitors the Lambda function every 5 minutes to check if the Lambda function has been updated. When the Lambda function is updated, deploy the changes by using AWS CodeDeploy.
    Show answer

    Correct answer: C

    Why

    AWS AppConfig deploys configuration changes gradually with no downtime, and the agent retrieves them for ECS, with a canary strategy to limit risk. CodeDeploy and CDK deploy new code, ECSCanary10Percent15Minutes is not a launch type, and a Lambda function checked by an alarm is not a configuration system.

  13. Question 13Single choiceTroubleshooting and Optimization
    A developer is building various microservices for an application that will run on Amazon EC2 instances. The developer needs to monitor the end-to-end view of the requests between the microservices and debug any issues in the various microservices.

    What should the developer do to accomplish these tasks?
    1. A
      Use Amazon CloudWatch to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
    2. B
      Use AWS CloudTrail to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
    3. C
      Use the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map.
    4. D
      Use AWS Health to monitor the health of all the microservices.
    Show answer

    Correct answer: C

    Why

    The X-Ray SDK instruments each microservice, and the service map gives an end-to-end view of requests. CloudWatch shows logs and metrics rather than traces, CloudTrail records API calls, and AWS Health covers AWS service health.

  14. Question 14Single choiceDevelopment with AWS Services
    A developer is building a three-tier application with an Application Load Balancer (ALB), Amazon EC2 instances, and Amazon RDS. There is an alias record in Amazon Route 53 that points to the ALB. When the developer tries to access the ALB from a laptop, the request times out.

    Which logs should the developer investigate to verify that the request is reaching the AWS network?
    1. A
      VPC Flow Logs
    2. B
      Amazon Route 53 logs
    3. C
      AWS Systems Manager Agent logs
    4. D
      Amazon CloudWatch agent logs
    Show answer

    Correct answer: A

    Why

    VPC Flow Logs show traffic reaching the load balancer's network interfaces and whether it was accepted. Route 53 logs show DNS queries rather than connections, and Systems Manager and CloudWatch agent logs are about instances.

  15. Question 15Single choiceSecurity
    A developer is building an application that stores sensitive user data. The application includes an Amazon CloudFront distribution and multiple AWS Lambda functions that handle user requests.

    The user requests contain over 20 data fields. Each application transaction contains sensitive data that must be encrypted. Only specific parts of the application need to have the ability to decrypt the data.

    Which solution will meet these requirements?
    1. A
      Associate the CloudFront distribution with a Lambda@Edge function. Configure the function to perform field-level asymmetric encryption by using a user-defined RSA public key that is stored in AWS Key Management Service (AWS KMS).
    2. B
      Integrate AWS WAF with CloudFront to protect the sensitive data. Use a Lambda function and self-managed keys to perform the encryption and decryption processes.
    3. C
      Configure the CloudFront distribution to use WebSockets by forwarding all viewer request headers to the origin. Create an asymmetric AWS KMS key. Configure the CloudFront distribution to use field-level encryption. Use the AWS KMS key.
    4. D
      Configure the cache behavior in the CloudFront distribution to require HTTPS for communication between viewers and CloudFront. Configure GoudFront to require users to access the files by using either signed URLs or signed cookies.
    Show answer

    Correct answer: A

    Why

    A Lambda@Edge function can perform field-level asymmetric encryption with a public key, so only parts of the application with the private key can decrypt. AWS WAF and self-managed keys do not provide this, CloudFront's own field-level encryption does not use KMS keys, and HTTPS and signed URLs do not limit decryption.