All practice questions

1591 questions

Question 941Question

A Lead Site Reliability Engineer is automating the provisioning of a critical background processing VM named `worker-node-01` in the `us-central1-a` zone. The VM must connect to an existing subnet named `backend-subnet`, execute a local shell script located at `/local/config/bootstrap.sh` on startup, attach a custom service account named `[email protected]`, and strictly prevent any external IP address allocation. Which `gcloud` command correctly fulfills all these operational requirements?

Show answer & explanation

Answer: gcloud compute instances create worker-node-01 --zone=us-central1-a --subnet=backend-subnet --no-address [email protected] --scopes=cloud-platform --metadata-from-file=startup-script=/local/config/bootstrap.sh

Answer

The command that correctly provisions the instance specifies `--metadata-from-file=startup-script=/local/config/bootstrap.sh` to upload the local script content, `--no-address` to block external public IP assignment, `--subnet=backend-subnet` for network placement, and `[email protected]` for identity management.
The correct command properly combines `--metadata-from-file` to read and attach the local startup script, `--no-address` to prohibit public IP creation, `--subnet` to place the VM in the dedicated subnetwork, and `--service-account` with `--scopes` to establish service identity.

Step-by-Step Solution

1
Identify the proper flag for passing a local script file as startup metadata.
Recognize that `--metadata-from-file=startup-script=<path>` reads local file content, whereas `--metadata` only assigns literal string values.
Compute Engine startup scripts stored on the local administrator machine require file content injection during instance creation.
2
Verify network configuration flags for private instance deployment.
Confirm `--no-address` prevents external IP allocation while `--subnet` attaches the instance to `backend-subnet`.
Preventing external IP allocation is mandatory for internal backend resources.
3
Evaluate service account and scope assignment options.
Ensure `--service-account` specifies the full service account email and `--scopes` sets valid API access scopes rather than IAM role strings.
IAM roles cannot be assigned directly through gcloud instance creation scopes.

Key Concept

Compute Engine Instance Creation Flags and Metadata Configuration
Estimated Time:2m 0s
Question 942Question

A Cloud Engineer needs to manually export a Cloud SQL for PostgreSQL database to a Cloud Storage bucket for offline archiving using the Google Cloud CLI. Arrange the steps in the correct procedural order to successfully complete this export operation.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct sequence of steps is: 1) Create a destination Cloud Storage bucket, 2) Grant the Cloud SQL instance service account storage write permissions on the bucket, 3) Execute the gcloud sql export sql command, and 4) Verify that the exported dump file exists in the target bucket.
To export a Cloud SQL database to Google Cloud Storage, you must first ensure the target bucket exists. Next, you must grant the Cloud SQL instance's automatically created service account appropriate IAM write permissions on that bucket. After IAM permissions are established, you issue the `gcloud sql export sql` command. Finally, you confirm the operation's success by checking for the exported file in the Cloud Storage bucket.

Step-by-Step Solution

1
Create the destination Cloud Storage bucket.
A target Cloud Storage bucket is available to store the exported file.
The export target URI must point to an existing Cloud Storage location.
2
Grant write access to the Cloud SQL service account.
The Cloud SQL instance service account has permission to write objects to the bucket.
Without IAM permissions (such as Storage Object Admin or Storage Object Creator) assigned to the service account, the export operation will fail with a permission denied error.
3
Run the export command via gcloud CLI.
Cloud SQL dumps the database content and uploads it to the specified Cloud Storage URI.
Executing the `gcloud sql export sql` command starts the official export operation.
4
Verify file existence in Cloud Storage.
Confirmation that the export completed and the file was written to GCS.
Operational management requires validating that backup and export artifacts are intact.

Key Concept

Exporting Cloud SQL Databases to Cloud Storage
Question 943Question

A company's automated data pipeline application requires access to upload, update, and delete log files within a specific Google Cloud Storage bucket. The application must not be allowed to modify bucket configuration settings, alter lifecycle rules, or manage bucket IAM permissions. Following Google Cloud security best practices for least privilege, which IAM role assignment should be configured for the application's service account?

Show answer & explanation

Answer: Grant the Storage Object Admin role (roles/storage.objectAdmin) directly on the specific Cloud Storage bucket.

Answer

Granting the Storage Object Admin role (roles/storage.objectAdmin) directly on the specific Cloud Storage bucket provides full object manipulation capabilities while restricting bucket-level metadata and policy modifications.
Granting the Storage Object Admin role directly on the target bucket aligns perfectly with the principle of least privilege. It enables full object operations (uploading, updating, deleting) inside that specific bucket, while preventing any changes to bucket configurations, lifecycle policies, or IAM settings.

Step-by-Step Solution

