Sign in
Home/Google Cloud/Professional Cloud DevOps Engineer (Google Cloud)/Free questions

Professional Cloud DevOps Engineer (Google Cloud) — Free Practice Questions

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

1You support a Node.js application running on Google Kubernetes Engine (GKE) in production. The application makes several HTTP requests to dependent applications. You want to anticipate which dependent applications might cause performance issues. What should you do?
  • Instrument all applications with Stackdriver Profiler.
  • Instrument all applications with Stackdriver Trace and review inter-service HTTP requests.
  • Use Stackdriver Debugger to review the execution of logic within each application to instrument all applications.
  • Modify the Node.js application to log HTTP request and response times to dependent applications. Use Stackdriver Logging to find dependent applications that are performing poorly.
Answer: B

The short version

B — Instrument with Trace to see inter-service HTTP latency. Anticipating which dependent app will hurt Node.js performance on GKE requires request-scoped timing across hops, not CPU profiles, debugger stepping, or manual log math.

Key concepts in this question

  • Stackdriver Trace: Distributed tracing that follows HTTP requests between services and breaks total latency into per-dependency spans for direct comparison.
  • Profiler scope: Stackdriver Profiler finds CPU and memory hotspots inside one service, useful for code efficiency but blind to which downstream call is slow.
  • Debugger scope: Stackdriver Debugger inspects live state and logic paths, helpful for correctness, not for systematic latency forecasting across dependencies.
  • Log-derived timing: Custom request logging plus manual aggregation can hint at slowness but lacks sampling, visualization, and consistent correlation at scale.

Why B is correct

B captures every outbound HTTP call as a timed span linked to the inbound request, revealing average and tail latency per dependent under real production patterns. Reviewing those traces highlights the riskiest downstream before it breaches SLOs, guiding timeouts, caching, or capacity work. It is the proactive, Google-recommended lens for performance anticipation in microservice graphs.

Why the others are wrong

  • A. Profiler with Stackdriver Profiler optimizes in-process CPU, not downstream HTTP time.
  • C. Debugger review of logic execution aids bug diagnosis, not latency attribution.
  • D. Manual timing logs in Stackdriver Logging need custom code and lack trace correlation and scale.

PCDE exam tip

To find which dependency slows requests, choose Trace for inter-service timing, not Profiler or Debugger.

2You created a Stackdriver chart for CPU utilization in a dashboard within your workspace project. You want to share the chart with your Site Reliability Engineering (SRE) team only. You want to ensure you follow the principle of least privilege. What should you do?
  • Share the workspace Project ID with the SRE team. Assign the SRE team the Monitoring Viewer IAM role in the workspace project.
  • Share the workspace Project ID with the SRE team. Assign the SRE team the Dashboard Viewer IAM role in the workspace project.
  • Click ג€Share chart by URLג€ and provide the URL to the SRE team. Assign the SRE team the Monitoring Viewer IAM role in the workspace project.
  • Click ג€Share chart by URLג€ and provide the URL to the SRE team. Assign the SRE team the Dashboard Viewer IAM role in the workspace project.
Answer: C

The short version

C — Share by URL plus Monitoring Viewer gives least-privilege chart access. The SRE team needs to view one CPU chart without broader dashboard control, so direct chart link plus read-only monitoring role is the minimal grant that works.

Key concepts in this question

  • Share chart by URL: Generates a scoped link to a single chart for targeted collaboration, avoiding exposure of full dashboards or workspace configuration.
  • Monitoring Viewer role: Read-only access to metrics, charts, and dashboards without permission to create alert policies or modify monitoring setup.
  • Least privilege: Granting only the Identity and Access Management capability needed for the task, reducing accidental change and data exposure.
  • Project versus URL sharing: Sharing the whole workspace Project ID invites wider navigation and management, while URL sharing narrows the entry point to the needed artifact.

Why C is correct

C combines narrow discovery through the chart URL with the minimal viewer grant required to render Stackdriver data, so SRE members see current CPU utilization but cannot alter workspace resources. It avoids over-permissioned dashboard administration while still working across the workspace boundary. That balance is exactly what least privilege demands for single-chart sharing.

Why the others are wrong

  • A. Sharing Project ID with Monitoring Viewer exposes the whole workspace scope, broader than needed.
  • B. Sharing Project ID with Dashboard Viewer is still workspace-wide discovery plus limited but mismatched scope.
  • D. URL plus Dashboard Viewer narrows discovery yet grants dashboard-centric access rather than the monitoring read pattern for charts.

