# Free DOP-C02 practice questions

> 10 free DOP-C02 practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/aws-dop-c02/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/aws-dop-c02/

### Question 1 of 10

A company wants to roll out a new recommendation feature gradually to 5 percent of users and then increase exposure over two days. The feature must be turned off within seconds without a code deployment if the conversion-rate CloudWatch alarm fires. Which solution meets these requirements?

- A. Use a CodeDeploy linear deployment of a new Lambda version that contains the feature, with the conversion-rate alarm configured for automatic rollback
- B. Create two Elastic Beanstalk environments, one with the feature, and shift 5 percent of DNS traffic to it with Route 53 weighted records
- C. Store the flag in Parameter Store and have the application poll it every 5 minutes, with an alarm action that sets the flag to off
- D. Store a feature flag in AWS AppConfig, roll it out with a linear deployment strategy, and add the alarm as a rollback monitor

**Answer:** D

**Explanation:** AppConfig feature flags separate feature exposure from code deployment, deployment strategies control the rollout rate, and alarm monitors roll back the configuration automatically within seconds. A CodeDeploy linear deployment requires a code deployment and rolls back the whole version rather than one feature. Parameter Store polling every 5 minutes cannot turn the feature off within seconds and offers no gradual rollout, and DNS weighting is coarse and slow to revert due to caching.

### Question 2 of 10

A company runs an AWS Elastic Beanstalk environment with 10 instances. Each deployment must run a database migration command exactly once, and a custom script must run on every instance after the application is deployed to warm local caches. Where should these be defined?

- A. Use a leader_only container_commands entry for the migration and a .platform/hooks/postdeploy script for cache warming
- B. Run both scripts in .platform/hooks/predeploy so that they execute on the instances before the new application version starts
- C. Run the migration from a CodeBuild action before deployment, and place the cache-warming script in .platform/hooks/prebuild
- D. Run both the migration and the cache-warming script as .ebextensions commands entries so that they run on each instance during deployment

**Answer:** A

**Explanation:** container_commands with leader_only run on a single instance per deployment, which suits one-time migrations, and postdeploy platform hooks run on every instance after deployment completes. Commands entries run on every instance before the application is extracted, so the migration would run 10 times. A prebuild hook runs before the application is deployed, so caches would warm against the old version, and predeploy runs on all instances before the app starts.

### Question 3 of 10

A company uses AWS Control Tower and must prevent any account in the Sandbox OU from creating resources outside us-east-1 and eu-west-1, detect S3 buckets without versioning in the Production OU, and block CloudFormation from provisioning unencrypted EBS volumes in the Production OU. Which combination of control types should be enabled?

- A. Detective controls for all three requirements, with AWS Config remediation to correct the noncompliant resources
- B. Proactive controls for all three requirements, so that every check runs before resources are provisioned
- C. Preventive for the Region restriction, detective for S3 versioning, and proactive for EBS encryption
- D. A preventive control for the Region restriction and detective controls for both S3 versioning and EBS encryption

**Answer:** C

**Explanation:** Preventive controls are implemented with SCPs or RCPs and block disallowed actions such as using other Regions, detective controls use AWS Config rules to find noncompliant resources, and proactive controls use CloudFormation Hooks to block noncompliant resources before provisioning. Detective controls alone do not prevent anything. Proactive controls apply only to CloudFormation provisioning and cannot restrict Regions, and a detective control for EBS does not block provisioning.

### Question 4 of 10 (choose 2)

A platform team uses AWS Service Catalog to let application teams launch approved infrastructure. Application teams must be able to launch products without having permissions to create the underlying resources directly, and they must only be able to choose from approved instance types. Which Service Catalog features should the team use? (Choose two.)

- A. An AWS Organizations SCP that allows ec2:RunInstances for application teams
- B. A template constraint that restricts the InstanceType parameter to approved values
- C. A stack set constraint that limits deployment to one Region
- D. A tag option library that applies cost center tags
- E. A launch constraint that specifies an IAM role Service Catalog uses to provision the product

**Answer:** B, E

**Explanation:** A launch constraint makes Service Catalog provision with a designated role, so end users need only Service Catalog permissions, and a template constraint limits parameter values such as instance types. Tag options standardize tags but do not restrict instance types. An SCP that allows actions cannot grant permissions and would contradict the goal, and stack set constraints control accounts and Regions rather than instance choices.

### Question 5 of 10

A service uses Lambda functions behind API Gateway. During a marketing event, cold starts caused latency spikes, and another function in the same account consumed all available concurrency, causing throttling of the critical API. Which combination addresses both problems?

- A. Use provisioned concurrency with auto scaling on the critical alias, plus reserved concurrency on that function
- B. Raise the API Gateway stage and method throttling limits so that requests to the critical API are not rejected
- C. Enable SnapStart on every function and remove reserved concurrency so that all functions share the account pool
- D. Increase the memory size of all functions to shorten initialization time and raise their concurrency share

**Answer:** A

**Explanation:** Provisioned concurrency keeps environments initialized to remove cold starts and can scale on a schedule or utilization, while reserved concurrency guarantees capacity for the critical function so others cannot starve it. More memory can shorten initialization but does not protect concurrency. SnapStart reduces startup time for supported runtimes but does not reserve concurrency, and raising API Gateway limits does not affect Lambda concurrency.

### Question 6 of 10

A company has an RTO of 1 hour and an RPO of 5 minutes for an EC2-based application with a self-managed database on EBS. Management wants minimal running infrastructure in the DR Region but requires that DR is tested monthly without affecting production. Which solution meets these requirements?