1
Analyze the operational requirements for the service account.
The workload requires creating, updating, and removing objects within a single bucket, but must not alter bucket settings or policies.
Identifying the required scope of permissions is essential for applying least privilege access.
2
Evaluate role granularity for Cloud Storage resources.
Storage Object Admin (roles/storage.objectAdmin) grants object read, write, and delete permissions without bucket management privileges. Storage Admin (roles/storage.admin) and Editor (roles/editor) grant excess administrative permissions.
Google Cloud predefined roles separate object data manipulation from bucket configuration administration.
3
Determine the optimal resource binding level.
Binding the role directly on the specific target bucket limits access exclusively to that bucket, rather than propagating permissions project-wide.
Assigning permissions at the resource level prevents unintended access inheritance across other project buckets.

Key Concept

Principle of Least Privilege with Predefined Roles and Resource-Level IAM Bindings
Estimated Time:1m 30s
Question 944Question

Your organization requires a cloud engineer to export a production Cloud SQL for PostgreSQL instance to a Cloud Storage bucket for long-term compliance archiving. The destination bucket has restricted access, and the export operation must execute successfully without permission errors. What is the correct sequence of steps to perform and verify this database export using the gcloud CLI?

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct order of operations is: First, retrieve the Cloud SQL instance's managed service account email. Second, grant that service account the Storage Object Admin role on the destination bucket. Third, run `gcloud sql export sql` to start the export job. Fourth, monitor the operation using `gcloud sql operations list` or `describe` until it completes.
Exporting data from Cloud SQL to Cloud Storage requires proper IAM authorization for the instance's managed service account. The process must begin by describing the Cloud SQL instance to extract its automatically generated service account email. Next, that service account must be granted write access (`roles/storage.objectAdmin`) on the destination GCS bucket. After IAM permissions are active, executing `gcloud sql export sql` starts the asynchronous dump process. Finally, executing `gcloud sql operations list` or `describe` confirms that the asynchronous task finished without errors.

Step-by-Step Solution

1
Identify Cloud SQL Service Account
Obtained the unique Cloud SQL instance service account email address.
Cloud SQL background processes run under the instance's unique service account rather than the identity of the user invoking the CLI command.
2
Configure Storage IAM Permissions
Granted `roles/storage.objectAdmin` on the destination Cloud Storage bucket to the Cloud SQL service account.
Without explicit bucket-level write permissions, the Cloud SQL service account will fail to write the SQL dump file to the bucket.
3
Execute the SQL Export Command
Started the asynchronous export job sending data to `gs://<bucket-name>/<filename>.sql`.
Once authorization is in place, `gcloud sql export sql` triggers the actual database dump generation.
4
Verify Operation Completion
Confirmed that the operational status of the export job transitioned to `DONE`.
Because export commands return an operation ID and run asynchronously, verifying operation state via `gcloud sql operations` is necessary to ensure success.

Key Concept

Cloud SQL Instance Service Account Authorization and Data Export Lifecycle
Question 945Question

An organization is deploying a web application in Google Cloud that serves static media content to global internet users over HTTPS. The application architecture requires edge caching to reduce latency for static assets. Additionally, backend Compute Engine instances in a Virtual Private Cloud (VPC) must resolve internal database server names using a private domain namespace that is isolated from the public internet. Which TWO architectural components should you include in your network design? (Select TWO)

Select all that apply

Show answer & explanation

Answer: A Global External Application Load Balancer with Cloud CDN enabled for static content backends; A Cloud DNS private managed zone authorized for the application's VPC network

Answer

The correct architecture requires configuring a Global External Application Load Balancer with Cloud CDN enabled for serving global HTTPS static content, and creating a Cloud DNS private managed zone bound to the VPC network for private internal name resolution.
To serve global HTTPS static content with edge caching, Google Cloud requires a Global External Application Load Balancer because Cloud CDN integrates specifically with HTTP(S) proxy load balancers. For internal database name resolution restricted from the public internet, a Cloud DNS private managed zone must be created and linked to the VPC network.

Step-by-Step Solution

1
Evaluate the requirement for serving public HTTPS static content globally with low latency.
Select a Global External Application Load Balancer combined with Cloud CDN, which proxies HTTP(S) traffic at Google's edge locations and caches static media.
Cloud CDN requires an HTTP(S) proxy load balancer (such as Global External Application Load Balancer) to cache assets at edge locations.
2
Evaluate the requirement for internal database domain resolution isolated from the internet.
Configure a Cloud DNS private managed zone and attach it to the target VPC network.
Cloud DNS private managed zones serve DNS records exclusively to instances within authorized VPC networks, preventing external public access.

Key Concept