PCDE exam tip

For one-chart sharing with least privilege, pick share-by-URL plus Monitoring Viewer.

3Your organization wants to implement Site Reliability Engineering (SRE) culture and principles. Recently, a service that you support had a limited outage. A manager on another team asks you to provide a formal explanation of what happened so they can action remediations. What should you do?
  • Develop a postmortem that includes the root causes, resolution, lessons learned, and a prioritized list of action items. Share it with the manager only.
  • Develop a postmortem that includes the root causes, resolution, lessons learned, and a prioritized list of action items. Share it on the engineering organization's document portal.
  • Develop a postmortem that includes the root causes, resolution, lessons learned, the list of people responsible, and a list of action items for each person. Share it with the manager only.
  • Develop a postmortem that includes the root causes, resolution, lessons learned, the list of people responsible, and a list of action items for each person. Share it on the engineering organization's document portal.
Answer: B

The short version

B — Write a blameless postmortem with causes and actions and share it broadly. SRE culture treats outages as learning for the whole engineering org, so the formal explanation must be systemic, forward-looking, and visible beyond one manager, without naming responsible people.

Key concepts in this question

  • SRE postmortem: A record of timeline, root causes, resolution, lessons learned, and prioritized actions that prevents repeat failure and spreads knowledge.
  • Blameless content: Focus on what and why in systems and process, explicitly excluding lists of responsible individuals that chill honesty and collaboration.
  • Broad sharing: Publishing on the engineering portal lets other teams adopt fixes, update runbooks, and avoid the same outage pattern in their services.
  • Manager-only trap: Restricting to one requester satisfies the immediate ask but loses org-wide prevention value central to SRE adoption.

Why B is correct

B delivers the complete learning package the manager requested while also serving future reliability through visible, prioritized remediation owned across teams. Open publication invites review, reuse, and accountability for action completion without finger-pointing. That embodies SRE culture far better than private or blame-laden variants.

Why the others are wrong

  • A. Full postmortem shared only with the manager limits org learning and reuse.
  • C. Adding people responsible and sharing narrowly introduces blame and hides lessons.
  • D. Blame-oriented content shared broadly amplifies harm while still missing collaborative improvement.

PCDE exam tip

For SRE postmortem culture, choose blameless plus broadly shared with prioritized actions.

4You have a set of applications running on a Google Kubernetes Engine (GKE) cluster, and you are using Stackdriver Kubernetes Engine Monitoring. You are bringing a new containerized application required by your company into production. This application is written by a third party and cannot be modified or reconfigured. The application writes its log information to /var/log/app_messages.log, and you want to send these log entries to Stackdriver Logging. What should you do?
  • Use the default Stackdriver Kubernetes Engine Monitoring agent configuration.
  • Deploy a Fluentd daemonset to GKE. Then create a customized input and output configuration to tail the log file in the application's pods and write to Stackdriver Logging.
  • Install Kubernetes on Google Compute Engine (GCE) and redeploy your applications. Then customize the built-in Stackdriver Logging configuration to tail the log file in the application's pods and write to Stackdriver Logging.
  • Write a script to tail the log file within the pod and write entries to standard output. Run the script as a sidecar container with the application's pod. Configure a shared volume between the containers to allow the script to have read access to /var/log in the application container.
Answer: D

The short version

D — Tail the file with a sidecar to stdout and share via volume. An unmodifiable third-party container writing to a custom path cannot use default collection, so a companion container that forwards that file to standard output lets Kubernetes logging pick it up cleanly.

Key concepts in this question

  • Kubernetes logging model: The kubelet and default agents collect container stdout and stderr automatically, making stdout the portable path to Stackdriver Logging.
  • Sidecar pattern: A helper container in the same pod that shares a volume, runs tail logic, and emits lines to its own stdout without touching third-party code.
  • Shared volume: A pod-level volume mounted into both containers giving the sidecar read access to the exact log path while the app keeps writing normally.
  • DaemonSet and reinstall traps: Custom Fluentd inputs per node add fleet complexity, and moving to Compute Engine Kubernetes just for logs is disproportionate and disruptive.

Why D is correct

D leaves the vendor image untouched yet bridges its custom file to the platform standard, so Stackdriver receives structured entries with pod metadata and no agent fork. The script is small, scoped to the affected workload, and survives restarts with the pod lifecycle. That is the least-invasive production-safe route for third-party log forwarding on GKE.

