Sign in
Home/Google Cloud/Professional Cloud Developer (Google Cloud)/Free questions

Professional Cloud Developer (Google Cloud) — Free Practice Questions

10 free sample questions from a bank of 338, with the correct answers and explanations. No signup required — start practising right now.

1You want to upload files from an on-premises virtual machine to Google Cloud Storage as part of a data migration. These files will be consumed by Cloud DataProc Hadoop cluster in a GCP environment. Which command should you use?
  • gsutil cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
  • gcloud cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
  • hadoop fs cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
  • gcloud dataproc cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
Answer: A

The short version

A — gsutil cp moves on-premises files to Cloud Storage for Dataproc. It is the storage-transfer utility for local-to-bucket copies feeding Hadoop workloads.

Key concepts in this question

  • gsutil cp: the Cloud Storage command-line tool supporting local paths to bucket URIs with parallel and resumable uploads.
  • Cloud Storage bucket destination: gs-prefixed URIs that Dataproc Hadoop jobs can read natively as input.
  • gcloud cp misconception: gcloud manages platform resources but does not provide a cp verb for Storage object copies.
  • hadoop fs cp scope: operates between Hadoop-compatible filesystems once data is already reachable, not for initial on-premises upload.
  • gcloud dataproc cp misconception: Dataproc commands manage clusters and jobs, not direct Storage object transfer.

Why A is correct

A is correct because gsutil is purpose-built for uploading local objects to buckets with checksum validation and retry handling. Copying files to gs destination makes them immediately consumable by the Cloud Dataproc Hadoop cluster over the storage connector. The other commands either lack a copy verb or operate in the wrong layer for on-premises to cloud migration.

Why the others are wrong

  • B. gcloud cp is not a valid Storage transfer command, so it cannot upload local files to the bucket.
  • C. hadoop fs cp assumes Hadoop filesystem access and is not the tool for first-mile upload from an on-premises VM.
  • D. gcloud dataproc cp does not exist as a Storage copy path, Dataproc manages clusters rather than object uploads.

PCD exam tip

For PCD storage uploads, choose gsutil cp for local to bucket, and gcloud storage or compute scp for other resource moves.

2You migrated your applications to Google Cloud Platform and kept your existing monitoring platform. You now find that your notification system is too slow for time critical problems. What should you do?
  • Replace your entire monitoring platform with Stackdriver.
  • Install the Stackdriver agents on your Compute Engine instances.
  • Use Stackdriver to capture and alert on logs, then ship them to your existing platform.
  • Migrate some traffic back to your old platform and perform AB testing on the two platforms concurrently.
Answer: C

The short version

C — Capture fast alerts in Stackdriver while forwarding to the existing platform. Hybrid alerting preserves investment yet fixes slow time-critical notifications.

Key concepts in this question

  • Stackdriver logging and alerting: low-latency log ingestion plus policy-based alerts for time-critical production problems.
  • Existing monitoring platform: a retained system with dashboards and history that is too slow only for urgent notification paths.
  • Full replacement cost: ripping out the platform discards integrations and retraining value for marginal gain.
  • Agent installation alone: shipping richer metrics without alert routing does not solve slow notification delivery.
  • A-B traffic rollback: moving load back for platform comparison prolongs risk instead of fixing alert latency.

Why C is correct

C is correct because Stackdriver can tail logs, evaluate alert conditions in near real time and notify responders, then export or forward enriched events to the legacy platform. That keeps single-pane history while meeting strict notification speed for critical issues. It is the minimal-change architecture balancing speed and reuse.

Why the others are wrong

  • A. Replacing the entire platform is disruptive and unnecessary when only time-critical alerting is slow.
  • B. Installing agents improves metric depth but without alert-and-forward design leaves slow notifications unresolved.
  • D. Migrating traffic back for A-B testing delays remediation and reintroduces risk without fixing latency.

PCD exam tip

On PCD, when told kept existing monitoring but alerts too slow, pick Stackdriver alerts plus forward to existing.

3You are planning to migrate a MySQL database to the managed Cloud SQL database for Google Cloud. You have Compute Engine virtual machine instances that will connect with this Cloud SQL instance. You do not want to whitelist IPs for the Compute Engine instances to be able to access Cloud SQL. What should you do?
  • Enable private IP for the Cloud SQL instance.
  • Whitelist a project to access Cloud SQL, and add Compute Engine instances in the whitelisted project.
  • Create a role in Cloud SQL that allows access to the database from external instances, and assign the Compute Engine instances to that role.
  • Create a CloudSQL instance on one project. Create Compute engine instances in a different project. Create a VPN between these two projects to allow internal access to CloudSQL.
Answer: A

The short version

A — Private IP for Cloud SQL avoids IP whitelisting for Compute Engine. Internal RFC 1918 connectivity through VPC peering lets VMs reach the database securely.