Selecting appropriate GCP load balancer types for HTTP(S) content caching with Cloud CDN and implementing Cloud DNS private zones for isolated internal name resolution.
Question 946Question

A mobile gaming studio is designing the backend architecture for a new multiplayer game. The backend must store user profiles, real-time game state session documents, and player inventory data. The workload requires single-digit millisecond latency for document queries, automatic multi-region synchronization, dynamic horizontal scaling to millions of concurrent users, and zero database server management overhead. Which Google Cloud storage or database option best satisfies these requirements?

Show answer & explanation

Answer: Firestore in Native mode

Answer

Firestore in Native mode is the ideal Google Cloud solution for storing hierarchical document structures, user profiles, and game session state because it offers serverless auto-scaling, high availability across regions, and native document transactional queries.
Firestore in Native mode provides a serverless, document-oriented NoSQL database that automatically handles multi-region replication, high-concurrency scaling, single-digit millisecond latency, and real-time client SDK synchronization without operational overhead.

Step-by-Step Solution

1
Analyze data model and access pattern requirements
The requirement asks for storing non-relational document data (user profiles, player inventory, game state) with low-latency document queries and real-time syncing.
Matching access patterns to database capabilities ensures performance and cost optimization.
2
Evaluate operational overhead and scaling constraints
The solution must require zero database management overhead and scale horizontally to millions of concurrent users.
Fully managed serverless solutions like Firestore eliminate database provisioning, indexing maintenance, and server maintenance.
3
Select the optimal database option
Firestore in Native mode satisfies all requirements for managed NoSQL document storage with automatic multi-region replication.
Relational options (Cloud SQL), object storage (Cloud Storage), and unmanaged/ephemeral compute instances (Spot VMs) fail either operational or reliability criteria.

Key Concept

Selecting GCP Managed NoSQL Databases vs. Relational/Object Storage based on Workload Requirements
Question 947Question

A software engineer on your team is attempting to deploy a new stateless API service to an existing Google Kubernetes Engine (GKE) cluster named `api-cluster` located in region `us-central1`. When executing `kubectl apply -f deployment.yaml` on a newly provisioned workstation, `kubectl` fails with an error indicating that it cannot connect to a cluster API server at `localhost:8080`. Which action should the engineer take to resolve this issue and successfully deploy the workload?

Show answer & explanation

Answer: Execute `gcloud container clusters get-credentials api-cluster --region us-central1` to update the local kubeconfig file with the cluster credentials and endpoint details.

Answer

Execute `gcloud container clusters get-credentials api-cluster --region us-central1` to populate the local kubeconfig file with the correct GKE API server endpoint and credentials.
The correct option executes `gcloud container clusters get-credentials api-cluster --region us-central1`. This command retrieves authentication details and API endpoint information for the specified GKE cluster and configures the local `kubeconfig` file so that `kubectl` can target the cluster.

Step-by-Step Solution

1
Identify the cause of the `kubectl` connection error
Recognize that `kubectl` defaults to `localhost:8080` when no valid context or kubeconfig entry exists for the target cluster.
Before `kubectl` can interact with a GKE cluster, the local environment must have an active context pointing to the cluster's API server.
2
Generate cluster kubeconfig credentials using gcloud
Run `gcloud container clusters get-credentials api-cluster --region us-central1`.
This command securely retrieves the cluster's endpoint and generates authentication tokens, writing them into `~/.kube/config`.
3
Deploy the workload manifest
Execute `kubectl apply -f deployment.yaml` successfully.
With valid cluster credentials and context active, `kubectl` sends the API requests directly to the GKE control plane.

Key Concept

Fetching GKE Cluster Kubeconfig Credentials
Question 948Question

A cloud operations team manages a stateless web application running on a Google Kubernetes Engine (GKE) Standard cluster. During peak usage, individual pods reach maximum CPU allocation, requiring additional pod replicas to handle incoming requests. Additionally, during sudden traffic spikes, newly created pods remain in a Pending state because the existing worker nodes lack available CPU capacity to schedule them. Which TWO actions should the team implement to establish dynamic autoscaling at both the workload layer and the cluster infrastructure layer? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Deploy a Horizontal Pod Autoscaler (HPA) targeting the web application Deployment to dynamically scale pod replicas based on observed CPU utilization.; Enable Cluster Autoscaler on the GKE node pool to automatically provision additional Compute Engine worker nodes when pods cannot be scheduled due to resource constraints.

Answer

To resolve resource bottlenecks at both the application workload level and the underlying cluster infrastructure level, deploy a Horizontal Pod Autoscaler (HPA) to dynamically adjust pod replica counts and enable Cluster Autoscaler on the GKE node pool to automatically add worker nodes when pending pods cannot be scheduled.
Managing GKE capacity efficiently requires separating workload scaling from infrastructure scaling. Horizontal Pod Autoscaler (HPA) automatically adjusts the number of running pod replicas based on real-time CPU utilization metrics. When pod creation causes node capacity to be exhausted, Cluster Autoscaler detects the unschedulable (Pending) pods and automatically provisions new worker nodes into the GKE node pool.

