GPCDE
Free GPCDE practice questions
10 questions from our GPCDE practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, Establishing and bootstrapping foundational infrastructure and organizational governance
A company runs production GKE Standard clusters and must stay on supported versions with minimal disruption. Upgrades must not occur during the Black Friday week, and node upgrades should never take more than one node out of service at a time per pool. What should you configure?
- APin the control plane version with a no-channel configuration and recreate each cluster from scratch with Terraform when a version reaches end of support
- BEnroll the clusters in the Rapid release channel so upgrades happen early in the year, well before Black Friday, and rely on default upgrade settings
- CEnroll the clusters in the Stable release channel with maintenance windows, a Black Friday maintenance exclusion, and surge upgrades with maxUnavailable 0 Correct answer
- DDisable auto-upgrade on all clusters and node pools and upgrade manually once a year after the holiday season using blue-green node pool upgrades
Answer and explanation: A release channel keeps versions supported, maintenance windows and exclusions control when automatic upgrades happen, and surge settings such as maxSurge 1 with maxUnavailable 0 avoid taking existing nodes out of service before replacements are ready. Disabling auto-upgrade and upgrading yearly risks running unsupported versions. The Rapid channel gets the newest versions with the most change and offers no protection for the holiday week. Recreating clusters at end of support is disruptive and operationally heavy.
Question 2 of 10, Establishing and bootstrapping foundational infrastructure and organizational governance
Your organization requires that no Compute Engine VM in any project receives an external IP address, except in a single project that hosts bastion hosts for a legacy vendor. You want the control to be enforced automatically for new projects. What should you do?
- ARemove the roles/compute.instanceAdmin.v1 role from all developers at the organization level and grant it only to the bastion team on the bastion project
- BCreate a hierarchical firewall policy at the organization node that denies all ingress from 0.0.0.0/0 and add a higher-priority allow rule scoped to the bastion project's VPC
- CWrite a Cloud Asset Inventory feed that publishes VM creation events to Pub/Sub and a Cloud Run function that deletes any external IP assigned outside the bastion project
- DEnforce the compute.vmExternalIpAccess constraint at the organization node to deny all, and override it on the bastion project to allow only the bastion VMs Correct answer
Answer and explanation: The compute.vmExternalIpAccess organization policy constraint prevents external IPs from being assigned and is inherited by every new project, and a project-level policy can allow the specific bastion instances. A hierarchical firewall rule blocks traffic but does not stop external IP assignment. Removing an admin role stops all VM management rather than external IPs specifically. An Asset Inventory feed with a cleanup function is reactive and leaves a window where external IPs exist.
Question 3 of 10, Building, implementing, and maintaining CI/CD pipelines for application, infrastructure, and ML workloads
Developers complain that Cloud Build runs for a large Java monorepo take 25 minutes because Maven downloads dependencies on every build. You want to reduce build time without changing the build tool. What should you do?
- AIncrease the Cloud Build machine type to E2_HIGHCPU_32 so that dependency downloads run with more parallel network threads and compilation also finishes faster
- BUse an Artifact Registry Maven remote repository as a caching proxy for Maven Central and point the build's settings.xml at it Correct answer
- CSplit the build into one Cloud Build trigger per Maven module so that each trigger runs in parallel on its own worker
- DMove the build to a private pool in the same region as the repository so network latency to Maven Central decreases
Answer and explanation: An Artifact Registry remote repository caches upstream Maven artifacts close to the build workers, so repeated dependency fetches are fast and also more resilient to upstream outages. A larger machine helps CPU-bound compilation, not repeated downloads from the internet. A private pool changes the network location but still fetches everything from Maven Central each run. Splitting triggers per module adds orchestration overhead and each trigger still downloads its dependencies.
Question 4 of 10, Building, implementing, and maintaining CI/CD pipelines for application, infrastructure, and ML workloads
A company wants to release a new checkout flow to 5% of Cloud Run traffic, observe error rates for an hour, and then shift the rest of the traffic, with the ability to return instantly to the previous behavior. Which approach uses built-in Cloud Run functionality with the LEAST operational overhead?
- ADeploy the new revision with 100% traffic and keep a second region on the old revision as a fallback through DNS failover
- BDeploy the new revision with 100% traffic and add a feature flag in code that randomly enables the checkout for 5% of requests
- CDeploy the new version as a separate Cloud Run service and use a global external Application Load Balancer URL map with weighted backends
- DDeploy the new revision with --no-traffic, then use gcloud run services update-traffic to send 5% to it and later 100% Correct answer
Answer and explanation: Cloud Run revisions support traffic splitting natively: deploying with no traffic and then assigning percentages provides a canary with instant rollback by moving traffic back to the old revision. A second service behind a load balancer works but adds configuration overhead. Sending all traffic to the new revision and failing over by DNS exposes every user and rolls back slowly. A random in-code flag requires a code change and a redeploy to adjust or roll back.
Question 5 of 10, Building, implementing, and maintaining CI/CD pipelines for application, infrastructure, and ML workloads
A GKE workload must read secrets from Secret Manager at runtime. Security forbids node service account permissions for workloads and any Kubernetes Secret objects containing the values. What should you implement?
- AEnable Workload Identity Federation for GKE, grant Secret Accessor to the Kubernetes service account's principal, and use the client library Correct answer
- BStore a service account key in a ConfigMap and have the application use it to authenticate to Secret Manager when the pod starts
- CGrant the node pool's service account the Secret Accessor role and let pods use the metadata server credentials to read the secrets
- DSync the secrets into Kubernetes Secret objects with a CronJob every hour and mount them into the application pods as environment variables at container startup
Answer and explanation: Workload Identity Federation for GKE lets IAM grant permissions directly to a Kubernetes service account principal, so only that workload can read the secret, without node permissions or Kubernetes Secrets. Node service account grants apply to every pod on the node. Syncing into Kubernetes Secrets violates the requirement. A key in a ConfigMap is a long-lived credential stored in plain text.
Question 6 of 10, Applying site reliability engineering practices
A video platform defines a latency SLI for its playback API. Users are frustrated mainly when starting playback takes longer than 400 ms, and the team wants an SLI that is easy to turn into an error budget. Which SLI definition is MOST appropriate?
- AThe maximum latency observed for any playback-start request in each hour, measured at the client
- BThe 99th percentile CPU utilization of the playback backend pods, measured by GKE system metrics
- CThe proportion of valid playback-start requests served in under 400 ms, measured at the load balancer Correct answer
- DThe average latency of playback-start requests over five-minute windows, measured by each backend instance
Answer and explanation: A good-events-over-valid-events ratio with a threshold that reflects user pain maps directly to an SLO and error budget, and measuring at the load balancer captures what users experience from the service. Averages hide tail latency and per-instance measurement misses queuing in front of instances. CPU utilization is a cause-oriented resource metric, not a user-facing SLI. A per-hour maximum is dominated by a single outlier and cannot be expressed as a budget.
Question 7 of 10, Applying site reliability engineering practices
A team's service has exhausted its error budget for the current window after two bad releases. According to SRE practice and the team's agreed error budget policy, what should happen next?
- AFreeze feature releases other than reliability and security fixes until the service is back within its SLO Correct answer
- BLower the SLO target permanently so that the current reliability level becomes the new objective
- CContinue releasing features but require two reviewers per change, since the error budget only informs dashboards
- DRaise the SLO target so that the service has more room for failures during the remainder of the window
Answer and explanation: An error budget policy typically halts feature launches and redirects engineering effort to reliability once the budget is spent, which balances velocity with reliability. Raising the SLO shrinks the budget rather than giving more room. Treating the budget as informational defeats its purpose of governing release velocity. Permanently lowering the SLO because of two bad releases ignores user expectations and should only follow a deliberate review.
Question 8 of 10, Implementing observability practices and troubleshooting issues
A GKE service writes structured JSON logs. Engineers want to jump from a slow trace in Cloud Trace directly to the log entries written while handling that request. What must the application do?
- AWrite the trace ID and span ID into the logging.googleapis.com/trace and logging.googleapis.com/spanId fields of each structured log entry Correct answer
- BWrite the trace ID into a custom label named traceId and create a log-based metric that groups entries by that label
- CWrite each log entry to a separate log name that matches the trace ID so that Logs Explorer can filter by log name
- DSend log entries to Cloud Trace as span events and disable Cloud Logging for the service to avoid duplicate data
Answer and explanation: When structured logs populate the special trace and spanId fields with the full trace resource name and span, Cloud Logging and Cloud Trace correlate them so engineers can navigate between a trace and its logs. A custom label is not recognized for correlation. One log name per trace explodes the number of logs and is not how correlation works. Replacing logs with span events loses logs needed for other analysis.
Question 9 of 10, Implementing observability practices and troubleshooting issues
You need an alert when the HTTP 5xx error ratio of a Cloud Run service exceeds 2% for 10 minutes, and the on-call engineers use PagerDuty. What should you configure?
- AA Cloud Monitoring uptime check against the service URL with a PagerDuty notification channel and a 10-minute check interval
- BA Cloud Monitoring alerting policy with a ratio condition on request_count filtered by response_code_class, a 10-minute duration, and a PagerDuty notification channel Correct answer
- CA dashboard chart of request_count by response code shared with the on-call team and a PagerDuty schedule that reviews it hourly
- DA log-based counter metric for every request and a Cloud Scheduler job that compares counts and emails PagerDuty's inbound address
Answer and explanation: An alerting policy can compute the ratio of 5xx requests to all requests from the built-in Cloud Run request_count metric, require it to persist for 10 minutes, and notify through a native PagerDuty channel. A scheduled comparison job is custom and fragile. Uptime checks probe availability from outside and do not measure the error ratio of real traffic. A dashboard reviewed hourly is not alerting.
Question 10 of 10, Optimizing performance and cost
A Cloud Run API receives bursts of traffic during the day and almost nothing overnight. The service does no work outside of request handling. Which configuration keeps cost LOWEST while still serving all requests?
- AUse request-based billing, and set minimum instances to the daytime peak so that no request waits for an instance
- BUse request-based billing so CPU is allocated only during request processing, and keep minimum instances at zero Correct answer
- CUse instance-based billing with concurrency set to 1 so each instance is fully utilized while it is running
- DUse instance-based billing so CPU is always allocated, and set minimum instances to the daytime peak count
Answer and explanation: With request-based billing you pay for CPU only while requests are processed, and zero minimum instances lets the service scale to zero overnight. Instance-based billing at peak count pays for idle capacity all night. Keeping peak minimum instances also pays for idle instances. Concurrency 1 increases the number of instances and cost.