Why the others are wrong

  • A. Default Stackdriver GKE agent config collects stdout, not arbitrary custom file paths.
  • B. Fluentd DaemonSet with custom input and output adds node-wide complexity for one app.
  • C. Installing Kubernetes on Compute Engine and redeploying is heavyweight and unnecessary for log tailing.

PCDE exam tip

Third-party log to custom file on GKE means sidecar tail to stdout with shared volume.

5You are running an application in a virtual machine (VM) using a custom Debian image. The image has the Stackdriver Logging agent installed. The VM has the cloud-platform scope. The application is logging information via syslog. You want to use Stackdriver Logging in the Google Cloud Platform Console to visualize the logs. You notice that syslog is not showing up in the "All logs" dropdown list of the Logs Viewer. What is the first thing you should do?
  • Look for the agentג€™s test log entry in the Logs Viewer.
  • Install the most recent version of the Stackdriver agent.
  • Verify the VM service account access scope includes the monitoring.write scope.
  • SSH to the VM and execute the following commands on your VM: ps ax | grep fluentd.
Answer: D

The short version

D — First check whether the logging agent is even running on the VM. Missing syslog in Logs Viewer with a custom image and cloud-platform scope most often means fluentd never started, so process verification precedes version, scope, or test-log hunts.

Key concepts in this question

  • Logging agent pipeline: The Stackdriver agent based on fluentd must be alive to tail syslog and forward to Cloud Logging, regardless of scopes or console filters.
  • Custom image risk: Hand-built Debian images may omit autostart, have broken config, or fail upgrades, making runtime presence the first uncertainty to resolve.
  • Least-effort triage: A single SSH process check answers liveness in seconds before deeper permission or viewer troubleshooting.
  • Scope and log-lookup limits: Broad cloud-platform scope already covers ingestion, and searching for test entries helps only after collection is proven active.

Why D is correct

D directly validates the prerequisite for any log flow, distinguishing a dead or crashed agent from console, filter, or permission issues. If fluentd is absent, restart and log inspection follow, while if present, investigation moves to config and API errors with evidence. That ordered approach reflects Google-recommended first-step diagnostics for missing logs.

Why the others are wrong

  • A. Looking for the test log entry assumes collection works, which is exactly what is unproven.
  • B. Installing the newest agent version is premature without knowing whether any agent runs.
  • C. Verifying monitoring.write scope is low yield because cloud-platform scope already includes it.

PCDE exam tip

When logs are missing from a VM, first prove fluentd is running with ps and grep.

6You use a multiple step Cloud Build pipeline to build and deploy your application to Google Kubernetes Engine (GKE). You want to integrate with a third-party monitoring platform by performing a HTTP POST of the build information to a webhook. You want to minimize the development effort. What should you do?
  • Add logic to each Cloud Build step to HTTP POST the build information to a webhook.
  • Add a new step at the end of the pipeline in Cloud Build to HTTP POST the build information to a webhook.
  • Use Stackdriver Logging to create a logs-based metric from the Cloud Build logs. Create an Alert with a Webhook notification type.
  • Create a Cloud Pub/Sub push subscription to the Cloud Build cloud-builds PubSub topic to HTTP POST the build information to a webhook.
Answer: D

The short version

D — Subscribe to the cloud-builds PubSub topic with a push to the webhook. Multi-step GKE pipeline notifications need event-driven delivery without per-step code, which native Cloud Build PubSub messages plus push subscription provide with least effort.

Key concepts in this question

  • Cloud Build notifications: Each build publishes status messages to the cloud-builds PubSub topic, giving a central event source for all steps and outcomes.
  • Push subscription: A PubSub subscription that HTTP POSTs each message to a configured webhook endpoint automatically with retries and auth options.
  • Per-step logic cost: Adding POST code to every step duplicates effort, risks drift, and complicates pipeline YAML for a cross-cutting concern.
  • Logs-metric indirection: Building metrics plus alert webhooks can work but adds metric, alert, and notification layers for a simple build-event forward.

Why D is correct

D requires no pipeline code changes and captures every build uniformly, forwarding build information to the third-party monitor as soon as PubSub receives it. Push delivery handles batching, retries, and endpoint config outside the build definition, minimizing development and maintenance. That matches the minimize-effort integration goal cleanly.