Step-by-Step Solution

1
Identify the workload-level requirement.
Individual pods are reaching CPU capacity limits, indicating the need to scale the number of running pod instances.
Horizontal Pod Autoscaler (HPA) monitors pod-level metrics such as CPU usage and adjusts replica counts accordingly.
2
Identify the infrastructure-level requirement.
New pods remain in a Pending state due to insufficient CPU capacity on existing worker nodes.
Cluster Autoscaler monitors unschedulable pods and automatically scales up the number of GKE worker nodes in the node pool.
3
Combine HPA and Cluster Autoscaler.
HPA creates new pod replicas in response to high CPU load, and Cluster Autoscaler provisions new worker nodes whenever HPA-created pods exceed current node pool capacity.
This complementary two-tier scaling architecture handles both pod demand and node resource availability.

Key Concept

Two-tier autoscaling in GKE: Pod-level scaling with HPA vs Node-level scaling with Cluster Autoscaler
Estimated Time:1m 30s
Question 949Question

Your team manages a high-throughput sensor application that stores real-time metrics in a Cloud Bigtable instance. During peak operational hours, read and write latencies spike significantly because average node CPU utilization exceeds 90%. You need to resolve this performance bottleneck during peak traffic while ensuring cost-efficient operations and minimal administrative overhead. Which two actions should you take? (Select TWO answers.)

Select all that apply

Show answer & explanation

Answer: Enable autoscaling on the Cloud Bigtable cluster and configure a target CPU utilization threshold.; Manually increase the node count of the Cloud Bigtable cluster prior to predicted peak traffic windows.

Answer

The correct actions are to enable Cloud Bigtable autoscaling with a target CPU threshold and to manually increase the cluster node count to handle peak traffic.
Cloud Bigtable scales performance linearly by adjusting the number of nodes in a cluster. Adding nodes increases compute capacity and reduces CPU load per node, directly resolving latency spikes. Configuring Cloud Bigtable autoscaling automates node management based on CPU utilization targets, while manually scaling nodes allows proactive capacity adjustments.

Step-by-Step Solution

1
Identify the cause of performance degradation
High read/write latencies occur due to CPU utilization exceeding 90% across Bigtable nodes.
Cloud Bigtable compute capacity and overall throughput scale linearly with the number of nodes in a cluster.
2
Evaluate scale-out solutions for Bigtable
Adding nodes manually or enabling autoscaling based on CPU targets increases compute resources per cluster.
Both manual node adjustments and autoscaling dynamically allocate nodes to lower CPU load without requiring downtime or schema migration.

Key Concept

Managing Cloud Bigtable performance and node scaling
Question 950Question

A Cloud Engineer is configuring an automated continuous integration pipeline to deploy Compute Engine virtual machines into a target project named `prod-services-456` using Terraform. The deployment pipeline runs under a service account created in a separate central CI/CD GCP project. According to Google Cloud security and operational best practices, which approach should the engineer take to ensure Terraform authenticates securely and successfully provisions the infrastructure?

Show answer & explanation

Answer: Configure the deployment pipeline to use service account impersonation with necessary predefined roles assigned in `prod-services-456`, and ensure the required Compute Engine API is enabled within `prod-services-456`.

Answer

Configure the deployment pipeline to use service account impersonation with necessary predefined roles assigned in `prod-services-456`, and ensure the required Compute Engine API is enabled within `prod-services-456`.
The correct approach uses short-lived authentication via service account impersonation to eliminate static key leakage risks, ensures that the required Google Cloud service APIs (Compute Engine API) are enabled inside the target project where the virtual machines will be created, and enforces the principle of least privilege using predefined roles.

Step-by-Step Solution

1
Determine the secure authentication mechanism for cross-project Terraform execution.
Identified service account impersonation as the recommended practice over static JSON key files.
Static JSON key files present key management security risks, whereas service account impersonation provides short-lived tokens.
2
Verify target project API prerequisites for Terraform resource creation.
Confirmed that the Compute Engine API must be enabled in the target host project `prod-services-456`.
GCP resource management endpoints require API enablement within the project where resources are instantiated.
3
Apply the principle of least privilege for IAM permission assignment.
Selected specific predefined roles bound to the target project rather than primitive or organization-wide roles.
Predefined roles restrict permissions strictly to necessary operations for Compute Engine provisioning.

Key Concept