- A. Use Amazon S3 Cross-Region Replication for exported EBS volume images to the DR Region
- B. Take EBS snapshots every 5 minutes with Data Lifecycle Manager, copy them to the DR Region, and test restores annually
- C. Use Elastic Disaster Recovery and run non-disruptive drills by launching drill instances
- D. Run a full warm standby in the DR Region with database replication and fail over to it during monthly tests

**Answer:** C

**Explanation:** Elastic Disaster Recovery continuously replicates with an RPO of seconds, keeps only lightweight staging resources in the DR Region, and supports drills that launch instances without disrupting replication or production. Frequent snapshot copies struggle to meet the RPO, take long to restore, and annual testing misses the monthly requirement. A warm standby keeps more infrastructure running than necessary and failing over to it for tests affects production, and EBS volumes cannot be replicated with S3 replication.

### Question 7 of 10

A team runs Prometheus-instrumented workloads on multiple Amazon EKS clusters across three accounts. They want a managed, highly available Prometheus-compatible store with PromQL queries and managed Grafana dashboards with IAM Identity Center sign-in, and do not want to operate Prometheus servers. Which solution meets these requirements?

- A. Use Amazon OpenSearch Service with a Prometheus data source to store the metrics and OpenSearch Dashboards for views
- B. Convert all Prometheus metrics to CloudWatch custom metrics with the CloudWatch agent and use CloudWatch dashboards only
- C. Run Prometheus servers on EC2 with EBS volumes in each account, federate them, and self-host Grafana with SAML
- D. Use Managed Service for Prometheus fed by managed collectors or ADOT, with Managed Grafana and Identity Center

**Answer:** D

**Explanation:** Managed Service for Prometheus provides scalable PromQL-compatible storage fed by managed collectors or ADOT, and Managed Grafana provides dashboards with Identity Center sign-in, with no servers to run. Self-hosting Prometheus and Grafana adds operations. Converting to CloudWatch custom metrics loses PromQL and the team's existing tooling, and OpenSearch is not a Prometheus-compatible metrics store.

### Question 8 of 10

Amazon GuardDuty reports that an EC2 instance in a production account is communicating with a known command-and-control server. The security team requires that within one minute the instance is isolated from the network while preserving it for forensics, an EBS snapshot is taken, and the team is notified, without human intervention. Which solution meets these requirements?

- A. Trigger an Automation runbook from an EventBridge rule on the finding to isolate the instance, snapshot its volumes, and notify SNS
- B. Configure GuardDuty Malware Protection to scan and then terminate the instance automatically when the finding appears
- C. Have the security team review high-severity GuardDuty findings in the console every morning and isolate instances by hand
- D. Create a CloudWatch alarm on the instance's NetworkOut metric that stops the instance and notifies the team through SNS

**Answer:** A

**Explanation:** An EventBridge rule on the finding can start an automated workflow that isolates the instance with a restrictive security group, preserves evidence through snapshots, and notifies responders within seconds. GuardDuty does not terminate instances, and termination would destroy evidence. A network-volume alarm is not tied to the threat and stopping the instance loses memory evidence, and daily reviews are far too slow.

### Question 9 of 10

A web application behind an ALB is being targeted by credential-stuffing attacks from many IP addresses, each sending a moderate number of login requests. The security team wants to limit login attempts per client and block known malicious sources with minimal effort. Which solution meets these requirements?

- A. Add network ACL deny rules for each attacking IP address as it appears in the ALB access logs, using a Lambda function that parses the logs every five minutes
- B. Attach AWS WAF to the ALB with a rate-based rule on the login path plus the IP reputation and account takeover prevention managed rule groups
- C. Enable AWS Shield Standard on the ALB and rely on its automatic layer 7 mitigation
- D. Put the ALB in private subnets and allow access only through a corporate VPN for login requests

**Answer:** B

**Explanation:** AWS WAF rate-based rules limit request rates per client on specific paths, and managed rule groups such as IP reputation and account takeover prevention block known bad actors and suspicious login patterns. Network ACLs have rule limits and require constant manual updates. Shield Standard protects against network-layer DDoS, not credential stuffing, and a VPN blocks legitimate public users.

### Question 10 of 10 (choose 2)

A company must demonstrate continuous compliance for PCI DSS workloads across 15 accounts and reduce manual evidence gathering. Which actions should the company take? (Choose two.)

- A. Create an AWS Audit Manager assessment based on the PCI DSS framework scoped to the in-scope accounts
- B. Download the AWS PCI DSS attestation from AWS Artifact and present it as evidence of the company's own controls
- C. Disable AWS Config in the in-scope accounts to reduce costs
- D. Enable GuardDuty Malware Protection for S3 as the only control for PCI DSS
- E. Enable the PCI DSS standard in AWS Security Hub for the in-scope accounts through central configuration

**Answer:** A, E

**Explanation:** Security Hub's PCI DSS standard continuously evaluates relevant controls, and Audit Manager collects evidence mapped to the PCI DSS framework. AWS's own attestation covers AWS's responsibilities under the shared responsibility model, not the company's controls. A single detection feature is not a compliance program, and disabling Config removes evidence that both services rely on.

Ready for a timed run? Take the free 15-question DOP-C02 mini exam: https://devopscodelab.com/app/exams/aws-dop-c02/mini/

DevOpsCode Lab is not affiliated with AWS. DOP-C02 and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