Why the others are wrong

  • A. Logic in each Cloud Build step to POST duplicates code and increases upkeep.
  • B. A final POST step still customizes the pipeline and misses builds that fail before it.
  • C. Logs-based metric plus alert webhook adds extra metric and alert objects for simple forwarding.

PCDE exam tip

To POST build info to a webhook cheaply, use cloud-builds PubSub push subscription.

7You use Spinnaker to deploy your application and have created a canary deployment stage in the pipeline. Your application has an in-memory cache that loads objects at start time. You want to automate the comparison of the canary version against the production version. How should you configure the canary analysis?
  • Compare the canary with a new deployment of the current production version.
  • Compare the canary with a new deployment of the previous production version.
  • Compare the canary with the existing deployment of the current production version.
  • Compare the canary with the average performance of a sliding window of previous production versions.
Answer: A

The short version

A — Compare canary against a fresh deploy of current production. In-memory caches that warm at startup make long-running prod look artificially fast, so only a similarly fresh baseline gives a fair automated canary judgment in Spinnaker.

Key concepts in this question

  • Canary analysis: Automated statistical comparison of key metrics between baseline and canary to decide promotion, requiring equivalent starting conditions.
  • Cold-start bias: New processes with empty caches show higher latency and miss rates until warm, while mature instances benefit from populated memory.
  • Fresh-versus-existing trap: Measuring a new canary against old warm prod confounds version effects with cache warmth, causing false negatives for good releases.
  • Spinnaker stages: The canary stage can spin parallel baseline and canary stacks, making a clean paired deployment practical without manual work.

Why A is correct

A equalizes age and cache state so observed differences reflect code and config rather than uptime, letting the analysis trust latency, error, and throughput deltas. It avoids penalizing the canary for expected warm-up while still using production-like traffic shaping. That yields reliable automation for cache-heavy services.

Why the others are wrong

  • B. A fresh previous production version tests the wrong baseline and ignores current prod behavior.
  • C. Existing current production is warm and unfairly favors the baseline over a cold canary.
  • D. Average of a sliding window of past versions blurs the current comparison with stale history.

PCDE exam tip

With warm-up caches, always canary against a new deploy of current prod, not old prod.

8You support a high-traffic web application and want to ensure that the home page loads in a timely manner. As a first step, you decide to implement a Service Level Indicator (SLI) to represent home page request latency with an acceptable page load time set to 100 ms. What is the Google-recommended way of calculating this SLI?
  • Bucketize the request latencies into ranges, and then compute the percentile at 100 ms.
  • Bucketize the request latencies into ranges, and then compute the median and 90th percentiles.
  • Count the number of home page requests that load in under 100 ms, and then divide by the total number of home page requests.
  • Count the number of home page request that load in under 100 ms, and then divide by the total number of all web application requests.
Answer: C

The short version

C — Google SLI for latency is good requests under threshold over total requests. For a 100 ms home-page goal, count fast loads divided by all home-page loads, not percentiles or medians, to get a valid proportion for objectives and error budgets.

Key concepts in this question

  • SLI as proportion: Google SRE recommends expressing latency compliance as share of good events over valid total events, enabling SLO math and burn alerting.
  • Threshold SLI: Under 100 ms defines good versus bad per request, turning each page load into a binary success that aggregates cleanly over windows.
  • Percentile misuse: Reporting a percentile value or median describes distribution shape but does not directly yield the good-over-total ratio needed for budgeting.
  • Scope correctness: Denominator must be home-page requests only, so unrelated app traffic cannot dilute or inflate the page-specific experience.

Why C is correct

C implements the canonical latency SLI by classifying each home-page request against the 100 ms target and dividing, producing a number that maps straight to an SLO such as 99 percent fast. It supports error budgets, trend comparison, and alerting without extra statistical translation. That is why Google guidance prefers counting over bucket percentile reporting for this case.

Why the others are wrong

  • A. Computing a percentile at 100 ms reports distribution position, not good-over-total share.
  • B. Median and 90th percentiles summarize shape but do not form an SLI proportion.
  • D. Dividing by all web app requests mixes unrelated traffic into a page-specific indicator.

PCDE exam tip

For latency SLI with a time target, count under-threshold over page total.

