Google

Associate Cloud Engineer Free Practice Questions — Page 12

Question 112

Your application is running on Google Cloud in a managed instance group (MIG). You see errors in Cloud Logging for one VM that one of the processes is not responsive. You want to replace this VM in the MIG quickly. What should you do?

A. Use the gcloud compute instances update command with a REFRESH action for the VM.
B. Use the gcloud compute instance-groups managed recreate-instances command to recreate the VM.
C. Select the MIG from the Compute Engine console and, in the menu, select Replace VMs.
D. Update and apply the instance template of the MIG.
Show Answer
Correct Answer: B
Explanation:
To quickly replace a single unhealthy VM in a managed instance group, use the managed instance group recreate-instances command. It deletes and recreates the specified instance using the group's current instance template while preserving the managed instance identity within the MIG. Updating the instance template affects future or explicitly updated instances, not an immediate replacement of one VM. The update command with REFRESH is not the appropriate operation here, and the console 'Replace VMs' action is a UI equivalent rather than the specific operational command typically expected in exam questions.

Question 113

You want to permanently delete a Pub/Sub topic managed by Config Connector in your Google Cloud project. What should you do?

A. Use kubectl to create the label deleted-by-cnrm and to change its value to true for the topic resource.
B. Use kubectl to delete the topic resource.
C. Use gcloud CLI to delete the topic.
D. Use gcloud CLI to update the topic label managed-by-cnrm to false.
Show Answer
Correct Answer: B
Explanation:
Config Connector manages Google Cloud resources declaratively through Kubernetes custom resources. To permanently delete a managed Pub/Sub topic, delete the corresponding Kubernetes resource with kubectl (for example, `kubectl delete -f` or `kubectl delete` on the resource). Deleting it with gcloud would conflict with Config Connector management, and the label-based options are not the mechanism for deletion.

Question 114

You used the gcloud container clusters command to create two Google Cloud Kubernetes (GKE) clusters: prod-cluster and dev-cluster. • prod-cluster is a standard cluster. • dev-cluster is an auto-pilot cluster. When you run the kubectl get nodes command, you only see the nodes from prod-cluster. Which commands should you run to check the node status for dev-cluster?

A. gcloud container clusters get-credentials dev-cluster kubectl get nodes
B. gcloud container clusters update -generate-password dev-cluster kubectl get nodes
C. kubectl config set-context dev-cluster kubectl cluster-info
D. kubectl config set-credentials dev-cluster kubectl cluster-info
Show Answer
Correct Answer: A
Explanation:
To access a different GKE cluster with kubectl, you must update your kubeconfig and current context using `gcloud container clusters get-credentials <cluster-name>`. After that, `kubectl get nodes` queries that cluster, including an Autopilot cluster. The other commands either do not exist for this purpose or do not configure access to the cluster.

Question 115

Your managed instance group raised an alert stating that new instance creation has failed to create new instances. You need to solve the instance creation problem. What should you do?

A. Create an instance template that contains valid syntax which will be used by the instance group. Delete any persistent disks with the same name as instance names.
B. Create an instance template that contains valid syntax that will be used by the instance group. Verify that the instance name and persistent disk name values are not the same in the template.
C. Verify that the instance template being used by the instance group contains valid syntax. Delete any persistent disks with the same name as instance names. Set the disks.autoDelete property to true in the instance template.
D. Delete the current instance template and replace it with a new instance template. Verify that the instance name and persistent disk name values are not the same in the template. Set the disks.autoDelete property to true in the instance template.
Show Answer
Correct Answer: A
Explanation:
Managed instance groups require a valid instance template. If instance creation fails because a persistent disk with the generated instance name already exists, deleting the conflicting persistent disks resolves the conflict. Instance templates are immutable, so options that imply modifying an existing template are incorrect. Options referring to setting distinct instance and disk names are not applicable in the way described. Creating a new valid instance template and removing conflicting disks is the best match.

Question 116

You are planning to migrate the following on-premises data management solutions to Google Cloud: • One MySQL cluster for your main database • Apache Kafka for your event streaming platform • One Cloud SQL for PostgreSQL database for your analytical and reporting needs You want to implement Google-recommended solutions for the migration. You need to ensure that the new solutions provide global scalability and require minimal operational and infrastructure management. What should you do?

A. Migrate from MySQL to Cloud SQL, from Kafka to Pub/Sub, and from Cloud SQL for PostgreSQL to BigQuery.
B. Migrate from MySQL to Cloud Spanner, from Kafka to Pub/Sub, and from Cloud SQL for PostgreSQL to BigQuery.
C. Migrate from MySQL to Cloud Spanner, from Kafka to Memorystore, and from Cloud SQL for PostgreSQL to Cloud SQL.
D. Migrate from MySQL to Cloud SQL, from Kafka to Memorystore, and from Cloud SQL for PostgreSQL to Cloud SQL.
Show Answer
Correct Answer: B
Explanation:
Cloud Spanner is the Google-recommended globally scalable managed relational database for workloads that outgrow traditional MySQL. Pub/Sub is the fully managed event streaming and messaging service that replaces Kafka with minimal infrastructure management. BigQuery is the managed analytics data warehouse appropriate for analytical and reporting workloads, offering massive scalability and minimal operations.

Question 117

You are migrating a business critical application from your local data center into Google Cloud. As part of your high-availability strategy, you want to ensure that any data used by the application will be immediately available if a zonal failure occurs. What should you do?

