Google Cloud · Associate Cloud Engineer
Associate Cloud Engineer practice questions with answers
15 free practice questions for the Google Cloud Associate Cloud Engineer (Associate Cloud Engineer) exam, spread across the exam's domains. Try each one, then open the answer to see why every option is right or wrong.
Questions last updated
Question 1 · Setting up a cloud solution environment
A new Google Cloud user wants to run gcloud commands interactively right away from a web browser without installing any software on their laptop. They also want scripts and configuration files in their home directory to still be there in later sessions. Which option meets these requirements?
- ADownload and install the Google Cloud CLI on the laptop, then run gcloud init
- BOpen Cloud Shell from the Google Cloud console
- CInstall the Cloud Code extension in a local IDE and use its built-in terminal
- DSubmit the gcloud commands as build steps in Cloud Build
Show answer and explanation
Answer: B) Open Cloud Shell from the Google Cloud console
Cloud Shell is a browser-based terminal with gcloud preinstalled and a 5 GB persistent $HOME directory, so it needs no local installation and keeps files between sessions.
- AIncorrect. This gives a working gcloud environment, but it means installing software locally, which the user wants to avoid.
- BCorrect. Cloud Shell opens a browser-based terminal with the Google Cloud CLI preinstalled. It provides 5 GB of free persistent disk mounted as the user's $HOME directory, so files kept there persist between sessions.
- CIncorrect. Cloud Code is an IDE extension, so the user would have to install an IDE and the extension locally. That breaks the no-installation requirement.
- DIncorrect. Cloud Build runs non-interactive build steps in temporary environments. It isn't an interactive shell, and it doesn't keep a home directory between runs.
Question 2 · Setting up a cloud solution environment
A security team must make sure that no Cloud Storage bucket in the organization, existing or created later, can serve data publicly through allUsers or allAuthenticatedUsers. The control must prevent exposure, not just detect it, and must cover the whole organization centrally. What should the team do?
- AEnforce the storage.publicAccessPrevention organization policy constraint at the organization node
- BEnforce the storage.uniformBucketLevelAccess organization policy constraint at the organization node
- CSet public access prevention to enforced on each existing bucket by using a script
- DCreate a log-based alert on Cloud Audit Logs entries that add allUsers to bucket IAM policies
Show answer and explanation
Answer: A) Enforce the storage.publicAccessPrevention organization policy constraint at the organization node
Enforcing constraints/storage.publicAccessPrevention at the organization node blocks public access for all buckets under it, new and existing. Uniform bucket-level access, per-bucket scripts and audit-log alerts each miss either IAM-based public access, future buckets or prevention.
- ACorrect. When this boolean constraint is enforced at the organization level, every bucket under it, new and existing, inherits public access prevention. Requests authorized through allUsers or allAuthenticatedUsers fail with 401 or 403, and attempts to add those principals to an IAM policy or ACL fail with 412.
- BIncorrect. This constraint forces uniform bucket-level access, which turns off object ACLs. But a bucket-level IAM policy can still grant access to allUsers, so buckets can still be made public.
- CIncorrect. This protects only the buckets that exist when the script runs. Buckets created later aren't covered, so it isn't a central, organization-wide control.
- DIncorrect. An alert only tells the team after the public binding exists, so data can be exposed until someone fixes it. It detects the problem but doesn't prevent it.
Question 3 · Setting up a cloud solution environment
A developer has just installed the gcloud CLI on their laptop. They want to authorize the CLI with their own Google user account so they can run gcloud commands interactively. Which command should they run?
- Agcloud auth login
- Bgcloud auth application-default login
- Cgcloud auth activate-service-account
- Dgcloud config set account
Show answer and explanation
Answer: A) gcloud auth login
gcloud auth login authorizes the gcloud CLI with a user account. application-default login sets up ADC for client libraries, activate-service-account authorizes a service account, and config set account only switches between accounts that already have credentials.
- ACorrect. gcloud auth login starts a browser-based sign-in, then stores the user's credentials and makes that account the active account for gcloud CLI commands.
- BIncorrect. This command gets user credentials for Application Default Credentials (ADC), which Google client libraries in your own code use. The gcloud CLI doesn't use ADC, and this command has no effect on the accounts set up by gcloud auth login.
- CIncorrect. This command authorizes gcloud with a service account, usually through a --key-file. It doesn't authorize the developer's personal user account.
- DIncorrect. This command sets the core/account property, which switches the active account among principals that already have stored credentials. It doesn't perform a sign-in or get new credentials.
Question 4 · Planning and implementing a cloud solution
A team wants analysts who find a BigQuery dataset in Knowledge Catalog (formerly Dataplex Universal Catalog) to also see the dataset's business owner and cost center. The dataset already exists in a project where the Dataplex API is enabled. What should the engineer do?
- AAttach an optional aspect containing the owner and cost center to the dataset's automatically created system entry
- BCreate a lake and zone, then attach the dataset as an asset so that it receives an entry in the catalog
- CCreate a custom entry group and a custom entry representing the dataset, then add aspects to that entry
- DEdit the required aspects on the dataset's system entry to include the owner and cost center values
Show answer and explanation
Answer: A) Attach an optional aspect containing the owner and cost center to the dataset's automatically created system entry
Knowledge Catalog creates system entries for BigQuery datasets automatically. To add business context such as an owner, attach optional aspects to the system entry, because its required aspects can't be modified.
- ACorrect. Knowledge Catalog creates system entries for BigQuery datasets automatically. You can add business metadata to a system entry only through optional aspects.
- BIncorrect. BigQuery datasets get system entries automatically, so no lake or zone is needed for them to appear. Attaching an asset also doesn't add owner or cost-center metadata.
- CIncorrect. Custom entries are for sources the catalog doesn't ingest automatically. The dataset already has a system entry, so a custom entry would be a duplicate record that isn't connected to it.
- DIncorrect. Knowledge Catalog manages the required aspects of system entries. You can read them but can't modify them.
Question 5 · Planning and implementing a cloud solution
A team has already configured kubectl credentials for an existing GKE cluster. They have written a YAML manifest that declares a Deployment with the container image, the replica count and resource settings. Which command creates or updates the Deployment from that file?
- Akubectl apply -f deployment.yaml
- Bkubectl expose deployment my-app --type=LoadBalancer
- Cgcloud container clusters get-credentials my-cluster
- Dkubectl run my-app --image=IMAGE_URL
Show answer and explanation
Answer: A) kubectl apply -f deployment.yaml
kubectl apply -f creates or updates resources from a declarative manifest file. get-credentials only configures kubectl access, kubectl expose creates a Service, and kubectl run imperatively starts a single Pod.
- Akubectl apply -f applies a manifest file to the cluster. It creates the resources if they don't exist and updates them if they do, so the cluster matches the declared configuration. This is the declarative way to deploy a workload to GKE.
- Bkubectl expose creates a Service for a Deployment that already exists so it can be reached. It does not read a manifest file or create the Deployment itself.
- CThis command fetches cluster credentials and configures kubectl to use the cluster. The team has already done that, and the command does not deploy any workload.
- Dkubectl run imperatively starts a single Pod from an image given on the command line. It does not apply the team's declarative manifest or create a Deployment with the specified replica count.
Question 6 · Planning and implementing a cloud solution
A security team needs their external Application Load Balancer to refuse client connections that negotiate TLS 1.0 or TLS 1.1, while still accepting TLS 1.2 and later. What should they configure?
- AAn SSL policy attached to the load balancer's target HTTPS proxy, with the appropriate settings
- BA Google-managed SSL certificate on the target HTTPS proxy in place of a self-managed certificate
- CA VPC firewall rule that allows ingress only on TCP port 443 from the internet to the load balancer
- DThe backend service protocol set to HTTPS so traffic to the backends is encrypted with TLS
Show answer and explanation
Answer: A) An SSL policy attached to the load balancer's target HTTPS proxy, with the appropriate settings
The TLS versions and cipher suites a load balancer accepts from clients are set by an SSL policy with a minimum TLS version, attached to the target HTTPS or SSL proxy.
- ACorrect. An SSL policy sets the TLS protocol versions and cipher suites the load balancer will negotiate with clients. If the policy's minimum TLS version is 1.2 and it is attached to the target HTTPS proxy, clients that only support older versions are refused.
- BIncorrect. A certificate gives the load balancer its identity for TLS. Switching to a Google-managed certificate doesn't change which TLS protocol versions the load balancer will negotiate.
- CIncorrect. VPC firewall rules filter on IP address, protocol and port. They can't see which TLS version is negotiated, and client traffic to an external Application Load Balancer ends at Google's frontends, not at VPC firewall rules.
- DIncorrect. The backend service protocol controls the connection from the load balancer to the backends. The requirement is about client-to-load-balancer connections, which the SSL policy on the target proxy controls.
Question 7 · Planning and implementing a cloud solution
A company needs to migrate several hundred terabytes of objects from Amazon S3 buckets into Cloud Storage. It has ample network bandwidth and wants a fully managed, online transfer. The transfer must be schedulable and must not require custom scripts, agents to maintain, or shipping physical hardware. Which Google Cloud service should it use?
- AStorage Transfer Service
- BTransfer Appliance
- Cgcloud storage rsync run from a VM
- DBigQuery Data Transfer Service
Show answer and explanation
Answer: A) Storage Transfer Service
Storage Transfer Service is Google Cloud's managed, schedulable, agentless service for online transfers from other clouds such as Amazon S3 into Cloud Storage. Transfer Appliance is for offline transfers, rsync scripts are self-managed, and BigQuery Data Transfer Service loads data into BigQuery.
- ACorrect. Storage Transfer Service is a managed service for moving data from Amazon S3, Azure Blob Storage, and other sources into Cloud Storage. Transfers from S3 need no agents, can be scheduled, and remove the need for manual processes and custom scripts.
- BIncorrect. Transfer Appliance is a physical device that is shipped to and from your site for offline transfers, typically when network bandwidth is limited. The company has ample bandwidth and wants to avoid shipping hardware.
- CIncorrect. gcloud storage rsync can copy data, but the team would have to script, schedule, monitor, and retry the jobs on infrastructure it runs. That is the self-managed approach the company wants to avoid.
- DIncorrect. BigQuery Data Transfer Service loads data into BigQuery datasets on a schedule. It is not designed for bulk object migration into Cloud Storage buckets.
Question 8 · Planning and implementing a cloud solution
A team is creating a BigQuery materialized view for a dashboard aggregation query. To control refresh cost, they want BigQuery to refresh the view automatically, but no more often than once every hour instead of the default. Which DDL statement meets this requirement?
- ACREATE MATERIALIZED VIEW ds.mv OPTIONS (enable_refresh = true, refresh_interval_minutes = 60) AS SELECT ...
- BCREATE MATERIALIZED VIEW ds.mv OPTIONS (enable_refresh = false, refresh_interval_minutes = 60) AS SELECT ...
- CCREATE VIEW ds.v OPTIONS (enable_refresh = true, refresh_interval_minutes = 60) AS SELECT ...
- DCREATE MATERIALIZED VIEW ds.mv OPTIONS (enable_refresh = true) AS SELECT ... with a 60-minute scheduled query
Show answer and explanation
Answer: A) CREATE MATERIALIZED VIEW ds.mv OPTIONS (enable_refresh = true, refresh_interval_minutes = 60) AS SELECT ...
BigQuery materialized views refresh automatically when enable_refresh is true. The refresh_interval_minutes option sets the frequency cap, which defaults to 30 minutes.
- ACorrect. enable_refresh = true keeps automatic refresh on. refresh_interval_minutes = 60 caps the refresh frequency at once per hour, up from the default of 30 minutes. The allowed range is 1 minute to 7 days.
- BIncorrect. Setting enable_refresh to false turns off automatic refresh, so the view would only be refreshed manually. That doesn't meet the requirement.
- CIncorrect. A logical view stores no precomputed results and re-runs its query each time it's referenced. Refresh options apply only to materialized views.
- DIncorrect. Without refresh_interval_minutes, automatic refresh uses the default 30-minute cap, so it can run more often than once an hour. Adding a scheduled query doesn't change the view's refresh frequency cap.
Question 9 · Ensuring the successful operation of a cloud solution
A team serves product images through an external Application Load Balancer with Cloud CDN enabled. Monitoring shows a low cache hit ratio. Image URLs often carry tracking parameters such as ?utm_source=..., which do not change the image returned. What should the team do to raise the cache hit ratio?
- ACustomize the backend's cache key to exclude the utm_* query string parameters
- BAdd more VM instances to the origin's managed instance group behind the backend
- CConfigure the origin to return Cache-Control: private on all image responses
- DConfigure the cache key to include protocol, host, and the full query string
Show answer and explanation
Answer: A) Customize the backend's cache key to exclude the utm_* query string parameters
Cloud CDN's default cache key is the full request URI, so query parameters that don't affect the response split the cache. Excluding them in a custom cache key raises the hit ratio.
- ACorrect. By default Cloud CDN uses the full request URI as the cache key, so every URL variant with different parameters is cached as a separate entry. Excluding parameters that don't change the response lets those requests share one cached object.
- BIncorrect. More backend capacity helps the origin handle cache misses, but it does not change how many requests are served from the cache. The hit ratio stays the same.
- CIncorrect. The private directive tells shared caches such as Cloud CDN not to store the response, so the hit ratio would go down.
- DIncorrect. This is basically the default full-URI behavior that is splitting the cache. Keeping every parameter means each URL variant is still a separate cache miss.
Question 10 · Ensuring the successful operation of a cloud solution
An administrator needs to change the startup script on one running Compute Engine VM, web-1. The VM must not be deleted or recreated, and other VMs in the project must not be affected. Which command should the administrator use?
- Agcloud compute project-info add-metadata --metadata-from-file=startup-script=setup.sh
- Bgcloud compute instances create web-1 --metadata-from-file=startup-script=setup.sh
- Cgcloud compute instances add-metadata web-1 --metadata-from-file=startup-script=setup.sh
- Dgcloud compute instances add-labels web-1 --labels=startup-script=setup-sh
Show answer and explanation
Answer: C) gcloud compute instances add-metadata web-1 --metadata-from-file=startup-script=setup.sh
Use gcloud compute instances add-metadata to change the startup-script metadata on one existing VM without recreating it. The updated script runs at the next boot, or you can rerun it manually.
- AThis command sets project-wide metadata, which applies to every VM in the project that has no instance-level value for the key. It is not limited to web-1.
- BThe create command provisions a new VM. It fails if an instance named web-1 already exists in the zone, and it cannot change the metadata of an existing instance.
- Cadd-metadata adds or updates metadata keys, such as startup-script, on an existing instance and leaves other keys unchanged. The new script runs at the next boot, or it can be rerun right away on the VM with 'sudo google_metadata_script_runner startup'.
- DLabels are key-value tags for organizing resources and tracking costs. They are not instance metadata, and the guest environment does not run them as startup scripts.
Question 11 · Ensuring the successful operation of a cloud solution
A team is running a canary rollout on a Cloud Run service, with 10% of traffic routed to a new revision. Before moving more traffic to it, they want to confirm the new revision isn't returning more server errors than the current one. What should they check in Cloud Monitoring?
- AThe run.googleapis.com/request_count metric, filtered to the new revision and grouped by response_code_class to compare its 5xx share
- BThe request_count metric for the whole service, combined across all revisions and grouped only by response_code_class
- CThe container instance count metric for the new revision, to make sure it has scaled out enough to handle its share
- DThe Admin Activity audit log entries for the service, to confirm the traffic split change was applied successfully
Show answer and explanation
Answer: A) The run.googleapis.com/request_count metric, filtered to the new revision and grouped by response_code_class to compare its 5xx share
In a Cloud Run canary, judge the new revision by its own request metrics: filter request_count by revision and response_code_class. A service-wide aggregate can hide the canary's errors.
- ACorrect. Cloud Run writes request_count against the cloud_run_revision resource, and it can be filtered by revision and by response_code_class. This shows the canary's own 5xx ratio next to the stable revision's, which is the telemetry to watch before raising the traffic percentage.
- BIncorrect. Here the stable revision carries 90% of traffic. Combining every revision dilutes the canary's errors, so a problem that affects only the new revision can be hidden in the service-wide rate.
- CIncorrect. Instance count shows how the revision is scaling, not whether its requests succeed. A revision can have plenty of instances and still return many 5xx responses.
- DIncorrect. Audit logs record configuration changes such as updating the traffic split. They don't measure how many requests the new revision serves successfully or with errors.
Question 12 · Ensuring the successful operation of a cloud solution
A Linux VM on Compute Engine is running out of space on a non-boot persistent disk that stores application data. The team needs more usable capacity on that disk with as little downtime as possible. What should they do?
- AStop the VM, increase the disk size with gcloud compute disks resize, and then start the VM again
- BIncrease the disk size while the VM keeps running, then extend the partition and file system from the guest OS
- CSnapshot the disk, create a larger disk from that snapshot, then detach the old disk and attach the new one
- DIncrease the disk size while the VM keeps running; the guest OS starts using the added space automatically
Show answer and explanation
Answer: B) Increase the disk size while the VM keeps running, then extend the partition and file system from the guest OS
You can increase a Compute Engine persistent disk's size while the VM is running, so no stop is needed. On a non-boot data disk, you must then extend the partition and file system in the guest OS before the extra capacity can be used.
- AThe resize would work, but stopping the VM isn't needed. Compute Engine lets you increase a persistent disk's size while it is attached to a running VM, so this causes downtime for no reason. You would also still need to extend the file system.
- BCorrect. You can increase a persistent disk's size at any time, even while it is attached to a running VM. For a non-boot disk, you must then extend the file system (for example, with resize2fs or xfs_growfs) before the new space can be used.
- CThis adds space, but it is slower and more disruptive than needed. The application has to stop using the disk while it is swapped, and the file system on the new disk may still need to be extended. An online resize does the job without a snapshot.
- DThe online resize is the right first step, but this option is incomplete. For a non-boot disk, the documentation says you must extend the file system after resizing. Until then, the guest OS can't use the new space.
Question 13 · Configuring access and security
An application needs to encrypt a large volume of data. It generates a key locally and uses that key to encrypt the data. It then calls Cloud KMS to encrypt only that locally generated key with a key held in Cloud KMS, and stores the wrapped key alongside the ciphertext. What is this approach called?
- AEnvelope encryption
- BCustomer-supplied encryption keys (CSEK)
- CCloud External Key Manager (Cloud EKM)
- DAutomatic key rotation
Show answer and explanation
Answer: A) Envelope encryption
Encrypting data with a local DEK and then wrapping that DEK with a Cloud KMS KEK is called envelope encryption.
- ACorrect. In envelope encryption, a data encryption key (DEK) encrypts the data, and a key encryption key (KEK) in Cloud KMS encrypts, or wraps, the DEK. The wrapped DEK can then be stored safely with the encrypted data.
- BIncorrect. With CSEK, you supply your own raw key material directly to services such as Cloud Storage or Compute Engine. It does not describe wrapping a locally generated DEK with a Cloud KMS key.
- CIncorrect. Cloud EKM lets you use keys that are kept in a supported external key management partner. It is a choice about where keys live, not the name of the DEK-wrapping pattern.
- DIncorrect. Key rotation creates new primary key versions on a schedule. It controls a key's lifecycle and does not describe using one key to encrypt the data and another to wrap that key.
Question 14 · Configuring access and security
A team is creating a Compute Engine VM whose application only needs to read objects from one Cloud Storage bucket. The project's Compute Engine default service account holds the Editor role. Following Google's recommended practice for least privilege, what should the team do when creating the VM?
- AAttach a user-managed service account that has only a read role on the bucket, and set the cloud-platform access scope
- BKeep the default service account attached and restrict the VM's access scopes to read-only Cloud Storage
- CAdd an SSH key to the instance metadata for an account that has read permission on the bucket
- DCreate the VM with no service account and copy a downloaded service account key file onto its boot disk
Show answer and explanation
Answer: A) Attach a user-managed service account that has only a read role on the bucket, and set the cloud-platform access scope
For least privilege, attach a user-managed service account that has only the IAM roles the workload needs, and use the cloud-platform access scope. Don't rely on the broadly privileged default service account, narrowed scopes, or downloaded key files.
- ACorrect. Google recommends attaching a user-managed service account at creation time (for example, with gcloud compute instances create --service-account=EMAIL --scopes=cloud-platform). You then limit access by granting that service account only the IAM roles it needs, such as Storage Object Viewer on the bucket.
- BIncorrect. Access scopes are a legacy mechanism and set an upper limit on OAuth tokens, but the default service account still holds the broad Editor role. Google recommends the cloud-platform scope with a narrowly scoped service account, so that IAM roles control access.
- CIncorrect. SSH keys control who can log in to the VM. They don't give the application an identity for calling Google Cloud APIs such as Cloud Storage.
- DIncorrect. Service account keys are long-lived credentials that create security risk, and Google advises against them. Attaching a service account lets the VM get short-lived credentials from the metadata server instead.
Question 15 · Configuring access and security
A platform team wants every developer on the payments team to get the same Kubernetes RBAC permissions in the payments namespace of a GKE cluster. Access should follow team membership, so they don't have to edit bindings whenever someone joins or leaves. Google Groups for RBAC is already enabled on the cluster. What should they put in the RoleBinding's subjects?
- AA subject of kind Group named with the email address of a payments Google Group that is nested in gke-security-groups
- BA subject of kind ServiceAccount naming one Kubernetes service account whose token all payments developers share
- CA subject of kind Group named after an IAM custom role that already contains the payments developers' permissions
- DA subject of kind User named with the Google Cloud project ID, so everyone with access to the project is bound
Show answer and explanation
Answer: A) A subject of kind Group named with the email address of a payments Google Group that is nested in gke-security-groups
Google Groups for RBAC lets a RoleBinding use kind: Group with a Google Group's email address, provided the feature is enabled on the cluster and the group is nested in gke-security-groups. Every member of the group then gets the bound role's permissions.
- ACorrect. With Google Groups for RBAC enabled, a RoleBinding can use kind: Group with a Google Group's email address, as long as that group is a member of the gke-security-groups group. Every member of the group gets the role's permissions, so access follows group membership.
- BIncorrect. Kubernetes service accounts are workload identities. Sharing one service account's token among people removes individual accountability and isn't how you grant human users access.
- CIncorrect. IAM roles aren't RBAC subjects. A Group subject must be the email address of a Google Group that is nested in gke-security-groups. An IAM role name doesn't identify any set of users to Kubernetes RBAC.
- DIncorrect. A User subject identifies a single principal, such as one email address. A project ID isn't a user identity, and binding at project scope wouldn't limit access to the payments team.
Ready for a full Associate Cloud Engineer practice exam?
These are a sample from the CertRidge question bank. Full practice exams match the real exam's length, time limit and domain weights, with every answer explained.
Original questions written from the official exam guide. Not affiliated with Google Cloud; never copied from the real exam.