Terraform GCP Service Account Impersonation and API Enablement Scoping
Question 951Question

A security administrator needs to grant a data analyst permission to run SQL queries on a specific BigQuery dataset within a Google Cloud project, while adhering strictly to the principle of least privilege. Which of the following IAM role assignments should the administrator configure? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Assign the BigQuery Data Viewer (roles/bigquery.dataViewer) role on the specific dataset to allow reading table data.; Assign the BigQuery Job User (roles/bigquery.jobUser) role at the project level to allow executing query jobs.

Answer

To enable running SQL queries on a specific dataset under least privilege, assign the BigQuery Data Viewer role at the dataset level and the BigQuery Job User role at the project level.
Executing BigQuery queries requires both dataset read permissions and project job execution permissions. Granting BigQuery Data Viewer scoped to the specific dataset allows querying table data without altering table schemas or accessing other datasets. Granting BigQuery Job User at the project level allows running query jobs without granting access to dataset contents or administrative rights.

Step-by-Step Solution

1
Determine data access permission scoped to the resource.
Assigning BigQuery Data Viewer on the specific dataset provides read access to table contents without over-granting access to other datasets in the project.
The principle of least privilege requires scoping data access permissions to the specific target resource.
2
Determine job execution permission required for query processing.
Assigning BigQuery Job User at the project level grants permission to create and run query jobs.
Users must have job execution permissions in the project running the BigQuery job, independent of dataset read permissions.

Key Concept

Applying Least Privilege with Predefined Roles and Resource Scopes
Question 952Question

A solutions architect is automating the deployment of a managed NoSQL database service on Google Cloud to handle low-latency, high-throughput time-series writes from millions of IoT telemetry sensors. The application requires consistent sub-10ms performance and high availability. The database instance named `telemetry-db` must be deployed using the Google Cloud CLI with an initial cluster named `telemetry-c1` in the `us-central1-a` zone with 3 nodes. Which `gcloud` command correctly provisions this instance?

Show answer & explanation

Answer: gcloud bigtable instances create telemetry-db --display-name="Telemetry DB" --cluster=telemetry-c1 --cluster-zone=us-central1-a --cluster-num-nodes=3 --cluster-storage-type=SSD

Answer

The command 'gcloud bigtable instances create telemetry-db --display-name="Telemetry DB" --cluster=telemetry-c1 --cluster-zone=us-central1-a --cluster-num-nodes=3 --cluster-storage-type=SSD' correctly provisions a Cloud Bigtable instance with SSD storage for low-latency IoT time-series data.
The correct command uses `gcloud bigtable instances create` with `--cluster-storage-type=SSD` and 3 cluster nodes in the specified zone. Cloud Bigtable is the optimal GCP managed database service for massive NoSQL time-series ingestion, and SSD storage ensures low-latency performance required by the SLA.

Step-by-Step Solution

1
Identify database engine requirements
Cloud Bigtable is selected because the workload demands low-latency, high-throughput NoSQL time-series data ingestion.
Matching workload requirements to the appropriate managed GCP database product.
2
Determine appropriate storage disk type
SSD storage (--cluster-storage-type=SSD) is required to guarantee sub-10ms read/write performance.
HDD storage does not meet low-latency performance SLAs.
3
Formulate the correct gcloud CLI syntax
Use `gcloud bigtable instances create` specifying instance name, cluster name, zone, node count, and SSD storage.
Ensures proper automated provisioning using Google Cloud CLI flags.

Key Concept

Provisioning Cloud Bigtable Instances with gcloud CLI
Question 953Question

A system administrator manages a Cloud Storage bucket containing application log files. The logs are frequently inspected during the first 30 days after creation, but are accessed only occasionally after 30 days. To automatically reduce storage costs without deleting any data or manually moving files, which action should you perform?

Show answer & explanation

Answer: Configure an Object Lifecycle Management rule on the bucket to transition objects to Nearline Storage after 30 days.

Answer

Configure an Object Lifecycle Management rule on the bucket to transition objects to Nearline Storage after 30 days.
Object Lifecycle Management rules allow setting lifecycle conditions (such as Age = 30 days) to automatically transition objects from Standard to Nearline storage, optimizing storage costs according to access frequency.

Step-by-Step Solution

1
Analyze access patterns
Logs are accessed frequently for 30 days, then infrequently afterwards.
Nearline storage is ideal for data accessed less than once a month.
2
Identify the automated management mechanism in Cloud Storage
Object Lifecycle Management allows setting rules based on conditions like object age.
Automating object class transition eliminates manual scripting and operational overhead.

Key Concept

Cloud Storage Object Lifecycle Management
Question 954Question

A bioinformatics research laboratory is architecting a Google Kubernetes Engine (GKE) cluster for two main workloads:

