All practice questions
1591 questions
An administrator needs to allow incoming traffic on TCP port 8443 for an existing firewall rule named app-ingress in a Google Cloud Virtual Private Cloud (VPC). Which gcloud command should be executed to modify this existing firewall rule?
A cloud engineer needs to configure a fine-grained custom IAM role for a service account using the gcloud CLI to enforce least privilege access in a Google Cloud project. What is the correct sequence of steps to create the custom role, provision the service account, and apply the required access permissions?
Drag items to arrange them in the correct order
An operator accidentally deleted a critical customer table from a production Cloud SQL for PostgreSQL instance at 14:15 UTC. Automated daily backups and transaction logging (point-in-time recovery) are enabled on the instance. You must restore the database to a new instance to recover the missing data and resume normal operations. Sequence the correct order of steps to complete this recovery process.
Drag items to arrange them in the correct order
A DevOps engineer needs to safely migrate running workloads from an existing GKE node pool named `old-pool` to a newly created node pool named `new-pool` in a GKE Standard cluster without incurring unexpected downtime. Arrange the operational steps in the correct order to safely migrate the workloads and decommission the old node pool.
Drag items to arrange them in the correct order
A backend development team requires permissions to publish messages to existing Cloud Pub/Sub topics and pull messages from existing subscriptions within the `app-messaging-prod` project. The team must not be permitted to create, modify, or delete Pub/Sub topics or subscriptions, nor should they receive access to any other projects within the resource hierarchy. Which TWO IAM role bindings should be granted to the team's principal group to adhere to the Principle of Least Privilege?
Select all that apply
An enterprise application requires a fully managed relational database that provides strong consistency, horizontal scaling, and multi-region transactional replication across multiple continents. A cloud engineer needs to deploy this database instance named `global-orders-db` with 3 nodes using a multi-region configuration (`nam-eur-asia1`). Which command should the cloud engineer run to provision this database instance?
A renewable energy company is planning a Google Kubernetes Engine (GKE) cluster architecture to support two distinct cloud workloads:
1. A stateless telemetry ingestion API service with fluctuating traffic, where the operations team requires zero node management overhead and pod-level resource billing.
2. A fault-tolerant, stateless batch calculation engine that processes sensor data off-peak, where reducing compute cost is the primary constraint.
Which TWO cluster configuration decisions should the cloud engineering team implement? (Select TWO.)
Select all that apply
A financial services firm is migrating a custom relational PostgreSQL database to a Compute Engine virtual machine. The workload requires steady, reliable IOPS and low latency for transactional processing, but the engineering team wants a cost-effective block storage option that performs better than standard HDDs without paying the premium cost of high-performance SSDs. Additionally, the data must persist independently of the VM lifecycle and support automated snapshot backups. Which storage option best satisfies these requirements?
Your organization requires an external security auditor to inspect the configurations of Pub/Sub topics and subscriptions in a specific Google Cloud project. The auditor also needs read-only access to inspect the IAM policy bindings configured on that project, but must not be granted permissions to modify any resources or publish/consume messages. Which TWO roles should be assigned to the auditor at the project level to follow the principle of least privilege? (Select TWO.)
Select all that apply
A solution architect needs to deploy a web microservice stored as a container image in Artifact Registry (`us-central1-docker.pkg.dev/my-project/apps/order-api:v1`) to Google Cloud Run. The deployment must meet the following requirements:
- The service name must be `order-api`.
- It must be deployed to the `us-central1` region.
- It must pass an environment variable `DB_HOST=10.0.0.5` to the application container.
- It must allow incoming public HTTP requests without authentication.
Which `gcloud` command correctly accomplishes this deployment?
A DevOps engineer is using Terraform to automate infrastructure deployment into a dedicated target project named `app-prod-1029`. The service account executing the Terraform pipeline resides in a shared management project `mgmt-hub-8821`. During execution, the pipeline fails with an error indicating that the Compute Engine API (`compute.googleapis.com`) is not enabled for the operation. Which action should the engineer perform to successfully deploy the resources?
A security engineer must configure IAM access for an external automated auditing tool's service account. The tool needs to read all object data stored inside Cloud Storage buckets in a project named `finance-reporting` and send custom metric telemetry to Cloud Monitoring within the same project. To pass compliance, access must strictly enforce the principle of least privilege and be scoped without granting unnecessary administrative permissions or resource hierarchy inheritance overhead. Which TWO role assignments should be granted to the service account on the `finance-reporting` project?
Select all that apply
A cloud engineer is tasked with executing a zero-downtime canary rollout of a newly built container revision `v2` for an existing production Cloud Run service named `inventory-api` currently serving all traffic from revision `v1`. The engineering policy mandates testing the isolated new revision via a dedicated endpoint prior to exposing any production users, followed by a staged traffic migration. In what chronological sequence should the engineer execute these operational steps?
Drag items to arrange them in the correct order
A cloud engineer is authoring an automated shell script to deploy Compute Engine virtual machines dedicated to nightly batch analytics processing. The processing jobs are fault-tolerant, stateless, and require aggressive cost optimization. Additionally, each VM must automatically execute a boot configuration script located on the local administrator machine at `/local/config/init.sh` upon startup. Which flags should be included in the `gcloud compute instances create` command to satisfy these operational requirements? (Select TWO)
Select all that apply
A Cloud Engineer needs to inspect the Virtual Private Cloud (VPC) network configurations in a Google Cloud project using the command-line tool. Which of the following commands can be used to view or list VPC network information? (Select TWO.)
Select all that apply
An organization needs to grant a newly onboarded team of data analysts access to process datasets within a Google Cloud project named `analytics-prod`. The analysts must be able to read files stored inside Cloud Storage buckets in this project and run BigQuery SQL queries to analyze data. They must not be permitted to create or delete Cloud Storage buckets, modify object contents, or manage BigQuery dataset permissions. Which TWO predefined IAM roles should be assigned to the analysts' Google Group at the project level to meet these requirements while following the principle of least privilege?
Select all that apply
An operations engineer is managing a production Cloud SQL for PostgreSQL database instance. To analyze query performance bottlenecks, the engineer needs to enable the `pg_stat_statements` extension and adjust database configuration flags. Modifying `shared_preload_libraries` requires a database restart to take effect. Which sequence of administrative actions must the engineer execute to properly apply this configuration using GCP standard practices?
An operations engineer needs to restore a PostgreSQL database backup file stored in a Google Cloud Storage bucket into a target Cloud SQL for PostgreSQL instance using the gcloud CLI. Place the following operational steps in the correct chronological sequence to perform this restoration.
Drag items to arrange them in the correct order
A cloud architecture team is designing an internal microservices layer deployed across Compute Engine instances inside a Google Cloud VPC. The microservices communicate using gRPC over HTTP/2 and require URL path-based routing to direct traffic to appropriate backend service groups. All traffic must remain strictly private within the internal VPC without exposure to the public internet. Which Google Cloud load balancer should be planned to satisfy these requirements?
An enterprise application stores generated invoice PDF files in a Google Cloud Storage bucket. Business compliance rules require retaining these files for 7 years (2,555 days). Operational analysis indicates that invoices are accessed frequently during the first 30 days after creation, accessed roughly once a month between day 31 and day 365, and accessed less than once per year after 365 days. Which Cloud Storage Lifecycle Management configuration optimizes operational storage costs while maintaining accessibility and compliance?