A. Store the application data on a zonal persistent disk. Create a snapshot schedule for the disk. If an outage occurs, create a new disk from the most recent snapshot and attach it to a new VM in another zone.
B. Store the application data on a zonal persistent disk. If an outage occurs, create an instance in another zone with this disk attached.
C. Store the application data on a regional persistent disk. Create a snapshot schedule for the disk. If an outage occurs, create a new disk from the most recent snapshot and attach it to a new VM in another zone.
D. Store the application data on a regional persistent disk. If an outage occurs, create an instance in another zone with this disk attached.
Show Answer
Correct Answer: D
Explanation:
Regional Persistent Disks synchronously replicate data across two zones within the same region, providing immediate availability after a zonal failure. In a failover, you can create or start a VM in the secondary zone and force-attach the existing regional disk. Snapshots are useful for backup and recovery from corruption or user error, but they are not required for immediate zonal failover and would add restore delay.

Question 118

Your continuous integration and delivery (CI/CD) server can’t execute Google Cloud actions in a specific project because of permission issues. You need to validate whether the used service account has the appropriate roles in the specific project. What should you do?

A. Open the Google Cloud console, and check the Identity and Access Management (IAM) roles assigned to the service account at the project or inherited from the folder or organization levels.
B. Open the Google Cloud console, and check the organization policies.
C. Open the Google Cloud console, and run a query to determine which resources this service account can access.
D. Open the Google Cloud console, and run a query of the audit logs to find permission denied errors for this service account.
Show Answer
Correct Answer: A
Explanation:
To validate whether a service account has the appropriate permissions in a specific project, inspect the IAM roles granted to that service account at the project level and any roles inherited from parent resources (folder or organization). Organization policies govern constraints rather than assigned roles, IAM policy analysis of accessible resources is not the primary way to verify assigned roles, and audit logs can reveal permission denials but do not directly validate whether the required roles are assigned.

Question 119

Your company runs one batch process in an on-premises server that takes around 30 hours to complete. The task runs monthly, can be performed offline, and must be restarted if interrupted. You want to migrate this workload to the cloud while minimizing cost. What should you do?

A. Create an Instance Template with Spot VMs On. Create a Managed Instance Group from the template and adjust Target CPU Utilization. Migrate the workload.
B. Migrate the workload to a Compute Engine VM. Start and stop the instance as needed.
C. Migrate the workload to a Google Kubernetes Engine cluster with Spot nodes.
D. Migrate the workload to a Compute Engine Spot VM.
Show Answer
Correct Answer: B
Explanation:
A Spot VM can be preempted at any time. The workload must be restarted from the beginning if interrupted, making Spot a poor fit despite its lower cost. A regular Compute Engine VM that is started only for the monthly batch job minimizes cost while avoiding interruption risk. A Managed Instance Group and GKE add unnecessary complexity for a single batch job.

Question 120

You are working for a hospital that stores its medical images in an on-premises data room. The hospital wants to use Cloud Storage for archival storage of these images. The hospital wants an automated process to upload any new medical images to Cloud Storage. You need to design and implement a solution. What should you do?

A. Create a Pub/Sub topic, and enable a Cloud Storage trigger for the Pub/Sub topic. Create an application that sends all medical images to the Pub/Sub topic.
B. Create a script that uses the gcloud storage command to synchronize the on-premises storage with Cloud Storage, Schedule the script as a cron job.
C. Create a Pub/Sub topic, and create a Cloud Function connected to the topic that writes data to Cloud Storage. Create an application that sends all medical images to the Pub/Sub topic.
D. In the Google Cloud console, go to Cloud Storage. Upload the relevant images to the appropriate bucket.
Show Answer
Correct Answer: B
Explanation:
The requirement is to automatically upload new on-premises medical images to Cloud Storage for archival. A scheduled synchronization script is the simplest and most appropriate solution among the options. The modern gcloud storage CLI supports synchronization (historically this was commonly done with gsutil rsync). Pub/Sub is not used to transport image files directly from on-premises storage in this scenario, and Cloud Storage does not have a trigger that ingests data from a Pub/Sub topic. Manual uploads do not satisfy the automation requirement.

Question 121

Your company requires all developers to have the same permissions, regardless of the Google Cloud project they are working on. Your company’s security policy also restricts developer permissions to Compute Engine, Cloud Functions, and Cloud SQL. You want to implement the security policy with minimal effort. What should you do?

A. • Create a custom role with Compute Engine, Cloud Functions, and Cloud SQL permissions in one project within the Google Cloud organization. • Copy the role across all projects created within the organization with the gcloud iam roles copy command. • Assign the role to developers in those projects.
B. • Add all developers to a Google group in Google Groups for Workspace. • Assign the predefined role of Compute Admin to the Google group at the Google Cloud organization level.
C. • Add all developers to a Google group in Cloud Identity. • Assign predefined roles for Compute Engine, Cloud Functions, and Cloud SQL permissions to the Google group for each project in the Google Cloud organization.
D. • Add all developers to a Google group in Cloud Identity. • Create a custom role with Compute Engine, Cloud Functions, and Cloud SQL permissions at the Google Cloud organization level. • Assign the custom role to the Google group.
Show Answer
Correct Answer: D
Explanation:
Developers need identical permissions across all projects, limited to Compute Engine, Cloud Functions, and Cloud SQL. A custom role is required because the permission set spans specific services and should exclude broader permissions. Creating the custom role at the organization level allows it to be reused across all projects. Managing membership through a Cloud Identity group minimizes administrative effort, and assigning the organization-level custom role to the group provides inherited access across the organization.

$19

Get all 323 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.