1. A continuous API service that requires custom sysctl kernel parameters for specialized network socket tuning.
2. A large-scale genomic sequencing batch job that is stateless, highly fault-tolerant, and needs to run at the lowest possible cost.

Which TWO cluster architectural decisions should the team make to satisfy all requirements? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Provision a GKE Standard cluster to allow custom node pool configurations with modified sysctl kernel settings.; Configure a secondary node pool using Spot VMs to execute the stateless genomic sequencing batch jobs.

Answer

The team should provision a GKE Standard cluster to enable custom sysctl kernel configurations for the API service, and create a secondary node pool using Spot VMs for the stateless batch processing jobs.
GKE Standard mode allows custom node configurations, which is necessary when applications require specific Linux sysctl kernel modifications. For stateless and fault-tolerant batch workloads, provisioning a dedicated node pool powered by Spot VMs delivers optimal cost reduction while accepting potential node preemptions.

Step-by-Step Solution

1
Analyze operational boundary requirements for the API service
Identified requirement for custom sysctl kernel settings
GKE Autopilot abstracts node management and restricts node OS kernel modifications. Therefore, GKE Standard is required to configure custom node pools with tuned sysctl parameters.
2
Evaluate node pool infrastructure for the genomic batch workload
Identified stateless, fault-tolerant batch processing requirements
Stateless batch jobs can withstand node terminations. Using Spot VMs in a dedicated node pool maximizes cost efficiency without risking data loss.

Key Concept

GKE Cluster Architecture Selection (Standard vs. Autopilot and Spot VM Integration)
Question 955Question

An organization runs an enterprise e-commerce application on a Google Kubernetes Engine (GKE) Standard cluster. During sudden promotional events, several newly created pods remain indefinitely in a Pending state because existing nodes lack unallocated CPU capacity, yet the cluster fails to provision additional Compute Engine nodes. Concurrently, non-critical background batch processing workloads are consuming compute capacity on nodes reserved for core stateful API services. Which TWO management actions should a cloud engineer perform to resolve the node scaling failure and isolate the workloads? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Define explicit CPU resource requests in the pod specification manifests to allow the GKE Cluster Autoscaler to identify unschedulable pods and trigger node pool expansion.; Apply node taints to a dedicated batch processing node pool and add matching tolerations to the batch workload pod specifications.

Answer

The cloud engineer must configure explicit CPU resource requests in the pod specifications so the Cluster Autoscaler can evaluate resource deficits, and configure taints on the dedicated batch node pool with matching tolerations on batch workload pods for workload isolation.
Specifying CPU resource requests in pod manifests provides the scheduler and GKE Cluster Autoscaler with the required metrics to detect unschedulable pods and provision new Compute Engine nodes. Applying node taints to a dedicated batch pool combined with matching pod tolerations restricts batch execution strictly to designated nodes, safeguarding stateful API service resources.

Step-by-Step Solution

1
Diagnose why GKE Cluster Autoscaler is failing to scale up node instances for pending pods.
Cluster Autoscaler evaluates pod resource requests against node capacity. Without explicit resource requests in pod specifications, Kubernetes cannot determine required capacity and marks pending pods as non-triggering for autoscaling.
Explicit container CPU requests are mandatory for the scheduler and autoscaler to calculate unallocated capacity and scale node pools automatically.
2
Implement strict workload separation between non-critical batch jobs and core stateful API services.
Tainting the batch node pool repels all pods without matching tolerations, while adding tolerations to batch pods allows them to schedule exclusively on those tainted nodes.
Taints and tolerations enforce node-level execution boundaries, preventing background jobs from competing with primary application workloads.

Key Concept

GKE Cluster Autoscaler Resource Request Requirements and Workload Isolation using Taints and Tolerations
Question 956Question

A cloud administrator needs to configure access for two team members working in a Google Cloud project. An compliance auditor requires read-only access to view IAM policy bindings across all resources in the project. Additionally, a security engineer needs to create and manage custom IAM roles within the project. Following Google's recommended practices for least privilege, which TWO IAM roles should the administrator grant? (Select TWO.)

Select all that apply

Show answer & explanation

Answer: Grant the Security Reviewer role (roles/iam.securityReviewer) to the compliance auditor.; Grant the Role Administrator role (roles/iam.roleAdmin) to the security engineer.

Answer

The administrator should grant the Security Reviewer role (roles/iam.securityReviewer) to the compliance auditor and the Role Administrator role (roles/iam.roleAdmin) to the security engineer.
The Security Reviewer role provides read access to security and IAM configurations without permission to modify resources, fulfilling the auditor's requirement under least privilege. The Role Administrator role allows creating, editing, and deleting custom roles, satisfying the security engineer's duty without granting excess access to project workloads or data.

