DOP-C02
Free DOP-C02 practice questions
10 questions from our DOP-C02 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, SDLC Automation
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?
- AUse a CodeDeploy linear deployment of a new Lambda version that contains the feature, with the conversion-rate alarm configured for automatic rollback
- BCreate two Elastic Beanstalk environments, one with the feature, and shift 5 percent of DNS traffic to it with Route 53 weighted records
- CStore the flag in Parameter Store and have the application poll it every 5 minutes, with an alarm action that sets the flag to off
- DStore a feature flag in AWS AppConfig, roll it out with a linear deployment strategy, and add the alarm as a rollback monitor Correct answer
Answer and 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, SDLC Automation
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?
- AUse a leader_only container_commands entry for the migration and a .platform/hooks/postdeploy script for cache warming Correct answer
- BRun both scripts in .platform/hooks/predeploy so that they execute on the instances before the new application version starts
- CRun the migration from a CodeBuild action before deployment, and place the cache-warming script in .platform/hooks/prebuild
- DRun both the migration and the cache-warming script as .ebextensions commands entries so that they run on each instance during deployment
Answer and 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, Configuration Management and IaC
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?
- ADetective controls for all three requirements, with AWS Config remediation to correct the noncompliant resources
- BProactive controls for all three requirements, so that every check runs before resources are provisioned
- CPreventive for the Region restriction, detective for S3 versioning, and proactive for EBS encryption Correct answer
- DA preventive control for the Region restriction and detective controls for both S3 versioning and EBS encryption
Answer and 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, Configuration Management and IaC. 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.)
- AAn AWS Organizations SCP that allows ec2:RunInstances for application teams
- BA template constraint that restricts the InstanceType parameter to approved values Correct answer
- CA stack set constraint that limits deployment to one Region
- DA tag option library that applies cost center tags
- EA launch constraint that specifies an IAM role Service Catalog uses to provision the product Correct answer
Answer and 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, Resilient Cloud Solutions
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?
- AUse provisioned concurrency with auto scaling on the critical alias, plus reserved concurrency on that function Correct answer
- BRaise the API Gateway stage and method throttling limits so that requests to the critical API are not rejected
- CEnable SnapStart on every function and remove reserved concurrency so that all functions share the account pool
- DIncrease the memory size of all functions to shorten initialization time and raise their concurrency share
Answer and 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, Resilient Cloud Solutions
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?
- AUse Amazon S3 Cross-Region Replication for exported EBS volume images to the DR Region
- BTake EBS snapshots every 5 minutes with Data Lifecycle Manager, copy them to the DR Region, and test restores annually
- CUse Elastic Disaster Recovery and run non-disruptive drills by launching drill instances Correct answer
- DRun a full warm standby in the DR Region with database replication and fail over to it during monthly tests
Answer and 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, Monitoring and Logging
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?
- AUse Amazon OpenSearch Service with a Prometheus data source to store the metrics and OpenSearch Dashboards for views
- BConvert all Prometheus metrics to CloudWatch custom metrics with the CloudWatch agent and use CloudWatch dashboards only
- CRun Prometheus servers on EC2 with EBS volumes in each account, federate them, and self-host Grafana with SAML
- DUse Managed Service for Prometheus fed by managed collectors or ADOT, with Managed Grafana and Identity Center Correct answer
Answer and 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, Incident and Event Response
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?
- ATrigger an Automation runbook from an EventBridge rule on the finding to isolate the instance, snapshot its volumes, and notify SNS Correct answer
- BConfigure GuardDuty Malware Protection to scan and then terminate the instance automatically when the finding appears
- CHave the security team review high-severity GuardDuty findings in the console every morning and isolate instances by hand
- DCreate a CloudWatch alarm on the instance's NetworkOut metric that stops the instance and notifies the team through SNS
Answer and 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, Security and Compliance
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?
- AAdd 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
- BAttach 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 Correct answer
- CEnable AWS Shield Standard on the ALB and rely on its automatic layer 7 mitigation
- DPut the ALB in private subnets and allow access only through a corporate VPN for login requests
Answer and 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, Security and Compliance. 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.)
- ACreate an AWS Audit Manager assessment based on the PCI DSS framework scoped to the in-scope accounts Correct answer
- BDownload the AWS PCI DSS attestation from AWS Artifact and present it as evidence of the company's own controls
- CDisable AWS Config in the in-scope accounts to reduce costs
- DEnable GuardDuty Malware Protection for S3 as the only control for PCI DSS
- EEnable the PCI DSS standard in AWS Security Hub for the in-scope accounts through central configuration Correct answer
Answer and 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.