Sample questions
Google Professional Cloud Developer practice questions
A company is deploying a microservices architecture on GKE. They need to expose a set of related microservices under a single external IP address with path-based routing. Which Kubernetes resource should they use?
Trap 1: Service of type NodePort
Exposes on node IPs, not suitable for external access with path routing.
Trap 2: NetworkPolicy
NetworkPolicy defines firewall rules, not routing.
Trap 3: Service of type LoadBalancer
Creates a separate external IP for each Service.
- A
Service of type NodePort
Why wrong: Exposes on node IPs, not suitable for external access with path routing.
- B
NetworkPolicy
Why wrong: NetworkPolicy defines firewall rules, not routing.
- C
Service of type LoadBalancer
Why wrong: Creates a separate external IP for each Service.
- D
Ingress resource
Ingress provides path-based routing to multiple Services under one IP.
You need to monitor the CPU usage of a Compute Engine instance and trigger an alert when it exceeds 80% for 5 minutes. Which Google Cloud service should you use?
Trap 1: Cloud Debugger
Cloud Debugger is for inspecting code.
Trap 2: Cloud Logging
Cloud Logging is for logs.
Trap 3: Error Reporting
Error Reporting is for application errors.
- A
Cloud Debugger
Why wrong: Cloud Debugger is for inspecting code.
- B
Cloud Monitoring
Cloud Monitoring provides metrics and alerting.
- C
Cloud Logging
Why wrong: Cloud Logging is for logs.
- D
Error Reporting
Why wrong: Error Reporting is for application errors.
Match each Firebase feature to its description.
Drag a concept onto its matching description — or click a concept then click the description.
NoSQL document database with real-time sync
Backend service for user sign-in
Send push notifications across platforms
Change app behavior without publishing updates
Measure app performance from the user's perspective
Drag and drop the steps to create a Cloud Run service in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag and drop the steps to deploy a containerized application to Google Kubernetes Engine (GKE) in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag and drop the steps to set up a Cloud SQL instance with a private IP in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag and drop the steps to configure a Cloud Storage bucket with uniform bucket-level access in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag and drop the steps to set up a Cloud Function triggered by a Cloud Storage event in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag and drop the steps to grant a service account access to a Cloud Storage bucket in the correct order.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
A team is developing a microservice that processes messages from Pub/Sub. The service is deployed on Cloud Run and uses Cloud Firestore to store processed data. During load testing, the service frequently fails with 'DeadlineExceeded' errors from Firestore. What is the most likely cause and best practice to fix it?
Trap 1: Increase the Pub/Sub subscription acknowledgment deadline
This affects message redelivery but not the Cloud Run request timeout.
Trap 2: Enable CPU always allocation for the Cloud Run service
This prevents CPU throttling but does not change the request timeout.
Trap 3: Add retry logic with exponential backoff for Firestore operations
Retry logic helps with transient failures but not with timeouts caused by long operations.
- A
Increase the Cloud Run container instance request timeout
This extends the time a request can run, preventing premature termination.
- B
Increase the Pub/Sub subscription acknowledgment deadline
Why wrong: This affects message redelivery but not the Cloud Run request timeout.
- C
Enable CPU always allocation for the Cloud Run service
Why wrong: This prevents CPU throttling but does not change the request timeout.
- D
Add retry logic with exponential backoff for Firestore operations
Why wrong: Retry logic helps with transient failures but not with timeouts caused by long operations.
A developer notices that a Cloud Function is timing out after 60 seconds. The function makes an external API call that occasionally takes longer than the timeout. What is the best practice to handle this?
Trap 1: Implement retry logic without changing the timeout
Retries without a longer timeout will still fail.
Trap 2: Increase the timeout for all Cloud Functions in the project
Increasing all timeouts is not a best practice and may hide issues.
Trap 3: Decrease the timeout to fail fast and implement retry logic
Decreasing timeout would cause more failures.
- A
Implement retry logic without changing the timeout
Why wrong: Retries without a longer timeout will still fail.
- B
Increase the timeout for all Cloud Functions in the project
Why wrong: Increasing all timeouts is not a best practice and may hide issues.
- C
Increase the timeout for the specific Cloud Function to a higher value
Adjusting the timeout for the specific function allows the external call to complete.
- D
Decrease the timeout to fail fast and implement retry logic
Why wrong: Decreasing timeout would cause more failures.
An application running on GKE is experiencing high latency. The team uses Cloud Trace to identify the bottleneck. They notice that a particular service spends most of its time waiting on a database query. How can they optimize performance?
Trap 1: Decrease the number of pods to reduce load
Reducing pods may increase latency due to less capacity.
Trap 2: Use Cloud CDN to cache database results
Cloud CDN caches static content, not database responses.
Trap 3: Increase the number of replicas for the service
Scaling replicas doesn't speed up slow queries.
- A
Decrease the number of pods to reduce load
Why wrong: Reducing pods may increase latency due to less capacity.
- B
Use Cloud CDN to cache database results
Why wrong: Cloud CDN caches static content, not database responses.
- C
Optimize the database query and add appropriate indexes
Query optimization reduces execution time.
- D
Increase the number of replicas for the service
Why wrong: Scaling replicas doesn't speed up slow queries.
A company uses Cloud Logging to centralize logs from multiple projects. They want to create a log-based metric for tracking 404 errors. However, the metric shows zero data even though 404 errors are occurring. What is the most likely reason?
Trap 1: The metric filter uses the wrong resource type
A wrong filter would cause no matches, but logs exist.
Trap 2: The metric is sampled and not all logs are considered
Log-based metrics use all logs, not sampling.
Trap 3: The logs are not being exported to Cloud Logging
Logs are centralized, so they are being exported.
- A
The metric filter uses the wrong resource type
Why wrong: A wrong filter would cause no matches, but logs exist.
- B
The metric is sampled and not all logs are considered
Why wrong: Log-based metrics use all logs, not sampling.
- C
The logs are not being exported to Cloud Logging
Why wrong: Logs are centralized, so they are being exported.
- D
The logs are being excluded by an exclusion filter before the metric is applied
Exclusion filters remove logs before metric ingestion.
A company uses Cloud Run for a serverless application. They notice that cold starts are causing high latency for some requests. What is the best strategy to reduce cold starts?
Trap 1: Increase the max instances setting
Max instances only limits scaling, doesn't warm up instances.
Trap 2: Migrate the application to Cloud Functions
Cloud Functions also has cold starts.
Trap 3: Reduce the container concurrency setting
Lower concurrency may cause more instances but doesn't prevent cold starts.
- A
Increase the max instances setting
Why wrong: Max instances only limits scaling, doesn't warm up instances.
- B
Set a minimum number of instances to keep containers always warm
Min instances ensures pre-warmed containers are always ready.
- C
Migrate the application to Cloud Functions
Why wrong: Cloud Functions also has cold starts.
- D
Reduce the container concurrency setting
Why wrong: Lower concurrency may cause more instances but doesn't prevent cold starts.
A developer deploys the above app.yaml to App Engine standard environment. The deployment succeeds, but the application fails to connect to the database. What is the most likely reason?
Exhibit
Refer to the exhibit. ``` # app.yaml for App Engine standard environment runtime: python39 entrypoint: gunicorn -b :$PORT main:app env_variables: DATABASE_URL: "postgresql://user:pass@localhost/mydb" ```
Trap 1: The runtime 'python39' is not supported in App Engine standard…
Python 3.9 is a supported runtime.
Trap 2: The $PORT environment variable is not set in App Engine standard…
App Engine sets the PORT environment variable.
Trap 3: The entrypoint command is incorrect because gunicorn is not allowed.
gunicorn is allowed as an entrypoint.
- A
The runtime 'python39' is not supported in App Engine standard environment.
Why wrong: Python 3.9 is a supported runtime.
- B
The $PORT environment variable is not set in App Engine standard environment.
Why wrong: App Engine sets the PORT environment variable.
- C
The application is trying to connect to a local database on localhost, which is not available in the App Engine sandbox.
App Engine standard does not allow connections to localhost; use Cloud SQL.
- D
The entrypoint command is incorrect because gunicorn is not allowed.
Why wrong: gunicorn is allowed as an entrypoint.
Your Cloud Run service is experiencing 5xx errors. You have enabled Cloud Logging and Cloud Error Reporting. How can you quickly identify the most common error type?
Trap 1: Use Cloud Trace to analyze the traces of failing requests.
Trace shows latency, not error details.
Trap 2: View the logs in Cloud Logging and manually count error messages.
Manual counting is time-consuming and error-prone.
Trap 3: Create a Cloud Monitoring alert on 5xx response codes.
Alerts notify of occurrences but do not group errors.
- A
Use Cloud Trace to analyze the traces of failing requests.
Why wrong: Trace shows latency, not error details.
- B
Open Cloud Error Reporting to see grouped error counts.
Error Reporting aggregates and surfaces top errors.
- C
View the logs in Cloud Logging and manually count error messages.
Why wrong: Manual counting is time-consuming and error-prone.
- D
Create a Cloud Monitoring alert on 5xx response codes.
Why wrong: Alerts notify of occurrences but do not group errors.
A team is designing a disaster recovery plan for a critical application on Google Cloud. The application runs on Compute Engine with a regional persistent disk. They want to minimize data loss in case of a regional outage. Which strategy should they use?
Trap 1: Create a snapshot schedule and store snapshots in the same region
Snapshots in the same region would be lost if the region fails.
Trap 2: Use synchronous replication across regions
Synchronous replication across regions is not supported for Compute Engine persistent disks.
Trap 3: Configure a managed instance group with autohealing
Autohealing does not protect against regional failures; it only recreates instances in the same region.
- A
Use persistent disk snapshot replication to another region
Snapshot replication to another region provides off-site backups that can be used to restore the application in a different region.
- B
Create a snapshot schedule and store snapshots in the same region
Why wrong: Snapshots in the same region would be lost if the region fails.
- C
Use synchronous replication across regions
Why wrong: Synchronous replication across regions is not supported for Compute Engine persistent disks.
- D
Configure a managed instance group with autohealing
Why wrong: Autohealing does not protect against regional failures; it only recreates instances in the same region.
An organization is migrating a critical application to Google Cloud and needs to ensure high availability and disaster recovery. The application runs on Compute Engine and uses a stateful database. Which three design choices should they make? (Choose three.)
Trap 1: Use preemptible VMs to reduce costs for the database layer.
Preemptible VMs can be terminated at any time, not suitable for stateful workloads.
Trap 2: Deploy all instances in a single zone and use snapshots for backup.
Single zone is a single point of failure.
- A
Use managed instance groups distributed across multiple zones.
MIGs across zones provide auto-healing and high availability.
- B
Use regional persistent disks for the database.
Regional persistent disks synchronously replicate data across zones.
- C
Use a global load balancer to route traffic to the closest healthy region.
Global load balancer provides traffic distribution and failover across regions.
- D
Use preemptible VMs to reduce costs for the database layer.
Why wrong: Preemptible VMs can be terminated at any time, not suitable for stateful workloads.
- E
Deploy all instances in a single zone and use snapshots for backup.
Why wrong: Single zone is a single point of failure.
A company is designing a global e-commerce platform on Google Cloud. The application requires low-latency access for users worldwide and must be highly available. Which load balancing solution should they use?
Trap 1: External TCP/UDP Network Load Balancer
External TCP/UDP Network Load Balancer is regional and does not support global traffic distribution.
Trap 2: Cloud CDN
Cloud CDN is a content delivery network, not a load balancer. It caches content at edge locations but does not route traffic.
Trap 3: Internal TCP/UDP Load Balancer
Internal load balancers are used for internal traffic, not for global user-facing applications.
- A
External TCP/UDP Network Load Balancer
Why wrong: External TCP/UDP Network Load Balancer is regional and does not support global traffic distribution.
- B
External HTTP(S) Load Balancer
External HTTP(S) Load Balancer is a global load balancer that provides low latency and high availability for web applications.
- C
Cloud CDN
Why wrong: Cloud CDN is a content delivery network, not a load balancer. It caches content at edge locations but does not route traffic.
- D
Internal TCP/UDP Load Balancer
Why wrong: Internal load balancers are used for internal traffic, not for global user-facing applications.
Match each Kubernetes resource to its function.
Drag a concept onto its matching description — or click a concept then click the description.
Declares desired state for pods and ReplicaSets
Stable network endpoint to access pods
HTTP(S) load balancer for external access
Store non-sensitive configuration data
Store sensitive data like passwords or keys
A team is migrating a monolithic application to a microservices architecture on Google Kubernetes Engine (GKE). They want to ensure that failures in one microservice do not cascade to others. Which design pattern should they implement?
Trap 1: Implement retry logic with exponential backoff for all…
Retries can exacerbate failures if the downstream service is overloaded.
Trap 2: Use synchronous HTTP calls with timeouts to detect failures quickly.
Synchronous calls can still cascade failures if not combined with circuit breakers.
Trap 3: Use bulkheads to separate thread pools for each service.
Bulkheads limit resource contention but do not prevent cascading failures.
- A
Implement retry logic with exponential backoff for all inter-service calls.
Why wrong: Retries can exacerbate failures if the downstream service is overloaded.
- B
Implement a circuit breaker pattern that opens when failure thresholds are exceeded.
Circuit breaker fails fast and prevents unnecessary load on failing services.
- C
Use synchronous HTTP calls with timeouts to detect failures quickly.
Why wrong: Synchronous calls can still cascade failures if not combined with circuit breakers.
- D
Use bulkheads to separate thread pools for each service.
Why wrong: Bulkheads limit resource contention but do not prevent cascading failures.
A developer runs the command shown in the exhibit. They need to ensure that the application running on instance-3 can be restored quickly if it fails. What should they do?
Exhibit
Refer to the exhibit. gcloud compute instances list --format='table(name, zone, status, machineType, scheduling.preemptible)' NAME ZONE STATUS MACHINE_TYPE PREEMPTIBLE instance-1 us-central1-a RUNNING n1-standard-1 false instance-2 us-central1-b RUNNING n1-standard-2 false instance-3 us-central1-a TERMINATED n1-standard-1 false instance-4 us-central1-c RUNNING n1-standard-1 true
Trap 1: Add instance-3 to an unmanaged instance group.
Unmanaged instance groups do not provide auto-healing.
Trap 2: Configure Cloud DNS with a health check pointing to instance-3.
DNS does not manage instance health or recreation.
Trap 3: Take a snapshot of instance-3's disk and use it to create a new…
Manual restore is slower than auto-healing.
- A
Add instance-3 to an unmanaged instance group.
Why wrong: Unmanaged instance groups do not provide auto-healing.
- B
Configure Cloud DNS with a health check pointing to instance-3.
Why wrong: DNS does not manage instance health or recreation.
- C
Create a managed instance group using an instance template based on instance-3's boot disk.
Managed instance groups automatically recreate failed instances.
- D
Take a snapshot of instance-3's disk and use it to create a new instance manually.
Why wrong: Manual restore is slower than auto-healing.
A company running a high-traffic e-commerce platform on Google Cloud experiences occasional data loss in their Cloud SQL database during failover events. The database is configured with a failover replica in a different zone. What is the most likely cause of the data loss?
Trap 1: Automated backups are not enabled.
Backups are separate from failover replication.
Trap 2: The failover replica is configured as a read replica instead of a…
Read replicas cannot be promoted during failover.
Trap 3: The database is not using regional persistent disks.
Regional persistent disks provide durability but not synchronous replication between zones.
- A
Automated backups are not enabled.
Why wrong: Backups are separate from failover replication.
- B
The database is using asynchronous replication to the failover replica.
Asynchronous replication may not have replicated the most recent transactions before failover.
- C
The failover replica is configured as a read replica instead of a failover replica.
Why wrong: Read replicas cannot be promoted during failover.
- D
The database is not using regional persistent disks.
Why wrong: Regional persistent disks provide durability but not synchronous replication between zones.
A team is designing a globally distributed application on Google Cloud that requires strong consistency for writes but can tolerate eventual consistency for reads. The application expects millions of concurrent users. Which two strategies should they implement? (Choose two.)
Trap 1: Use Firestore in multi-region mode for all operations.
Firestore multi-region provides strong consistency but not optimized for global writes with low latency.
Trap 2: Deploy Cloud SQL with cross-region replication for read scalability.
Cross-region replication is asynchronous, leading to eventual consistency.
Trap 3: Use Cloud Bigtable for reading data with strong consistency.
Bigtable does not provide strong consistency for reads.
- A
Use Cloud Spanner for write operations requiring strong consistency.
Spanner provides global strong consistency and high availability.
- B
Use Firestore in multi-region mode for all operations.
Why wrong: Firestore multi-region provides strong consistency but not optimized for global writes with low latency.
- C
Use global HTTP(S) Load Balancer with Cloud CDN for read-heavy traffic.
Cloud CDN caches content globally, providing low-latency reads with eventual consistency.
- D
Deploy Cloud SQL with cross-region replication for read scalability.
Why wrong: Cross-region replication is asynchronous, leading to eventual consistency.
- E
Use Cloud Bigtable for reading data with strong consistency.
Why wrong: Bigtable does not provide strong consistency for reads.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.