Key concepts in this question

  • Private IP: a VPC-private address on Cloud SQL backed by private services access, reachable only inside authorized networks.
  • Compute Engine clients: VMs in peered VPCs that can use internal addresses without public exposure.
  • IP whitelisting burden: managing authorized networks for ephemeral VM addresses, operationally fragile and insecure.
  • Project whitelisting and role ideas: not valid Cloud SQL access controls for network reachability from Compute Engine.
  • Cross-project VPN complexity: extra tunnels between projects when private-services peering already solves the need.

Why A is correct

A is correct because enabling private IP places Cloud SQL on the VPC network where Compute Engine instances communicate internally. No public IP or whitelist entry is required, and traffic stays off the internet with lower latency. That satisfies the migration constraint for MySQL clients cleanly and securely.

Why the others are wrong

  • B. Whitelisting a project is not the Cloud SQL mechanism for Compute Engine access and still implies network allowlisting.
  • C. Creating a database role does not grant network reachability, authorization cannot substitute for private connectivity.
  • D. Building VPNs across projects adds cost and hops when native private IP peering already provides internal access.

PCD exam tip

For PCD Cloud SQL plus no whitelist, immediately choose private IP over public IP plus authorized networks.

4You have deployed an HTTP(s) Load Balancer with the gcloud commands shown below. Health checks to port 80 on the Compute Engine virtual machine instance are failing and no traffic is sent to your instances. You want to resolve the problem. Which commands should you run?
  • gcloud compute instances add-access-config ${NAME}-backend-instance-1
  • gcloud compute instances add-tags ${NAME}-backend-instance-1 --tags http-server
  • gcloud compute firewall-rules create allow-lb --network load-balancer --allow tcp --source-ranges 130.211.0.0/22,35.191.0.0/16 --direction INGRESS
  • gcloud compute firewall-rules create allow-lb --network load-balancer --allow tcp --destination-ranges 130.211.0.0/22,35.191.0.0/16 --direction EGRESS
Answer: C

The short version

C — Allow INGRESS TCP from load-balancer ranges to fix failing health checks. Google front ends probe port 80 from documented ranges that the firewall must permit.

Key concepts in this question

  • HTTP load balancer health checks: Google probes backends on port 80 from 130.211.0.0 slash 22 and 35.191.0.0 slash 16.
  • INGRESS firewall direction: controls traffic entering the VPC toward VM backends, which is the blocked probe path.
  • Source ranges: the probe origin CIDRs that must be allowed, distinct from destination ranges in rule syntax.
  • Access-config and tag options: network attachment or label changes that do not open the required probe ports.
  • EGRESS misconception: outbound rules govern VM-initiated traffic, not inbound probe delivery to port 80.

Why C is correct

C is correct because creating an INGRESS allow for TCP from the two Google probe ranges opens port-80 health checks to the backend network. Once probes succeed, the load balancer marks instances healthy and forwards traffic. The command syntax with source ranges plus INGRESS direction is the documented fix for this exact failure.

Why the others are wrong

  • A. Adding an access config gives external IPs but does not permit inbound probe traffic through the firewall.
  • B. Adding http-server tags only helps if a matching allow rule exists, tags alone open no ports.
  • D. An EGRESS rule with destination ranges controls outbound flow, it cannot admit inbound health-check probes.

PCD exam tip

Memorize PCD load-balancer fix: INGRESS plus TCP plus the two Google probe ranges for port 80.

5Your website is deployed on Compute Engine. Your marketing team wants to test conversion rates between 3 different website designs. Which approach should you use?
  • Deploy the website on App Engine and use traffic splitting.
  • Deploy the website on App Engine as three separate services.
  • Deploy the website on Cloud Functions and use traffic splitting.
  • Deploy the website on Cloud Functions as three separate functions.
Answer: A

The short version

A — App Engine traffic splitting enables clean three-design conversion tests. It shifts user percentages across versions of the same service with built-in measurement.

Key concepts in this question

  • Traffic splitting: weighted routing across App Engine versions for A-B or A-B-C experiments with cookie affinity.
  • Compute Engine limitation: fixed VM deployments lack native version-weighted splitting for marketing experiments.
  • Separate services misconception: distinct services create separate URLs rather than one split audience for conversion comparison.
  • Cloud Functions mismatch: event-driven functions are not the web-serving platform for multi-design site tests.
  • Marketing conversion goal: needs randomized, measurable audience slices rather than infrastructure redeploys.

Why A is correct

A is correct because deploying the website on App Engine and using traffic splitting divides live users across three designs under one URL. Marketing can compare conversion rates with statistical validity and shift weights without redeployment. That managed experimentation path is unavailable with plain Compute Engine hosting.

