No sign-up needed

Free CompTIA Cloud+ practice test

20 questions, each with a clear explanation.

Quick PracticeQuestion 1 of 20
Your progress through this set
Cloud ArchitectureStep 1 · Choose one answer

A company moves its inventory application to virtual machines rented from an IaaS provider. A week later, a critical vulnerability is announced in the guest operating system those VMs run. Under the shared responsibility model, who should patch that operating system?

Question review

All 20 CompTIA Cloud+ questions with explanations

Try the set above first, then use this list to review. Each answer and explanation stays closed until you open it.

  1. Question 1 · Cloud Architecture

    A company moves its inventory application to virtual machines rented from an IaaS provider. A week later, a critical vulnerability is announced in the guest operating system those VMs run. Under the shared responsibility model, who should patch that operating system?

    1. The provider, because it owns the physical hosts the VMs run on
    2. The provider, because OS updates are included in every IaaS plan
    3. The company, because in IaaS the customer runs and controls the guest OS
    4. The OS vendor, because it is the one that published the vulnerability notice
    Show answer and explanation for question 1

    Correct answer: C · The company, because in IaaS the customer runs and controls the guest OS

    NIST SP 800-145 says an IaaS consumer can deploy and run arbitrary software, including operating systems, and has control over operating systems, storage, and deployed applications, while the provider manages the underlying cloud infrastructure. The guest operating system is therefore the company's to patch. Owning the physical hosts makes the provider responsible for the infrastructure beneath the VMs, not for the software inside them. Managed operating system updates describe a platform service, where the provider runs the operating system, not IaaS. The OS vendor releases the fix, but someone with control of each VM still has to apply it.

    Look for this next time: In IaaS the customer controls the guest operating system, so patching it is the customer's job.

  2. Question 2 · Cloud Architecture

    After an outage review, the business sets two targets for its order database: the database must be running again within four hours, and no more than 15 minutes of committed orders may be lost. Which statement labels these targets correctly?

    1. The 15-minute limit is the RPO, and the four-hour limit is the RTO
    2. The four-hour limit is the RPO, and the 15-minute limit is the RTO
    3. Both are RTOs, measured from the moment the outage began
    4. Both are RPOs, measured from the time of the last full backup
    Show answer and explanation for question 2

    Correct answer: A · The 15-minute limit is the RPO, and the four-hour limit is the RTO

    NIST's glossary, citing SP 800-34 Rev. 1, defines the recovery point objective (RPO) as the point in time to which data must be recovered after an outage, so a cap on how many minutes of orders can be lost is the RPO. It defines the recovery time objective (RTO) as how long system components can stay in the recovery phase before the mission or business is affected, which is the four-hour target. Swapping the labels reverses both definitions. Calling both targets RTOs ignores that one of them limits lost data, not downtime, and calling both RPOs ignores that four hours limits the time to restore service.

    Look for this next time: RPO caps how much data you can lose; RTO caps how long recovery can take.

  3. Question 3 · Cloud Architecture

    A company serves one public website from two groups of servers. Requests whose path begins with /api/ must go to the API servers, and all other requests must go to the web servers. Which load-balancing choice can route traffic by URL path?

    1. A network load balancer, which balances connections at OSI layer 4
    2. DNS round robin, which rotates the site's addresses between groups
    3. A VPN gateway, which encrypts the traffic from users to both groups
    4. An application load balancer, with rules that match the URL path
    Show answer and explanation for question 3

    Correct answer: D · An application load balancer, with rules that match the URL path

    AWS documents that an Application Load Balancer functions at the application layer, the seventh layer of the OSI model, and that its listener rules can use path conditions to route requests based on the URL, which AWS calls path-based routing. That is how /api/ requests reach one group while the rest go to the other. AWS describes a Network Load Balancer as working at the fourth layer, where it handles connections and ports rather than HTTP paths. DNS round robin hands out addresses before a request exists, so it never sees a path. A VPN gateway protects traffic in transit but does not route web requests by path.

    Look for this next time: Routing by URL path needs a layer 7 load balancer that reads the HTTP request.

  4. Question 4 · Cloud Architecture

    A team runs a small database in a container managed by Kubernetes. Each time the pod is deleted and recreated during an update, the database comes back empty. The team needs the data to survive when the pod is replaced. What should it use?

    1. An emptyDir volume, which holds data on the node during the pod's life
    2. A persistent volume, which has a lifecycle independent of any one pod
    3. A larger container image, with the database files shipped inside it
    4. More pod replicas, so one copy of the data is always running somewhere
    Show answer and explanation for question 4

    Correct answer: B · A persistent volume, which has a lifecycle independent of any one pod

    Kubernetes documentation describes a PersistentVolume as cluster storage with a lifecycle independent of any individual pod that uses it, so the database files remain when the pod is replaced. It describes ephemeral volumes, including emptyDir, as following the pod's lifetime and being created and deleted along with the pod, which is the loss the team already sees. Files packed into a container image only give each new container the same starting content, and data written at runtime is not saved back into the image. Extra replicas do not preserve data by themselves; each pod still needs storage that outlives it.

    Look for this next time: Data that must outlive a pod belongs on a persistent volume, not in ephemeral storage.

  5. Question 5 · Cloud Architecture

    A media company runs a video-transcoding batch every night. The job saves its progress, can be stopped and restarted at any point, and only needs to finish by morning. Which billing model is most likely to give the lowest compute cost for this job?

    1. Spot instances, which sell spare capacity at a discount but can be reclaimed
    2. A dedicated host, which reserves a physical server for the company's use only
    3. Pay-as-you-go on-demand instances, billed at the standard hourly rate
    4. Reserved capacity, which commits in advance to steady use over a term
    Show answer and explanation for question 5

    Correct answer: A · Spot instances, which sell spare capacity at a discount but can be reclaimed

    AWS describes Spot Instances as spare EC2 capacity available for less than the On-Demand price and calls them a cost-effective choice if you can be flexible about when applications run and if they can be interrupted, naming batch jobs as an example. AWS can reclaim a Spot Instance with a two-minute warning, which this job tolerates because it saves its progress. A dedicated host pays for isolation, not a discount. On-demand pricing is the standard rate that Spot discounts are measured against. Reserved capacity rewards steady, round-the-clock use, and this job runs for only part of each night.

    Look for this next time: Interruptible, restartable batch work is the classic fit for discounted spot capacity.

  6. Question 6 · Deployment

    Four regional hospitals that follow the same patient-privacy rules agree to share one cloud environment. Only their organizations will use it, and a joint committee from the four hospitals will manage it. Which deployment model does this describe?

    1. Public cloud, because the hospitals share infrastructure with others
    2. Private cloud, because the environment is closed to the general public
    3. Community cloud, used only by organizations that have shared concerns
    4. Hybrid cloud, because more than one organization connects to it
    Show answer and explanation for question 6

    Correct answer: C · Community cloud, used only by organizations that have shared concerns

    NIST SP 800-145 defines a community cloud as infrastructure provisioned for exclusive use by a specific community of consumers from organizations that have shared concerns, such as security requirements, policy, and compliance considerations, and says one or more of those organizations may own and manage it. Four hospitals with the same privacy rules and a joint committee fit that definition. NIST's private cloud serves a single organization, and its public cloud is provisioned for open use by the general public. A hybrid cloud is a composition of two or more distinct cloud infrastructures, and the hospitals are sharing one.

    Look for this next time: Several organizations with shared requirements using one exclusive environment is a community cloud.

  7. Question 7 · Deployment

    A team releases a new checkout service by first routing about 5% of real users to the new version. It watches error rates and latency for an hour and widens the release only if those numbers stay healthy. Which deployment strategy is this?

    1. Blue-green, which switches all traffic between two identical environments
    2. Canary, which sends a small share of users to it before a wider rollout
    3. In-place, which installs the new code directly on the existing servers
    4. Rolling, which replaces servers in batches until all run the new code
    Show answer and explanation for question 7

    Correct answer: B · Canary, which sends a small share of users to it before a wider rollout

    Martin Fowler's site describes a canary release as reducing the risk of a new version by rolling the change out slowly to a small subset of users before the whole infrastructure, then routing more users as confidence grows. The 5% share and the check after an hour match that pattern. The same site describes blue-green deployment as switching the router so all incoming requests go to the new environment at once. An in-place update changes the existing servers with no small test group. A rolling deployment is defined by batches of servers, while this release is staged by a measured share of users and a decision point.

    Look for this next time: A small, measured share of users first, then a wider release if metrics hold, is a canary.

  8. Question 8 · Deployment

    During a cloud migration, a company moves its customer portal without changing the application's architecture, but it replaces the self-managed SQL Server database on a VM with the provider's managed database service. Which migration strategy is this?

    1. Rehost, because the portal moves to the cloud with no changes at all
    2. Refactor, because the application is rebuilt around cloud-native features
    3. Retain, because the database stays in the source environment for now
    4. Replatform, because the move adds a targeted optimization along the way
    Show answer and explanation for question 8

    Correct answer: D · Replatform, because the move adds a targeted optimization along the way

    AWS Prescriptive Guidance describes replatforming, also called lift and reshape, as moving an application to the cloud while introducing some level of optimization, and its example is replatforming a SQL Server database to a managed relational database service. Rehosting, or lift and shift, moves applications without making any changes, but this move changes the database platform. Refactoring modifies the architecture to take full advantage of cloud-native features, which the stem rules out. Retaining keeps an application in the source environment, and here the database moves to the cloud.

    Look for this next time: Moving with one targeted change, such as a managed database, is replatforming.

  9. Question 9 · Deployment

    A company manages its cloud firewall rules with infrastructure as code. During an incident, an engineer opened an extra port directly in the provider's console. The next run of the IaC tool reports that the live rule no longer matches its template. What is this condition called?

    1. Versioning, the record of each change stored in the code repository
    2. Repeatability, the same template producing the same result each time
    3. Drift, a live configuration that differs from its definition in code
    4. Testing, a pipeline check that the template deploys without errors
    Show answer and explanation for question 9

    Correct answer: C · Drift, a live configuration that differs from its definition in code

    AWS CloudFormation documentation explains that drift detection finds whether a stack's actual configuration differs, or has drifted, from its expected configuration, and that drift comes from changes made outside the IaC tool, including ones made to respond to time-sensitive operational events. A port opened in the console during an incident is that case; the fix is to update the template or reverse the manual change so the two agree. Versioning tracks changes stored in the repository, and this change never reached it. Repeatability is about the code producing the same environment each time. Testing checks code before it deploys and would not catch a later console change.

    Look for this next time: A manual change that leaves live resources different from the IaC definition is drift.

  10. Question 10 · Operations

    Users report that checkout is slow. A single checkout request passes through six microservices, and the CPU and memory metrics for every service look normal. The team needs to see how long that request spends in each service along its path. What should it add?

    1. Distributed tracing, which follows one request through each service it calls
    2. Longer log retention, so older application messages stay searchable
    3. More CPU alerts, so the team hears sooner when a service is overloaded
    4. A larger instance size for each service, to give requests more capacity
    Show answer and explanation for question 10

    Correct answer: A · Distributed tracing, which follows one request through each service it calls

    OpenTelemetry's documentation says traces give the big picture of what happens when a request is made to an application and are essential to understanding the full path a request takes, whether the application is a monolith or a mesh of services. Timing one checkout request across six services is that job. Longer log retention keeps more history but does not link one request's steps across services. More CPU alerts would repeat what the metrics already show, and the metrics look normal. A larger instance size adds capacity without showing where the time goes.

    Look for this next time: To see where one request spends its time across services, use distributed tracing.

  11. Question 11 · Operations

    An online store runs a flash sale that starts every Friday at 10:00 a.m. In past sales, its autoscaling group added servers only after CPU had stayed high for several minutes, and the first wave of shoppers saw slow pages. Which scaling approach fits best?

    1. Vertical scaling, moving each server to a larger size during the sale
    2. Scheduled scaling, so new servers are running before each Friday sale
    3. Manual scaling, with an engineer adding servers once alerts start
    4. Load-triggered scaling with a higher CPU threshold before it acts
    Show answer and explanation for question 11

    Correct answer: B · Scheduled scaling, so new servers are running before each Friday sale

    AWS's EC2 Auto Scaling documentation describes scheduled scaling as automatic scaling based on predictable load changes, using scheduled actions that increase or decrease capacity at specific times. A sale that starts at the same hour every week is predictable, so capacity can be in place before shoppers arrive. Waiting for alerts or a CPU trigger is the delay that hurt the first wave, and a higher threshold would act even later. Vertical scaling changes the size of servers rather than their number, and it would still need a schedule to be ready on time.

    Look for this next time: Predictable peaks call for scheduled scaling that adds capacity before the load arrives.

  12. Question 12 · Operations

    A file server gets a full backup every Sunday night and another backup each night from Monday through Saturday. When the server fails on Thursday morning, the team restores Sunday's full backup and then only Wednesday night's backup to recover all the data. Which backup type runs from Monday through Saturday?

    1. Incremental, which captures only the changes since the last backup of any kind
    2. Full, which copies all of the selected data again every night of the week
    3. Replication, which copies each write to a second site immediately
    4. Differential, which captures every change made since the last full backup
    Show answer and explanation for question 12

    Correct answer: D · Differential, which captures every change made since the last full backup

    NIST SP 800-34 Rev. 1 describes a differential backup as one that stores files created or modified since the last full backup, so a restore needs only the full backup media and the last differential. That matches Sunday's full backup plus Wednesday's backup. NIST describes an incremental backup as capturing changes since the last backup of any type, so restoring from incrementals would also require Monday's and Tuesday's media. With a full backup every night, Wednesday's copy alone would do. Replication copies changes to another location as they happen and is not restored as a full-plus-one pair.

    Look for this next time: Full plus the latest differential restores everything; incrementals need every backup since the full.

  13. Question 13 · Security

    An online retailer moves its checkout service to IaaS. A review then finds that the service also writes full payment card numbers to a log storage bucket. Because of that data, which standard's requirements now apply to the bucket as well as to the checkout service?

    1. PCI DSS, because the log bucket now stores payment card account data
    2. SOC 2, because customers may ask the retailer for an audit report
    3. ISO 27001, because the retailer wants a security management certificate
    4. CSA STAR, because the service now runs on a provider's cloud platform
    Show answer and explanation for question 13

    Correct answer: A · PCI DSS, because the log bucket now stores payment card account data

    The PCI Security Standards Council says PCI DSS applies to entities that store, process, or transmit cardholder data or sensitive authentication data, and that it sets technical and operational requirements to protect payment account data. A bucket holding full card numbers stores that data, so it falls under the same requirements as the checkout service. A SOC 2 report, an ISO 27001 certificate, and a CSA STAR listing can each help a company show its security practices, but storing card numbers is not what makes any of them apply. The obligation that follows the card data comes from PCI DSS.

    Look for this next time: Any system that stores, processes, or transmits card data falls under PCI DSS.

  14. Question 14 · Security

    A nightly CI job uploads build files to one storage bucket. It signs in with an administrator's long-term access keys saved in the pipeline settings. The security team wants the job to keep working while limiting what a leak of its credentials could expose. What should the team do?

    1. Keep the same keys but rotate them every 90 days on a fixed schedule
    2. Give the job its own user with full administrator permissions
    3. Use a role with short-lived credentials limited to that one bucket
    4. Store the administrator keys in a hidden file on the build server
    Show answer and explanation for question 14

    Correct answer: C · Use a role with short-lived credentials limited to that one bucket

    AWS's IAM best practices tell teams to require workloads to use temporary credentials with IAM roles and to apply least-privilege permissions, granting only the permissions required to perform a task. A role limited to one bucket, with short-lived credentials, keeps the job running while shrinking what a leaked credential could reach. Rotating the administrator keys every 90 days still leaves full administrative access exposed between rotations. A dedicated user with administrator permissions keeps the same excess rights. A hidden file is still a long-term secret on disk with the same reach.

    Look for this next time: Give workloads short-lived credentials scoped to only the resources they need.

  15. Question 15 · Security

    A code review finds a production database password written directly into a deployment script. The script has been in the company's Git repository for three months. What is the best response?

    1. Delete the line in a new commit, which removes the password from the repo
    2. Make the repository private so only employees can read its history
    3. Encrypt the script file so the password is unreadable in later commits
    4. Rotate the password, then load it at runtime from a secrets manager
    Show answer and explanation for question 15

    Correct answer: D · Rotate the password, then load it at runtime from a secrets manager

    The OWASP Secrets Management Cheat Sheet warns that many organizations hardcode secrets in source code, and its incident guidance calls for revoking an exposed secret, rotating in a new one, and removing it from code, noting that the old value can remain in commit history. A password stored in a repository for three months should be treated as exposed, so it needs a new value, and the script should fetch it from a secrets manager at runtime. Deleting the line in a new commit leaves the old value in history. Making the repository private limits future readers only. Encrypting the file protects only later versions.

    Look for this next time: Treat a secret found in source control as exposed, rotate it, and serve the new value from a secrets manager.

  16. Question 16 · Security

    Monitoring shows that several cloud VMs that usually sit idle overnight now run near 100% CPU around the clock. They also hold steady outbound connections to an unfamiliar host, and the monthly compute bill has jumped. Which attack type best fits this pattern?

    1. A DDoS attack, flooding the VMs with traffic from many outside systems
    2. Cryptojacking, where attackers use the VMs' CPUs to mine cryptocurrency
    3. Phishing, a lure email that steals an employee's password
    4. Ransomware, encrypting the VMs' data and demanding payment for the keys
    Show answer and explanation for question 16

    Correct answer: B · Cryptojacking, where attackers use the VMs' CPUs to mine cryptocurrency

    CISA describes cryptojacking as malicious actors hijacking the processing power of victim systems to run cryptomining software, and lists degraded performance from CPU resources monopolized by mining and increased power consumption among its effects. Constant high CPU on VMs that normally idle, steady outbound connections, and a jump in the compute bill fit that pattern. A DDoS attack floods targets with incoming traffic, while this pattern is outbound and CPU-bound. Phishing may be how an attacker first got in, but it does not describe what the VMs are doing now. Ransomware would show encrypted data and a demand, which the stem does not report.

    Look for this next time: Unexplained, sustained CPU use with outbound connections and a rising bill points to cryptojacking.

  17. Question 17 · DevOps Fundamentals

    A team's pipeline builds every merged change, runs the automated test suite, and then releases each change that passes straight to production, with no manual approval step. Which practice does this describe?

    1. Continuous integration, which stops once each merge is built and tested
    2. Continuous delivery, which keeps changes deployable but waits for a decision
    3. Continuous deployment, which ships every passing change to production
    4. Blue-green deployment, which moves traffic between two environments
    Show answer and explanation for question 17

    Correct answer: C · Continuous deployment, which ships every passing change to production

    Martin Fowler's description of continuous delivery separates it from continuous deployment: in continuous deployment every change goes through the pipeline and is automatically put into production, while continuous delivery means a team is able to deploy frequently but may choose not to. A pipeline that releases each passing change with no approval step is continuous deployment. Continuous integration covers merging, building, and testing, and stops short of release. Blue-green deployment is a technique for switching traffic during a release, and it says nothing about whether a person approves each change.

    Look for this next time: Every passing change released automatically, with no approval gate, is continuous deployment.

  18. Question 18 · DevOps Fundamentals

    An operations team wants to standardize settings on 300 existing Linux servers. It wants to describe the desired state in human-readable YAML files and push changes over SSH without installing agent software on each server. Which tool fits these requirements?

    1. Terraform, which provisions infrastructure from configuration files
    2. Jenkins, which runs the build and test jobs in a CI/CD pipeline
    3. Grafana, which builds dashboards from metrics and logs in data sources
    4. Ansible, which applies YAML playbooks over SSH without agents
    Show answer and explanation for question 18

    Correct answer: D · Ansible, which applies YAML playbooks over SSH without agents

    Ansible's documentation describes an agent-less architecture that avoids installing additional software across the infrastructure, playbooks in YAML that declare the desired state of a system, and access to remote machines over SSH with existing operating system credentials. Each requirement in the stem matches. HashiCorp describes Terraform as an infrastructure as code tool for building and changing cloud and on-premises resources, which suits creating infrastructure more than reconfiguring 300 existing servers over SSH. Jenkins is an automation server for building, testing, and delivering software, and Grafana queries and visualizes metrics, logs, and traces. Neither is the agentless YAML configuration tool the stem describes.

    Look for this next time: Agentless configuration in YAML playbooks, pushed over SSH, describes Ansible.

  19. Question 19 · Troubleshooting

    A deployment script creates 400 resources by calling the provider's API in a tight loop. After a few dozen successful calls, the API starts returning HTTP 429 responses, some with a Retry-After header, and the script stops. What is the most likely cause, and what should the team do?

    1. API rate limiting; slow the loop and retry after the interval the API gives
    2. An expired credential; sign in again and rerun the whole script from the start
    3. A regional outage; redeploy the resources in a different region right away
    4. A malformed request; fix the request body before sending the next call
    Show answer and explanation for question 19

    Correct answer: A · API rate limiting; slow the loop and retry after the interval the API gives

    RFC 6585 defines HTTP 429 Too Many Requests as the status code for a client that has sent too many requests in a given amount of time, which it calls rate limiting, and says the response may include a Retry-After header saying how long to wait. Slowing the loop and retrying after that interval fixes the cause. An expired credential is an authentication problem, and a 429 says the calls came too fast, not who made them. A regional outage would not single out one fast-calling script with a status code about request volume. A malformed request would have failed from the first call, not after dozens of successes.

    Look for this next time: HTTP 429 means rate limiting: back off and retry instead of calling the API faster.

  20. Question 20 · Troubleshooting

    An engineer tries to peer two virtual private clouds so their applications can talk over private addresses. VPC A uses 10.20.0.0/16, and VPC B uses 10.20.128.0/17. The peering request fails. What is the most likely cause?

    1. Peering is limited to VPCs in one region and account
    2. The CIDR blocks overlap, since all of 10.20.128.0/17 is in 10.20.0.0/16
    3. The subnets are too small to hold the extra routes that peering creates
    4. Security groups block ICMP, so the peering handshake fails
    Show answer and explanation for question 20

    Correct answer: B · The CIDR blocks overlap, since all of 10.20.128.0/17 is in 10.20.0.0/16

    AWS documentation says you cannot create a VPC peering connection between VPCs that have matching or overlapping IPv4 or IPv6 CIDR blocks. 10.20.0.0/16 covers every address from 10.20.0.0 to 10.20.255.255, so 10.20.128.0/17, which runs from 10.20.128.0 to 10.20.255.255, sits entirely inside it. One VPC needs a non-overlapping range before peering can work. AWS also documents inter-Region peering and says the accepter VPC can belong to you or to another AWS account, so peering is not limited to one region or one account. Subnet size limits the addresses available to instances, not routes. Security groups filter traffic once a connection exists; they do not decide whether peering can be created.

    Look for this next time: Networks you want to peer need address ranges that do not overlap.

Use the sample well

The rationale matters more than the score.

A short set can show you what deserves another look. A strong run shows you can read a cloud requirement, an error, or a monitoring clue and pick the step a cloud engineer would take next. Twenty questions are a small sample, so the result does not predict a 750 on the 100–900 scale.

01

Answer before reviewing

Choose the one answer that meets every requirement in the scenario. Then read why each other option falls short.

02

Read every rationale

Confirm why the best option fits, even when you were right.

03

Follow the pattern

Use recurring misses—not one score—to choose your next focus.