9You deploy a new release of an internal application during a weekend maintenance window when there is minimal user tragic. After the window ends, you learn that one of the new features isn't working as expected in the production environment. After an extended outage, you roll back the new release and deploy a fix. You want to modify your release process to reduce the mean time to recovery so you can avoid extended outages in the future. What should you do? (Choose two.)
  • Before merging new code, require 2 different peers to review the code changes.
  • Adopt the blue/green deployment strategy when releasing new code via a CD server.
  • Integrate a code linting tool to validate coding standards before any code is accepted into the repository.
  • Require developers to run automated integration tests on their local development environments before release.
  • Configure a CI server. Add a suite of unit tests to your code and have your CI server run them on commit and verify any changes.
Answer: B, E

The short version

BE — Cut recovery time with blue-green plus commit-time unit tests in CI. Extended outage after a weekend release calls for instant traffic revert plus earlier defect capture, not heavier reviews, lint, or local-only testing.

Key concepts in this question

  • Mean time to recovery: How fast service restores after failure, improved by keeping a warm prior version ready for immediate switchback via CD.
  • Blue-green releases: Parallel stacks where the new version is promoted by routing and the old stays for fast fallback, avoiding long rebuilds after production surprises.
  • CI unit tests on commit: Fast automated checks that run centrally on every commit, catching regressions before they reach weekend maintenance windows.
  • Weak substitutes: Peer counts, lint rules, and local integration runs may help quality but do not guarantee fast restore or consistent pre-merge validation.

Why BE is correct

B gives the operational lever to end the next outage in minutes by flipping back to the known-good environment instead of rolling back through a broken deploy. E gives the preventive lever by proving code on every commit in a shared server, reducing the chance a bad feature reaches production at all. Together they address both recovery speed and defect injection for future releases.

Why the others are wrong

  • A. Requiring two peer reviews improves scrutiny but does not enable instant recovery.
  • C. Code linting enforces style, not runtime correctness or fast rollback.
  • D. Local integration tests depend on developer machines and skip consistent central gating.

PCDE exam tip

To lower MTTR after a bad release, pick blue-green plus CI unit tests on commit.

10You have a pool of application servers running on Compute Engine. You need to provide a secure solution that requires the least amount of configuration and allows developers to easily access application logs for troubleshooting. How would you implement the solution on GCP?
  • ג€¢ Deploy the Stackdriver logging agent to the application servers. ג€¢ Give the developers the IAM Logs Viewer role to access Stackdriver and view logs.
  • ג€¢ Deploy the Stackdriver logging agent to the application servers. ג€¢ Give the developers the IAM Logs Private Logs Viewer role to access Stackdriver and view logs.
  • ג€¢ Deploy the Stackdriver monitoring agent to the application servers. ג€¢ Give the developers the IAM Monitoring Viewer role to access Stackdriver and view metrics.
  • ג€¢ Install the gsutil command line tool on your application servers. ג€¢ Write a script using gsutil to upload your application log to a Cloud Storage bucket, and then schedule it to run via cron every 5 minutes. ג€¢ Give the developers the IAM Object Viewer access to view the logs in the specified bucket.
Answer: A

The short version

A — Use the logging agent plus Logs Viewer for least-config secure access. Compute Engine app servers need centralized logs without SSH or custom pipelines, which the managed agent plus a narrow IAM viewer role delivers simply and safely.

Key concepts in this question

  • Logging agent: Lightweight collector that tails app logs on each VM and ships to Cloud Logging with resource labels for search and filtering.
  • Logs Viewer role: Least-privilege grant that lets developers read and troubleshoot logs without administering sinks, buckets, or unrelated metrics.
  • Private-logs distinction: Private Logs Viewer targets restricted audit categories, unnecessary and confusing for routine application troubleshooting access.
  • Custom gsutil traps: Cron uploads to Cloud Storage plus object viewing add scripting, delay, storage cost, and broader access management versus native logging.

Why A is correct

A minimizes setup to agent install plus one well-scoped IAM binding, giving developers immediate searchable access in Cloud Console with auditability and revocation. It avoids opening SSH, managing buckets, or granting metric roles that do not show logs. That satisfies secure plus least configuration plus easy troubleshooting together.

Why the others are wrong

  • B. Private Logs Viewer targets restricted audit logs, not general app troubleshooting needs.
  • C. Monitoring agent plus Monitoring Viewer exposes metrics, not application log text.
  • D. Gsutil cron to Cloud Storage with Object Viewer adds custom jobs, lag, and extra access scope.

PCDE exam tip

For easy secure VM log access with least config, pick logging agent plus Logs Viewer.

Want the full bank of 195 questions for Professional Cloud DevOps Engineer (Google Cloud)? See all practice exams.