Why the others are wrong

  • B. Three separate App Engine services fragment URLs and audiences instead of splitting one site audience cleanly.
  • C. Cloud Functions plus splitting mismatches the web-app model and lacks App Engine version-split semantics.
  • D. Three separate functions further fragments routing and offers no coherent site-level conversion experiment.

PCD exam tip

For PCD website experiments, map conversion testing across designs directly to App Engine traffic splitting.

6You need to copy directory local-scripts and all of its contents from your local workstation to a Compute Engine virtual machine instance. Which command should you use?
  • gsutil cp --project ג€my-gcp-projectג€ -r ~/local-scripts/ gcp-instance-name:~/server-scripts/ --zone ג€us-east1-bג€
  • gsutil cp --project ג€my-gcp-projectג€ -R ~/local-scripts/ gcp-instance-name:~/server-scripts/ --zone ג€us-east1-bג€
  • gcloud compute scp --project ג€my-gcp-projectג€ --recurse ~/local-scripts/ gcp-instance-name:~/server-scripts/ --zone ג€us-east1-bג€
  • gcloud compute mv --project ג€my-gcp-projectג€ --recurse ~/local-scripts/ gcp-instance-name:~/server-scripts/ --zone ג€us-east1-bג€
Answer: C

The short version

C — gcloud compute scp with recurse copies directories to the VM. It is the Compute Engine secure-copy path for local folder trees to instance destinations.

Key concepts in this question

  • gcloud compute scp: SSH-based copy to Compute Engine instances supporting instance-name plus path syntax and zone scoping.
  • Recurse flag: required to traverse local-scripts and transfer all nested contents to server-scripts.
  • gsutil cp scope: transfers to Cloud Storage buckets, not to VM filesystems addressed as instance plus path.
  • Project and zone qualifiers: ensure the command targets the correct project and zonal instance for delivery.
  • gcloud compute mv misconception: no such move verb exists for workstation-to-VM directory transfer.

Why C is correct

C is correct because only gcloud compute scp understands the destination form of instance name plus remote path with zone resolution. The recurse option includes every file under local-scripts for delivery to server-scripts. gsutil variants point at buckets rather than VM disks, so they miss the required endpoint.

Why the others are wrong

  • A. gsutil cp targets Storage buckets and cannot address a Compute Engine instance filesystem path.
  • B. gsutil with capital R similarly targets Storage and uses the wrong tool for VM secure copy.
  • D. gcloud compute mv is not the valid directory-copy command for workstation to instance transfer.

PCD exam tip

On PCD, link workstation to VM directory copies to gcloud compute scp with recurse, and bucket copies to gsutil.

7You are deploying your application to a Compute Engine virtual machine instance with the Stackdriver Monitoring Agent installed. Your application is a unix process on the instance. You want to be alerted if the unix process has not run for at least 5 minutes. You are not able to change the application to generate metrics or logs. Which alert condition should you configure?
  • Uptime check
  • Process health
  • Metric absence
  • Metric threshold
Answer: C

The short version

C — Metric absence detects a silent unix process via missing data. When the agent stops reporting the process metric for five minutes, the condition fires without app changes.

Key concepts in this question

  • Metric absence: an alert that triggers when expected time-series points stop arriving within a window.
  • Unchangeable application: no code or log modification is possible, so inference must come from existing agent telemetry.
  • Uptime check contrast: probes external HTTP or TCP endpoints rather than internal unix process presence.
  • Process health label: not the Stackdriver condition name for missing-data detection in this taxonomy.
  • Threshold contrast: fires when values cross numbers, which cannot catch a process that simply stops emitting.

Why C is correct

C is correct because the Monitoring Agent emits process metrics while the unix job runs, and absence for at least five minutes proves it has not run. Configuring a metric-absence policy on that series creates the requested alert with zero application edits. Other conditions either probe the wrong signal or need numeric thresholds that silence cannot satisfy.

Why the others are wrong

  • A. Uptime checks test externally reachable endpoints, not whether an internal unix process recently executed.
  • B. Process health as worded is not the absence-detection condition for this unmodifiable-app scenario.
  • D. Metric threshold needs numeric crossings and cannot reliably fire when the series disappears entirely.

PCD exam tip

For PCD silent-process alerts with no code changes, choose metric absence over threshold or uptime checks.

8You have two tables in an ANSI-SQL compliant database with identical columns that you need to quickly combine into a single table, removing duplicate rows from the result set. What should you do?
  • Use the JOIN operator in SQL to combine the tables.
  • Use nested WITH statements to combine the tables.
  • Use the UNION operator in SQL to combine the tables.
  • Use the UNION ALL operator in SQL to combine the tables.
Answer: C

The short version

C — UNION combines identical ANSI tables while removing duplicates. It stacks result sets vertically and deduplicates rows in one set operation.