Step-by-Step Solution

1
Identify the minimum required permissions for the compliance auditor.
The auditor requires read-only visibility into security configurations and IAM policy bindings, which maps directly to the predefined role Security Reviewer (roles/iam.securityReviewer).
Predefined roles are preferred over primitive roles to restrict access to only necessary actions.
2
Identify the minimum required permissions for the security engineer.
The security engineer requires permission to manage custom IAM roles, which corresponds to the Role Administrator role (roles/iam.roleAdmin).
This role grants permission to manage custom roles without granting broad project control or billing access.
3
Evaluate the incorrect options based on IAM principles.
Primitive roles grant excessive privileges, and IAM permissions cannot be revoked at lower levels to block higher-level inherited access.
IAM inheritance is strictly union/additive.

Key Concept

Applying least privilege using predefined IAM roles for security auditing and custom role administration
Question 957Question

An enterprise security compliance policy requires an external auditing team to be granted read-only access to log files in a specific Cloud Storage bucket and query access to a specific BigQuery dataset in a production project. To strictly adhere to the Principle of Least Privilege, which of the following IAM role configurations should you apply? (Select TWO answers.)

Select all that apply

Show answer & explanation

Answer: Grant the Cloud Storage Object Viewer (roles/storage.objectViewer) role to the auditors on the specific Cloud Storage bucket.; Grant the BigQuery Data Viewer (roles/bigquery.dataViewer) role to the auditors on the specific BigQuery dataset.

Answer

Assigning predefined roles (roles/storage.objectViewer and roles/bigquery.dataViewer) directly at the specific resource levels (bucket and dataset) satisfies the access requirements while maintaining the Principle of Least Privilege.
Granting predefined roles directly on the individual target resources (Cloud Storage Object Viewer on the bucket and BigQuery Data Viewer on the dataset) enforces the Principle of Least Privilege by restricting access strictly to the requested data assets.

Step-by-Step Solution

1
Determine the required access scope for the Cloud Storage requirement.
The principal needs object read access for one bucket.
Binding roles/storage.objectViewer directly to the bucket restricts access exclusively to that bucket.
2
Determine the required access scope for the BigQuery requirement.
The principal needs table query and read access for one dataset.
Binding roles/bigquery.dataViewer directly to the dataset restricts access exclusively to that dataset.
3
Evaluate potential distractor role assignments against least privilege.
Avoid project-level primitive roles and folder-level policy bindings.
Primitive roles grant overly broad project-wide rights, and folder bindings inherit access across all child resources.

Key Concept

Applying least-privilege access control by granting predefined IAM roles at specific resource levels rather than using primitive roles or binding roles higher in the resource hierarchy.
Question 958Question

An enterprise IoT telemetry system writes high-frequency streaming data into a single-cluster Cloud Bigtable instance configured with SSD storage. During scheduled analytical batch operations, heavy read queries degrade cluster write performance, leading to high write latencies and timeout errors for incoming telemetry streams. Operational requirements dictate isolating the analytical read workload from the real-time write workload while maintaining seamless workload routing without exporting data out of Cloud Bigtable or changing the application's underlying database model. Which action should you take?

Show answer & explanation

Answer: Add a second cluster to the Cloud Bigtable instance, then configure separate App Profiles with single-cluster routing so that the real-time ingestion traffic routes to the primary cluster and the analytical queries route to the secondary cluster.

Answer

Add a second cluster to the Cloud Bigtable instance, then configure separate App Profiles with single-cluster routing so that the real-time ingestion traffic routes to the primary cluster and the analytical queries route to the secondary cluster.
The correct option addresses query contention at the database architecture level by adding a second cluster to the existing Cloud Bigtable instance. By configuring separate App Profiles with single-cluster routing, real-time ingestion is pinned to the primary cluster while analytical batch queries target the replicated secondary cluster, ensuring workload isolation and high write availability without exporting data out of Bigtable.

Step-by-Step Solution

1
Analyze workload isolation requirements in Cloud Bigtable.
Identified resource contention between streaming real-time writes and batch analytical reads on a single cluster.
Cloud Bigtable cluster nodes handle both read and write requests; heavy reads starve CPU resources needed for real-time writes.
2
Evaluate Cloud Bigtable multi-cluster replication and App Profile routing capabilities.
Determined that multi-cluster replication synchronizes data between clusters within the same instance.
Adding a second cluster enables workload separation via application-level isolation.
3
Configure dedicated App Profiles for isolated workload routing.
Assigned streaming ingestion clients to an App Profile targeting Cluster 1 and analytical batch queries to an App Profile targeting Cluster 2.
Single-cluster routing per App Profile ensures query isolation while Cloud Bigtable handles eventual consistency and data synchronization asynchronously across clusters.

