Optimizing performance and cost
Drill 20 practice questions focused entirely on Optimizing performance and cost for the Google Cloud PCDE exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
Your data analytics team runs BigQuery workloads that have grown unpredictably. Finance reports that on-demand query costs have tripled over three months, with large spikes during monthly reporting cycles but low steady usage otherwise. A few ad-hoc analyst queries occasionally scan enormous tables and cause bill surprises. You must implement a FinOps approach that controls cost while keeping predictable baseline performance for scheduled reporting jobs. What should you do?
You lead FinOps for a company running dozens of microservices across several GCP projects. Finance reports that last month's total spend jumped 35% with no obvious cause. Leadership wants a repeatable way to break down costs by service, SKU, project, and label, and to run ad hoc queries to pinpoint which resources drove the spike. What should you implement?
Your FinOps team wants to catch cost overruns before they occur rather than after the fact. Each of your 40 project owners currently receives a monthly invoice but no proactive signal. Leadership requires that when a project's spending is trending toward exceeding its monthly budget, an automated workflow disables non-essential resources without any human reading an email. Which Cloud Billing budget configuration best meets this requirement?
A retail company runs an e-commerce API on a Compute Engine managed instance group behind an external HTTP(S) load balancer. During periodic bot-driven traffic surges, the backend autoscaler adds many VMs to absorb the load, causing large unexpected compute spikes on the monthly bill even though the surge traffic is malicious and returns no revenue. The team wants to reduce cost during these events without degrading legitimate customer performance. What should they implement?
A media company serves large static video thumbnails and JavaScript bundles from a global external HTTP(S) Load Balancer backed by a Cloud Storage bucket. Monitoring shows high origin egress costs and elevated tail latency for users in distant regions. Cloud CDN is enabled, but the cache hit ratio is only 22%. Investigation reveals the origin responses include 'Cache-Control: no-store' on many objects and that unique query string parameters (used for analytics tracking) are appended to nearly every asset URL. What is the MOST effective way to reduce origin egress cost and improve latency?
A team runs a stateless HTTP API on Cloud Run (fully managed). The service is CPU-light but spends most request time waiting on an external payment provider. During traffic spikes, the service scales to hundreds of instances, driving up cost, even though CPU utilization per instance stays below 15%. Latency is acceptable. Which change best reduces cost while maintaining performance?
A team runs a lightweight webhook processing service on Cloud Run (fully managed). The service receives sporadic bursts of requests during business hours and is idle at night. Currently it is configured with 'CPU always allocated'. Finance reports the service costs far more than expected given its low request volume, and the team confirms that no background processing occurs outside of active request handling. Which change will most effectively reduce cost while preserving performance for the request-driven workload?
Your team runs an image-classification inference workload on a fleet of n1-standard-8 Compute Engine VMs, each with an attached NVIDIA T4 GPU. Requests arrive in unpredictable bursts throughout the day, and between bursts the GPUs sit idle for long stretches while you still pay for the running VMs. Latency requirements are moderate (a few seconds is acceptable), and each request is fully stateless. You want to reduce cost during idle periods without rewriting the model-serving code, while still handling sudden bursts. Which change best optimizes cost and performance?
A data engineering team runs a nightly Cloud Run job that processes 10,000 independent CSV files from Cloud Storage. Each file takes about 30 seconds to process. Currently the job runs with a single task, taking over 80 hours—well past the nightly window. The team wants to dramatically reduce wall-clock time while keeping cost predictable and avoiding wasted idle compute. Which configuration change best meets these goals?
A retail analytics team runs a nightly data-aggregation workload that takes about 40 minutes to complete and does not serve HTTP traffic. It currently runs on a Cloud Run service kept alive with a minimum of one instance, and a Cloud Scheduler job hits an endpoint each night to trigger processing. Finance flags that the service is being billed for idle CPU throughout the day. You need to minimize cost while keeping the workload serverless and scheduled. What should you do?
A retail company runs a customer-facing API on Cloud Run. During an unplanned marketing campaign, traffic spiked 20x and Cloud Run scaled out aggressively, causing a downstream Cloud SQL instance to hit its connection limit and a surprise spike in the monthly bill. The team wants to protect the database and cap runaway costs during future spikes while keeping the service available at a predictable capacity. Which action best meets these goals?
A customer-facing checkout API runs on Cloud Run. During business hours, users occasionally report multi-second delays on the first request after periods of low traffic, and traces confirm these are cold-start latencies while container instances initialize. Traffic is steady during the day but drops to near zero overnight. The team wants to eliminate the daytime cold-start delays while keeping cost as low as possible. Which configuration best meets both goals?
A latency-sensitive REST API runs on Cloud Run in a single region (us-central1). Analytics show that 40% of requests originate from users in Europe and Asia, and those users experience p95 latency of over 400ms compared to 90ms for North American users. Leadership wants to reduce global latency while avoiding a large increase in idle compute cost. What is the most appropriate optimization?
A retail company runs a stateless product-catalog API on a managed instance group behind an external HTTP(S) load balancer in a single region (us-central1). Analytics show that during a nightly 3-hour reporting batch, backend CPU spikes to 95% while during business hours it hovers around 30%. The team wants to reduce compute spend without harming daytime response latency, and the reporting batch can tolerate slightly higher latency. Which change best optimizes cost while preserving daytime performance?
A finance reporting application runs on a Cloud SQL for PostgreSQL instance sized at db-custom-16-104448 (16 vCPUs, 104 GB RAM). Cloud Monitoring shows average CPU utilization of 8% and peak utilization of 22% over the last 60 days, with query latency well within the SLO. The FinOps team wants to reduce the recurring cost of this instance while keeping performance headroom for peaks. What should the DevOps engineer do first?
A media company stores 400 TB of user-uploaded video in a Cloud Storage Standard bucket. Analytics show that objects are heavily accessed for the first 30 days after upload, occasionally accessed until about 120 days, and almost never accessed after that—yet they must be retained for 7 years for legal reasons. The FinOps team wants to minimize storage cost while ensuring recent uploads remain instantly available at low latency. Which approach best meets these requirements?
A media company serves large video-on-demand files from a single-region Cloud Storage bucket in us-central1. Users are globally distributed, and the finance team reports that inter-region and internet egress charges have grown significantly, while playback start times are slow for users in Asia and Europe. The engineering team wants to reduce egress cost and improve latency without re-architecting the application, which references objects via a public download URL. What is the most cost-effective and performant approach?
Your team runs a production API on Compute Engine that maintains a steady baseline of 40 n2-standard-8 instances 24/7, with occasional short bursts to 55 instances during business hours. Finance asks you to reduce compute spend without risking availability of the baseline capacity. The workload has been stable for over a year and is expected to continue at this level. Which approach optimizes cost while preserving reliability?
A FinOps review of your company's GCP environment reveals that a fleet of ~200 Compute Engine VMs running steady-state batch and internal tooling workloads shows CPU utilization consistently below 15% and memory below 20% over the past 60 days. Leadership wants to reduce spend without changing the workloads themselves, and asks the DevOps team for a data-driven approach that minimizes manual guesswork. Which action best addresses this?
An e-commerce company runs a stateless web tier on a Compute Engine managed instance group (MIG). Traffic follows a highly predictable weekday pattern: near-idle overnight, a steady ramp starting at 07:00, and a large sustained peak between 09:00 and 18:00. The default CPU-based autoscaler reacts too slowly, causing latency spikes each morning as it scrambles to add instances, and it also keeps a few extra instances running overnight 'just in case.' The team wants to eliminate the morning latency and reduce wasted overnight capacity without over-provisioning. What should they do?
More PCDE practice
Keep going with the other Professional Cloud DevOps Engineer domains, or take a full timed mock exam.
← Back to PCDE overview