Key concepts in this question

  • UNION: a set operator concatenating two SELECT results and eliminating duplicate rows from the combined output.
  • UNION ALL: a faster variant that preserves duplicates, violating the removal requirement here.
  • JOIN: a horizontal combination matching rows across tables by keys, not a vertical stacking for union needs.
  • Nested WITH statements: common table expressions that structure queries but do not themselves combine and deduplicate.
  • Identical-column precondition: both tables share columns, satisfying UNION compatibility without casting.

Why C is correct

C is correct because ANSI SQL defines UNION as vertical concatenation plus duplicate elimination. With identical columns in both tables, one UNION quickly yields a single deduplicated table as requested. JOIN would multiply columns and WITH alone performs no set combination, leaving UNION as the exact fit.

Why the others are wrong

  • A. JOIN merges columns side by side on conditions instead of stacking rows with deduplication.
  • B. Nested WITH statements organize intermediate results but do not combine tables or remove duplicates.
  • D. UNION ALL stacks rows yet retains duplicates, directly contradicting the deduplicated-table requirement.

PCD exam tip

For PCD SQL, memorize UNION equals stack plus dedupe, UNION ALL equals stack plus keep duplicates.

9You have an application deployed in production. When a new version is deployed, some issues don't arise until the application receives traffic from users in production. You want to reduce both the impact and the number of users affected. Which deployment strategy should you use?
  • Blue/green deployment
  • Canary deployment
  • Rolling deployment
  • Recreate deployment
Answer: B

The short version

B — Canary deployment limits blast radius by exposing few users first. Gradual traffic shifting catches production-only issues before full rollout.

Key concepts in this question

  • Canary deployment: releasing a new version to a small subset, validating, then expanding to the full population.
  • Production-only defects: faults triggered by real user data and load that staging cannot reproduce.
  • Blue-green contrast: two full environments with fast cutover but broad immediate exposure upon switch.
  • Rolling contrast: sequential replacement across instances that still exposes sizable cohorts early without tiny canary control.
  • Recreate contrast: a downtime-inducing redeploy with maximum user impact, opposite of the goal.

Why B is correct

B is correct because canary routing sends a small fraction of live traffic to the new version while most users stay stable. Metrics and errors from that cohort reveal issues affecting few people, allowing rollback or fix before wider exposure. That minimizes both impact severity and affected-user count as the stem demands.

Why the others are wrong

  • A. Blue-green swaps entire environments at once, exposing all users immediately upon cutover.
  • C. Rolling replaces instances progressively but typically moves larger shares faster than a measured canary slice.
  • D. Recreate stops the old version before starting the new, causing downtime for everyone.

PCD exam tip

On PCD, map reduce impact plus few users first to canary, and map instant full swap to blue-green.

10Your company wants to expand their users outside the United States for their popular application. The company wants to ensure 99.999% availability of the database for their application and also wants to minimize the read latency for their users across the globe. Which two actions should they take? (Choose two.)
  • Create a multi-regional Cloud Spanner instance with "nam-asia-eur1" configuration.
  • Create a multi-regional Cloud Spanner instance with "nam3" configuration.
  • Create a cluster with at least 3 Spanner nodes.
  • Create a cluster with at least 1 Spanner node.
  • Create a minimum of two Cloud Spanner instances in separate regions with at least one node.
  • Create a Cloud Dataflow pipeline to replicate data across different databases.
Answer: A, C

The short version

AC — Multi-regional nam-asia-eur1 plus at least three nodes gives global availability. Cross-continental replicas cut read latency while three nodes support five-nines SLA math.

Key concepts in this question

  • Multi-regional Spanner: synchronous replication across continents for survival of regional loss plus nearby reads.
  • nam-asia-eur1 configuration: a three-continent placement covering North America, Asia and Europe for worldwide latency.
  • nam3 limitation: a North-America-only multi-region that cannot minimize latency for users outside the United States.
  • Three-node minimum: the capacity and quorum footprint underpinning 99.999 percent availability for multi-regional instances.
  • Single node or dual instances: insufficient SLA or operational complexity versus one properly sized multi-regional instance.

Why AC is correct

AC is correct because global expansion needs both placement and scale. nam-asia-eur1 puts synchronous replicas near worldwide users for low read latency, while three nodes meet the documented threshold for five-nines multi-regional availability. Together they satisfy high availability plus global performance in the two required actions.

Why the others are wrong

  • B. nam3 keeps replicas in North America only, so global read latency for overseas users remains high.
  • D. One node cannot meet the five-nines multi-regional SLA that three nodes are sized to deliver.
  • E. Two separate regional instances add replication burden without the single multi-regional SLA and latency benefit.
  • F. A Dataflow replication pipeline is custom async copying, not the native Spanner synchronously replicated solution.

PCD exam tip

For PCD global Spanner, pair a three-continent config with three-plus nodes for five-nines plus low latency.

Want the full bank of 338 questions for Professional Cloud Developer (Google Cloud)? See all practice exams.