Key Concept

Cloud Bigtable Multi-Cluster Workload Isolation and App Profiles
Estimated Time:3m 0s
Question 959Question

A lead engineer at an online education company is using the Google Cloud Pricing Calculator to model monthly infrastructure costs for a video analytics platform. The architecture requires compute resources for two distinct workloads: a core service that runs continuously 24 hours a day, 7 days a week, and a secondary stateless batch processing service that generates video thumbnails and can tolerate unexpected instance terminations. Which configuration strategy in the Google Cloud Pricing Calculator provides the most accurate and cost-effective monthly estimate for these compute workloads?

Show answer & explanation

Answer: Model the continuous workload using standard Compute Engine instances to incorporate Sustained Use Discounts or Committed Use Discounts, and select Spot VMs for the fault-tolerant batch processing workload.

Answer

Model the continuous workload using standard Compute Engine instances to incorporate Sustained Use Discounts or Committed Use Discounts, and select Spot VMs for the fault-tolerant batch processing workload.
The correct strategy models the 24/7 core service using standard Compute Engine instances (allowing the Pricing Calculator to automatically factor in Sustained Use Discounts or apply Committed Use Discounts) while assigning Spot VMs to the batch thumbnail extraction service because it is stateless and tolerant of sudden interruptions.

Step-by-Step Solution

1
Analyze the workload requirements
Identified two workload profiles: (1) a 24/7 continuous baseline service requiring high availability, and (2) a stateless, fault-tolerant batch processing job.
Different compute usage patterns and interruption tolerances qualify for different GCP pricing mechanisms.
2
Match workloads to optimal GCP billing modes
Continuous 24/7 workloads benefit from Sustained Use Discounts (SUDs) or Committed Use Discounts (CUDs) on standard VMs. Interruption-tolerant batch workloads are best suited for Spot VMs.
Spot VMs offer discounts of up to 60-91% off standard prices but can be terminated by Compute Engine at any time.
3
Configure the parameters in the Google Cloud Pricing Calculator
Select standard N1/N2/E2 instance types for continuous uptime to let the calculator automatically factor in SUDs/CUDs, and check the 'Spot (Preemptible)' option for the batch workload nodes.
This configuration accurately reflects actual Google Cloud billing rules and minimizes total infrastructure expenditure.

Key Concept

Cost estimation for heterogeneous compute workloads using Google Cloud Pricing Calculator, balancing Sustained Use Discounts (SUDs), Committed Use Discounts (CUDs), and Spot VM provisioning.
Estimated Time:1m 30s
Question 960Question

A cloud engineer must provision a Compute Engine virtual machine instance that automatically retrieves and executes a startup script stored in a private Cloud Storage bucket (`gs://corp-scripts-prod/init.sh`). The environment mandates strict adherence to the principle of least privilege using custom identities. Arrange the operational steps in the correct sequential order to properly configure permissions, deploy the VM instance via `gcloud`, and validate deployment success.

Drag items to arrange them in the correct order

Show answer & explanation

Answer

The correct sequence is: 1) Create the dedicated custom service account, 2) Grant the Storage Object Viewer role to the service account on the Cloud Storage bucket, 3) Run `gcloud compute instances create` referencing the custom service account and setting `startup-script-url`, and 4) Execute `gcloud compute instances get-serial-port-output` to verify script execution.
Proper deployment order requires establishing the service account identity first, authorizing that identity to read the target Cloud Storage object second, deploying the instance with the appropriate gcloud flags pointing to the identity and script metadata third, and finally querying the serial port output to confirm successful script execution.

Step-by-Step Solution

1
Create a dedicated custom service account for the VM workload.
A specific service account identity is established in IAM.
Least privilege mandates avoiding default service accounts with broad primitive roles.
2
Assign the `roles/storage.objectViewer` role to the custom service account for the bucket containing the script.
The identity gains read access to objects inside `gs://corp-scripts-prod`.
Compute Engine startup script fetching uses the VM instance's attached service account credentials.
3
Provision the instance with `gcloud compute instances create` using `--service-account` and `--metadata=startup-script-url=...`.
The instance launches, binds the service account, and fetches the startup script on first boot.
Flags must specify both identity bindings and startup script location.
4
Inspect serial port output logs using `gcloud compute instances get-serial-port-output`.
The engineer confirms that `startup-script` completed without exit code failures.
Serial output provides runtime confirmation of startup script execution on Linux Compute Engine images.

Key Concept

Deploying Compute Engine VMs with custom service accounts and GCS startup scripts
PreviousPage 48 / 80Next
All practice questions — Google Cloud Associate Cloud Engineer | Examkin