CCNA Pcde Optimising Performance Questions

65 questions · Pcde Optimising Performance topic · All types, answers revealed

1
MCQeasy

A DevOps team is deploying a web application on Google Kubernetes Engine (GKE) that experiences daily traffic spikes. They want to automatically adjust the number of pod replicas based on CPU utilization. Which Kubernetes resource should they use?

A.Horizontal Pod Autoscaler (HPA)
B.Cluster Autoscaler
C.PodDisruptionBudget
D.Vertical Pod Autoscaler (VPA)
AnswerA

HPA automatically scales the number of pod replicas based on observed CPU/memory utilization or custom metrics.

Why this answer

The Horizontal Pod Autoscaler (HPA) automatically scales the number of pod replicas based on resource utilization metrics like CPU or memory. The Vertical Pod Autoscaler (VPA) adjusts resource requests/limits, not replica count. Cluster Autoscaler adjusts node count, not pods.

PodDisruptionBudget controls voluntary disruptions.

2
Multi-Selecteasy

A company wants to optimize costs for their Compute Engine instances. They have a mix of workloads: some are fault-tolerant batch jobs, and others are stateful services requiring consistent uptime. Which two strategies should they use to reduce costs? (Choose two.)

Select 2 answers
A.Use committed use discounts for the stateful services
B.Enable node auto-provisioning in GKE
C.Use preemptible VMs for the batch jobs
D.Replace all instances with larger machines to reduce total instance count
E.Use CPU always on for all instances
AnswersA, C

Committed use discounts provide up to 70% discount for predictable workloads.

Why this answer

Preemptible VMs are cheaper and ideal for fault-tolerant batch jobs. Committed use discounts (1 or 3 years) offer significant savings for stateful services that run continuously. Active Assist recommendations help right-size instances.

Using larger instances with fewer VMs may not always save costs. CPU always on is a Cloud Run setting, not relevant to Compute Engine cost optimization.

3
MCQeasy

A Cloud Run service handles HTTP requests that each involve a short background task after the response is sent. The service currently has CPU throttled when not handling requests, causing background tasks to fail. Which configuration change ensures background tasks complete?

A.Set concurrency to 1
B.Set execution environment to gen2
C.Set min instances to 1
D.Set CPU to 'always on'
AnswerD

CPU always on prevents throttling, allowing background tasks to run even when no request is being served.

Why this answer

Setting CPU to 'always on' prevents Cloud Run from throttling CPU when the container is not actively serving a request, allowing background tasks to complete. Min instances reduce cold starts but don't affect CPU throttling. Concurrency controls request handling.

Execution environment gen2 offers higher memory but doesn't change CPU throttling behavior.

4
MCQeasy

A company is running a Cloud SQL for PostgreSQL database and wants to improve read performance for reporting queries. They have already optimized the queries but still see high CPU usage on the primary instance. What is the most cost-effective solution?

A.Add a read replica and direct reporting traffic to it.
B.Enable connection pooling with PgBouncer on the primary.
C.Increase the memory of the primary instance.
D.Create a Cloud SQL Auth Proxy and use it for all connections.
AnswerA

Read replicas handle read-only queries, reducing load on the primary instance.

Why this answer

Read replicas offload read traffic from the primary instance, reducing CPU usage without requiring a larger primary instance.

5
MCQhard

A company uses Cloud SQL for MySQL and notices slow queries. They have enabled slow query logging and found that some queries are performing full table scans. The table has millions of rows. What is the best immediate action to improve query performance?

A.Increase the instance memory to allow more caching.
B.Use `EXPLAIN ANALYZE` to rewrite the query.
C.Create an index on the columns used in the WHERE clause.
D.Add a read replica to offload the queries.
AnswerC

Indexes allow the database to find rows without scanning the entire table.

Why this answer

Creating an appropriate index can eliminate full table scans and drastically improve query performance for the identified slow queries.

6
MCQmedium

A team uses Cloud Run for a web application that experiences sporadic traffic. They want to minimize cold starts without incurring costs when there are no requests. Which configuration should they use?

A.Set min instances to a value greater than 0
B.Set min instances to 0
C.Set CPU always-on to true
D.Set concurrency to 1000
AnswerB

This allows scaling to zero when idle, minimizing cost. Cold starts will occur on first request, but with appropriate concurrency and startup optimizations, this is the best cost approach.

Why this answer

Min instances set to 0 allows the service to scale to zero when idle, eliminating cost. To reduce cold starts, they can also adjust concurrency and CPU, but min instances=0 is the key for cost savings.

7
Multi-Selectmedium

A company runs a microservices application on GKE. They want to automatically adjust both the number of pods (for varying load) and the resource limits of individual pods (to avoid resource waste). Which two Kubernetes resources should they configure together? (Choose two.)

Select 2 answers
A.PodDisruptionBudget
B.Vertical Pod Autoscaler (VPA)
C.Horizontal Pod Autoscaler (HPA)
D.Cluster Autoscaler
E.Node Auto-Provisioning
AnswersB, C

VPA adjusts CPU and memory requests/limits of pods to match usage, reducing waste.

Why this answer

HPA adjusts the number of pod replicas based on metrics like CPU. VPA adjusts resource requests and limits to right-size pods. Together, they can complement each other: VPA provides recommended resource values, and HPA scales based on load.

However, when using both, VPA should be in 'Off' mode for recommendations only, to avoid conflicts. Cluster Autoscaler adjusts nodes, not pods. PDB controls disruptions.

8
MCQmedium

A GKE cluster runs a mix of batch and latency-sensitive services. The batch jobs require occasional large CPU bursts, but the latency-sensitive services need consistent performance. The team wants to avoid CPU contention without over-provisioning nodes. Which approach should they take?

A.Configure a PodDisruptionBudget for the latency-sensitive services
B.Use Vertical Pod Autoscaler (VPA) for all pods
C.Create separate node pools: one with high-CPU machines for batch jobs and one with general-purpose machines for latency-sensitive services, and use taints/tolerations
D.Use Horizontal Pod Autoscaler (HPA) with CPU target
AnswerC

Separate node pools with taints ensure batch jobs run on appropriate hardware and do not interfere with other services.

Why this answer

Node pools with different machine types allow separating workloads onto appropriate hardware. Using taints and tolerations ensures that batch pods only run on the batch node pool, preventing interference with latency-sensitive services on the general pool. This approach avoids over-provisioning by right-sizing each pool.

VPA and HPA adjust resources/replicas but do not prevent CPU contention between different workloads on the same node. PDBs control disruptions, not resource contention.

9
MCQmedium

A DevOps engineer is optimizing a Cloud Run service that performs background data processing tasks triggered by Pub/Sub messages. The tasks are CPU-intensive and can run up to 10 minutes each. The service currently experiences cold starts causing delays. Which configuration should the engineer apply to minimize cold starts and ensure the background tasks are not throttled?

A.Set min instances to 1, CPU always-on, concurrency to 1
B.Set min instances to 1, CPU throttled, concurrency to 80
C.Set min instances to 0, CPU always-on, concurrency to 1000
D.Set min instances to 0, CPU always-on, concurrency to 1
AnswerA

min instances = 1 keeps at least one instance warm, CPU always-on ensures background tasks are not throttled, and concurrency = 1 dedicates the instance to a single task.

Why this answer

Setting a minimum number of instances ensures that at least one instance is always warm, eliminating cold starts. Setting CPU always-on prevents the CPU from being throttled during background processing, which is necessary for tasks that are not triggered by an HTTP request. Concurrency should be set to 1 to avoid multiple tasks competing for CPU on the same instance.

10
MCQmedium

A team runs a Cloud SQL MySQL instance serving an e-commerce application. Read traffic is growing and causing increased latency on the primary instance. They want to offload read queries with minimal application changes. Which solution should they implement?

A.Upgrade the primary instance to a higher machine type
B.Optimize slow queries using EXPLAIN ANALYZE and add indexes
C.Enable connection pooling with Cloud SQL Auth Proxy and PgBouncer
D.Create Cloud SQL read replicas and direct read-only queries to them
AnswerD

Read replicas serve read traffic without impacting primary instance performance, and minimal application changes are needed.

Why this answer

Cloud SQL read replicas are designed to offload read traffic from the primary instance. The application can be configured to send read-only queries to the replica endpoint. Connection pooling with PgBouncer helps with connection management but does not offload reads.

Query optimization reduces load but doesn't scale reads. Read replicas are the standard solution.

11
Multi-Selecthard

Your organization uses Cloud Spanner for a global application with strong consistency requirements. You need to design a table schema to avoid hot spots while supporting queries that join two related entities (e.g., Customers and Orders). Which THREE design choices should you implement? (Choose three)

Select 3 answers
A.Use monotonically increasing keys (e.g., auto-increment) for easy ordering.
B.Use hash prefixes or random UUIDs as the primary key to distribute writes.
C.Disable strict consistency to allow faster writes.
D.Create secondary indexes with the INTERLEAVE IN PARENT option to store index data with the parent.
E.Use interleaved tables to store Customers and Orders together for efficient joins.
AnswersB, D, E

Uniformly distributed keys prevent hot spots.

Why this answer

To avoid hot spots and support efficient joins in Cloud Spanner, three design choices are recommended. First, use hash prefixes or random UUIDs as the primary key (B) to distribute writes evenly across nodes, preventing hot spots caused by monotonically increasing keys. Second, create secondary indexes with the INTERLEAVE IN PARENT option (D) to store index data alongside the parent table, reducing read latency for queries that filter by the indexed columns.

Third, use interleaved tables (E) to store related rows (e.g., Customers and Orders) physically together, enabling efficient joins without cross-node lookups. These choices leverage Spanner's distributed architecture for scalability and strong consistency.

12
Multi-Selectmedium

A company runs a high-throughput pub/sub system. They need to improve message processing throughput. Which two actions should they take? (Choose TWO).

Select 2 answers
A.Enable ordering keys
B.Increase the number of parallel pull subscribers
C.Enable flow control to limit outstanding messages
D.Decrease the acknowledgement deadline
E.Use a single pull subscriber
AnswersB, C

More subscribers increase processing parallelism.

Why this answer

Increasing parallel pull consumers and enabling flow control can improve throughput by distributing load and preventing subscriber overload.

13
Multi-Selectmedium

Your GKE cluster uses node auto-provisioning to automatically create node pools. However, you notice that the cluster autoscaler is removing nodes too aggressively, causing frequent pod evictions. Which TWO configuration changes can you make to reduce the frequency of scale-down events? (Choose two)

Select 2 answers
A.Increase the scale-down delay to 10 minutes.
B.Decrease the max node count to limit scaling.
C.Enable node auto-provisioning to automatically create new node pools.
D.Set a minimum node count (e.g., 2) to guarantee a baseline of nodes.
E.Use PodDisruptionBudget to protect critical pods.
AnswersA, D

A longer delay prevents premature removal of nodes.

Why this answer

The cluster autoscaler scale-down delay options control how long a node must be underutilized before it is removed. Increasing the scale-down delay (e.g., to 10 minutes) gives pods more time to stabilize. Additionally, setting a minimum number of nodes ensures that even if nodes are underutilized, they are not scaled down below a certain threshold, reducing evictions.

Decreasing max nodes or enabling node auto-provisioning would not help.

14
MCQeasy

You are deploying a batch job on Compute Engine that processes large datasets and can tolerate interruptions. The job runs for about 6 hours every night. Which option would minimize cost while ensuring the job completes within the 6-hour window?

A.Use standard VMs with committed use discounts for 1 year.
B.Use custom machine types to optimize cost.
C.Use preemptible VMs to get up to 80% discount, with checkpointing to resume if preempted.
D.Use sole-tenant nodes for dedicated hardware.
AnswerC

Preemptible VMs are cost-effective for fault-tolerant batch workloads; checkpointing ensures completion.

Why this answer

Preemptible VMs are significantly cheaper (up to 80% discount) but can be terminated at any time. For fault-tolerant batch jobs, preemptible VMs are ideal; if preempted, the job can resume on another preemptible VM. Committed use discounts provide cost savings for steady-state usage (1- or 3-year commitment), but are not suitable for a nightly 6-hour job.

Custom machine types or standard VMs would be more expensive.

15
MCQmedium

You are running a Cloud Run service that performs background image processing tasks after responding to HTTP requests. Users report that tasks are sometimes not completed. You have set CPU to always-on, but you notice the service's concurrency is set to the default of 80. What is the most likely cause of incomplete tasks?

A.The service should use Gen2 execution environment for better background processing.
B.The CPU always-on setting is not sufficient; you need to enable background CPU.
C.You need to increase the request timeout beyond 60 minutes.
D.The concurrency setting of 80 allows too many requests to share the instance's CPU, starving background tasks.
AnswerD

High concurrency causes resource contention; reducing concurrency gives each request more CPU.

Why this answer

Cloud Run allows up to 80 concurrent requests per instance by default. If the concurrency is too high, the instance's CPU may be overwhelmed, causing background tasks to be preempted or not completed. Setting CPU to always-on ensures CPU is available but does not limit concurrency.

Reducing concurrency to a lower value (e.g., 1) ensures each request gets dedicated CPU for background work.

16
MCQeasy

A DevOps team has a GKE workload that experiences fluctuating traffic. They want to automatically adjust the number of pods based on CPU utilization. Which resource should they configure?

A.Pod Disruption Budget
B.Vertical Pod Autoscaler
C.Horizontal Pod Autoscaler
D.Cluster Autoscaler
AnswerC

HPA scales the number of pods based on metrics like CPU utilization.

Why this answer

Horizontal Pod Autoscaler (HPA) automatically scales the number of pod replicas based on observed CPU utilization or other metrics, which is exactly what the team needs.

17
MCQhard

A team is using Cloud Spanner for a global user database. They frequently run JOIN queries between a Users table and an Orders table. The queries are slow and the team suspects they are causing cross-node fan-out. Which schema design technique would reduce latency by co-locating related data?

A.Add a hash prefix to the primary key of both tables
B.Denormalize the Orders data into the Users table
C.Use interleaved tables (Orders interleaved in Users)
D.Create a secondary index on the foreign key column
AnswerC

Interleaved tables store rows of Users and Orders together, making JOINs local to a single node.

Why this answer

Interleaved tables in Cloud Spanner store child rows physically with the parent row, allowing efficient JOINs without cross-node fan-out. Secondary indexes improve lookup but do not co-locate data. Hash-prefixed keys distribute writes but don't co-locate parent-child data.

Denormalization avoids JOINs but may not be suitable for all cases.

18
MCQmedium

A company is deploying a microservice on Cloud Run that needs to handle up to 1000 concurrent requests per instance. The default concurrency setting is 80. How should they configure the service to achieve the desired concurrency?

A.Set the `--execution-environment` to gen2.
B.Set the `--cpu` flag to 4.
C.Set the `--max-instances` flag to 1000.
D.Set the `--concurrency` flag to 1000.
AnswerD

This sets the maximum number of concurrent requests that each container instance can handle.

Why this answer

Cloud Run allows setting max concurrent requests per instance via the `--concurrency` flag. Setting it to 1000 enables the desired throughput.

19
MCQeasy

Your Cloud Spanner instance is experiencing high write latency and hot spots on a table that uses an auto-incrementing integer as the primary key. Which change would best mitigate the hot spots?

A.Change the primary key to a random UUID.
B.Add a secondary index on the auto-incrementing column.
C.Increase the number of splits by raising the number of nodes.
D.Use interleaved tables to store related data together.
AnswerA

UUIDs are uniformly distributed, preventing hot spots.

Why this answer

Monotonically increasing keys (like auto-incrementing integers) cause all writes to go to the same tablet (hot spot) in Cloud Spanner. Using a key with uniform distribution, such as a random UUID or a hash prefix, spreads writes across splits. Bit-reverse index is an alternative for sequential keys, but a random key is simpler.

Interleaved tables and secondary indexes do not address the root cause.

20
Multi-Selectmedium

An engineer is tuning Cloud Spanner performance for a database that experiences high read latency on parent-child queries. The database schema uses a table for Users and a table for Orders with a foreign key on user_id. The Orders table has a secondary index on order_date. Which TWO actions can improve query performance? (Choose TWO)

Select 2 answers
A.Increase the number of Spanner nodes to reduce read latency
B.Use the INTERLEAVE IN PARENT clause when creating the secondary index on order_date
C.Add a secondary index on user_id in the Orders table
D.Run a query explain plan to identify bottlenecks
E.Define Orders as an interleaved table within Users
AnswersB, E

This stores the index data in the same split as the base table, reducing latency for queries using that index.

Why this answer

Interleaving the Orders table in the Users table stores rows from both tables together on the same split, making parent-child joins much faster. Using INTERLEAVE IN PARENT for the secondary index on order_date stores the index data together with the base table, reducing lookup overhead. Adding a secondary index on user_id is unnecessary if Orders is interleaved in Users.

Query explain plan is diagnostic, not a direct performance improvement. Increasing nodes increases throughput but not latency for individual queries.

21
MCQmedium

A Cloud Pub/Sub subscription is processing a high volume of messages, but the subscriber frequently receives messages that have already been processed (duplicates). The subscriber's processing time varies from 100 ms to 10 seconds. Which parameter should be adjusted to reduce duplicates while maintaining throughput?

A.Increase the acknowledgement deadline to 60 seconds
B.Enable flow control with a max outstanding message count
C.Use ordering keys on the subscription
D.Increase the number of puller clients
AnswerA

A longer deadline ensures that messages are not redelivered before processing completes, reducing duplicates.

Why this answer

Pub/Sub redelivers messages if the acknowledgement deadline expires before the subscriber acknowledges. Setting a longer acknowledgement deadline (e.g., 60 seconds) gives the subscriber more time to process and acknowledge, reducing duplicates. Flow control limits outstanding messages but does not prevent duplicates.

Using ordering keys ensures order but can increase duplicates due to head-of-line blocking. Increasing the number of pullers increases throughput but not directly reduce duplicates.

22
Multi-Selectmedium

A company uses Pub/Sub for event-driven processing and wants to ensure exactly-once delivery for critical messages. Which TWO configurations are required? (Choose two.)

Select 2 answers
A.Use multiple subscriber instances to increase throughput.
B.Set the acknowledgement deadline to 600 seconds.
C.Disable flow control to allow unlimited messages.
D.Enable message ordering on the subscription.
E.Set a maximum retention duration of 7 days.
AnswersD, E

Ordering is required for exactly-once delivery as per Pub/Sub documentation.

Why this answer

For exactly-once delivery, the subscription must have message ordering enabled and the subscriber must be idempotent. Pub/Sub also requires enabling exactly-once delivery flag (now GA).

23
Multi-Selectmedium

Your Cloud SQL for PostgreSQL database is experiencing slow query performance. You want to identify and optimize the slowest queries. Which TWO actions should you take? (Choose two)

Select 2 answers
A.Set up connection pooling using Cloud SQL Auth Proxy and PgBouncer.
B.Create read replicas to offload read traffic.
C.Enable the slow query log by setting the log_min_duration_statement flag.
D.Increase the instance memory to the next tier.
E.Use EXPLAIN ANALYZE on candidate queries to see the execution plan and bottlenecks.
AnswersC, E

This flag logs queries that exceed a duration threshold, helping identify slow queries.

Why this answer

To identify slow queries, enable the slow query log (via database flags) and use EXPLAIN ANALYZE to analyze query plans. Right-sizing the instance can help after identifying queries, but identifying them first requires logging and analysis. Connection pooling does not help identify slow queries.

24
MCQhard

Your GKE cluster runs a stateful application that requires persistent storage. You want to use Vertical Pod Autoscaler (VPA) to optimize resource requests, but you notice that pods are being terminated and recreated when VPA updates resource recommendations. You want to avoid pod restarts. Which VPA updateMode should you use?

A.updateMode: Recreate
B.updateMode: Off
C.updateMode: Initial
D.updateMode: Auto
AnswerC

Initial applies recommendations only to newly created pods, avoiding restarts of existing pods.

Why this answer

VPA updateMode: Auto will evict and recreate pods to apply new resource limits. To avoid restarts, you can use Initial (applies only to new pods) or Off (no changes). The question asks to avoid pod restarts, so Initial is appropriate if you can accept that existing pods keep their old limits.

Recreate is the same as Auto. Off disables VPA.

25
MCQhard

Your Cloud Spanner database has a table with a secondary index that is used for range queries. You notice that the index queries are slow because they require back-and-forth between the index and the base table. How can you optimize the index to reduce this overhead?

A.Use the STORING clause to include frequently queried columns in the index.
B.Convert the table to use hash-prefixed keys.
C.Create a new interleaved table and move the index data there.
D.Use the spanner_interleave_in_parent option when creating the index.
AnswerA

Storing columns in the index makes it a covering index, eliminating the need to read the base table.

Why this answer

In Cloud Spanner, you can store additional columns from the base table in the secondary index using the STORING clause. This allows the index to satisfy queries without accessing the base table (covering index). INTERLEAVE IN PARENT for the index can also improve locality if the index is interleaved with a parent table.

The question asks to reduce overhead of back-and-forth, which is solved by storing columns in the index.

26
Multi-Selectmedium

A team is running a critical application on Cloud SQL (PostgreSQL) that serves both OLTP transactions and read-heavy reporting. The reporting queries are causing performance degradation for the OLTP traffic. The team needs to optimize performance with minimal application changes. Which THREE actions should they take? (Choose THREE)

Select 3 answers
A.Enable slow query logging and use EXPLAIN ANALYZE to optimize queries
B.Route all traffic through the Cloud SQL Auth Proxy for better performance
C.Increase the number of vCPUs and memory on the primary instance
D.Enable connection pooling using PgBouncer via the Cloud SQL Auth Proxy
E.Create read replicas and route reporting queries to them
AnswersA, D, E

Identifying and optimizing slow queries reduces resource contention and improves overall performance.

Why this answer

Read replicas offload reporting queries from the primary instance. Connection pooling with PgBouncer reduces connection overhead and improves throughput. Slow query logging and EXPLAIN ANALYZE help identify and tune problematic queries, which is essential for performance.

VCPUs and memory should be right-sized based on workload, not arbitrarily increased. Cloud SQL Auth Proxy is for secure connections, not performance.

27
MCQmedium

A company stores time-series data in Cloud Spanner with a primary key composed of a timestamp prefix and a user ID suffix. They notice high write latency and hotspotting on a specific node. How should they redesign the primary key to distribute writes evenly?

A.Use a hash of the user ID as the prefix, then timestamp
B.Use a monotonically increasing counter as the prefix
C.Keep the current design but add a secondary index
D.Reverse the key order: timestamp suffix, user ID prefix
AnswerA

Hashing the user ID distributes writes across tablets, while timestamp ensures order within that hash.

Why this answer

Hotspots occur in Spanner when using monotonically increasing keys (like timestamps) because all writes go to a single tablet. Using a hash prefix or bit-reversal distributes writes across tablets. Keeping a timestamp suffix still causes hot leading key.

None and using a secondary index doesn't fix the primary key issue.

28
MCQeasy

A Cloud Spanner query is performing a join between two tables that are frequently accessed together. Which schema design can optimize this query?

A.Use interleaved tables
B.Use a foreign key constraint
C.Create a secondary index
D.Denormalize the data into a single table
AnswerA

Interleaving colocates parent and child rows, reducing cross-split joins.

Why this answer

Interleaved tables store child rows physically with parent rows, improving locality for parent-child joins.

29
Multi-Selecthard

A DevOps engineer is optimizing a GKE workload that is CPU-bound. They want to ensure proper resource allocation to improve performance. Which three actions should they take? (Choose THREE).

Select 3 answers
A.Set min instances on Cloud Run
B.Set Horizontal Pod Autoscaler based on CPU utilization
C.Use preemptible nodes
D.Enable Cluster Autoscaler for node scaling
E.Configure Vertical Pod Autoscaler in Auto mode
AnswersB, D, E

HPA scales pods when CPU is high.

Why this answer

VPA recommends resource requests/limits; cluster autoscaler ensures node capacity; HPA handles scaling based on CPU.

30
MCQeasy

A Cloud Run service experiences cold starts on the first request after being idle, causing latency spikes. The team wants to eliminate cold starts entirely. Which configuration setting should they use?

A.Set CPU to always on
B.Set max instances to 1
C.Set min instances to a value greater than 0
D.Set concurrency to 1
AnswerC

Min instances ensures the specified number of instances are always running, eliminating cold starts.

Why this answer

Setting a minimum number of instances (min instances) keeps the specified number of instances always warm, preventing cold starts. CPU always on prevents throttling but does not eliminate cold starts. Max instances limits scale but does not prevent cold starts.

Concurrency controls how many requests an instance can handle but does not eliminate cold starts.

31
MCQhard

A company runs a batch processing job on Compute Engine VMs. The job is fault-tolerant and can handle individual VM failures by restarting tasks. To reduce costs, they want to use the cheapest possible VMs while ensuring the job completes within a flexible time window. Which VM option is MOST cost-effective?

A.Standard VMs with committed use discounts
B.Preemptible VMs
C.Sole-tenant VMs
D.Standard VMs without discounts
AnswerB

Preemptible VMs offer the lowest cost and are suitable for fault-tolerant batch jobs.

Why this answer

Preemptible VMs are significantly cheaper (up to 60-80% discount) than regular VMs but can be terminated at any time. Since the job is fault-tolerant, preemptibles are ideal for cost savings. Committed use discounts require a 1-year or 3-year commitment, less flexible.

Standard VMs are more expensive. Sole-tenant nodes are for isolation, not cost savings.

32
MCQmedium

A company runs a GKE cluster for a web application. During peak traffic, the application experiences increased latency. The team has enabled the Horizontal Pod Autoscaler (HPA) based on CPU utilization, but the scaling is not fast enough. Which approach would improve the responsiveness of the HPA?

A.Decrease the HPA sync period from 15 seconds to 5 seconds.
B.Decrease the CPU target utilization from 80% to 50%.
C.Increase the HPA sync period from 15 seconds to 60 seconds.
D.Increase the stabilization window from 5 minutes to 10 minutes.
AnswerA

A shorter sync period allows the HPA to evaluate metrics more frequently, scaling faster.

Why this answer

Decreasing the HPA sync period makes the controller evaluate metrics more frequently, reducing the time to react to load changes. Increasing stabilization window delays scaling up, making it worse.

33
MCQmedium

Your Cloud Run service experiences cold starts that add 5 seconds of latency to user requests. You want to eliminate cold starts for a baseline traffic level of 10 requests per second. The service uses about 2 GiB of memory. What should you do?

A.Use the Gen2 execution environment to reduce cold start time.
B.Increase the concurrency to 1 to minimize instance count.
C.Set minInstances to 2 to keep instances always warm.
D.Set CPU always-on to keep the instance active.
AnswerC

minInstances keeps the specified number of instances always running, eliminating cold starts for baseline traffic.

Why this answer

Cloud Run cold starts can be eliminated by setting a minimum number of instances that are always warm. The minInstances flag ensures that the specified number of instances are always running and ready to serve requests. For a baseline of 10 RPS, you need to estimate how many instances are needed; but the question asks to eliminate cold starts, so setting minInstances to at least 1 (or more) will keep instances warm.

Setting CPU always-on does not eliminate cold starts. Gen2 execution environment may reduce cold start time but not eliminate them.

34
MCQhard

A DevOps engineer is setting up a GKE cluster for a batch processing job that can tolerate interruptions. The job runs for a few hours daily. To optimize cost, they want to use preemptible VMs. What must they configure to ensure the job completes despite node preemptions?

A.Disable cluster autoscaler to avoid node churn
B.Use a stateful workload with persistent volumes
C.Set the cluster autoscaler min and max nodes to the same value
D.Set the cluster autoscaler min nodes low and max nodes high to allow replacement
AnswerD

This ensures that when preemptible nodes are preempted, the cluster autoscaler can provision new nodes.

Why this answer

To ensure the batch job completes despite node preemptions, the cluster autoscaler must be able to replace preempted nodes. Option D sets the minimum nodes low (to avoid unnecessary cost) and maximum nodes high (to allow scaling up when nodes are preempted). This allows the autoscaler to launch new preemptible nodes as replacements.

The job itself must be fault-tolerant and handle restarts, but the autoscaler configuration is what enables node replacement. Option A disables autoscaling, preventing replacement. Option B is unrelated to node replacement.

Option C prevents scaling, so preempted nodes cannot be replaced.

35
MCQhard

A company uses Cloud Spanner for a global application. They notice high write latency and occasional hotspotting on a table with a monotonically increasing integer primary key. Which schema design change would best prevent hotspotting while maintaining read performance?

A.Use a UUID as the primary key.
B.Create an interleaved table with the primary key as the parent.
C.Add a secondary index on the primary key.
D.Use bit-reversed indexes for the primary key.
AnswerD

Bit-reversed indexes spread sequential keys across the key space, avoiding hotspotting on a single split.

Why this answer

Using a hash prefix of the primary key distributes writes across different splits, preventing hotspots. UUIDs also work, but bit-reverse is better for sequential keys. Interleaved tables do not help with hotspotting.

36
MCQhard

Your organization uses Cloud SQL for PostgreSQL for a reporting application with read-heavy workloads. Queries are slow and you need to reduce load on the primary instance. You also need to ensure that all read queries from the reporting tool are isolated from the primary. What should you do?

A.Create a Cloud SQL read replica, and configure the reporting tool to connect to the replica's IP address.
B.Create a Cloud SQL clone and point the reporting tool to the clone.
C.Enable connection pooling using Cloud SQL Auth Proxy and PgBouncer on the primary instance.
D.Configure the reporting tool to use the primary instance with a lower priority.
AnswerA

Read replicas offload read traffic and isolate reporting queries from the primary.

Why this answer

Cloud SQL read replicas serve read traffic and offload the primary. For isolation, the reporting tool must connect to the replica's IP. Cloud SQL Auth Proxy is a secure tunnel, but does not provide connection pooling.

PgBouncer can be used with proxies for connection pooling, but the question asks for isolation, which is achieved by pointing the reporting tool to the replica. The best answer is to create a read replica and configure the reporting tool to connect to it.

37
MCQmedium

A team is using Cloud Spanner and wants to create a secondary index that is stored with the base table data to avoid interleaved joins. Which option should they use when creating the index?

A.Create a stored generated column as the index key.
B.Use a hash index instead of a secondary index.
C.Use the `INTERLEAVE IN` clause when creating the index.
D.Add `spanner_interleave_in_parent = true` in the index creation.
AnswerD

This option stores the index with its parent table, optimizing joins.

Why this answer

The `spanner_interleave_in_parent` option stores the index interleaved within the parent table, improving join performance for parent-child relationships.

38
Multi-Selecthard

A company is migrating a stateful web application from on-premises to Google Kubernetes Engine (GKE). The application has variable traffic patterns, with occasional spikes. The team wants to optimize performance and availability while minimizing cost during spikes. The application is not fault-tolerant to instance restarts. Which TWO strategies should the team implement? (Choose TWO)

Select 2 answers
A.Use preemptible VMs to reduce cost during spikes
B.Configure pod disruption budgets to ensure a minimum number of pods remain available during node scaling
C.Use Vertical Pod Autoscaler in Auto mode to automatically adjust pod resources without restarts
D.Configure cluster autoscaler to add nodes when utilization is high
E.Set cluster autoscaler scale-down delay to 0 for immediate cost savings
AnswersB, D

Pod disruption budgets protect against voluntary disruptions (e.g., node scaling), ensuring availability during spikes.

Why this answer

Cluster autoscaler adds nodes during spikes, but to avoid disruption from node scaling activities, pod disruption budgets should be configured to protect critical pods. Preemptible VMs are not suitable because the application is not fault-tolerant to restarts. VPA with Auto mode can adjust resource requests without restarting pods, but may take time to react to spikes; HPA is better for handling spikes quickly.

39
MCQmedium

A batch job on GKE needs to be resilient to node failures. The job creates several pods that run for a few minutes each. The team wants to ensure that during a voluntary node disruption (e.g., node upgrade), only a limited number of pods are affected. Which resource should they configure?

A.Vertical Pod Autoscaler
B.Horizontal Pod Autoscaler
C.Cluster Autoscaler
D.Pod Disruption Budget
AnswerD

PDB defines how many pods can be disrupted at a time.

Why this answer

PodDisruptionBudget (PDB) specifies the minimum number of pods that must remain available during voluntary disruptions, protecting the job.

40
Multi-Selectmedium

A company runs a GKE cluster and wants to ensure that during a planned node upgrade, their application remains available with minimal disruption. Which TWO steps should they take? (Choose two.)

Select 2 answers
A.Deploy multiple replicas of the application across different nodes.
B.Increase the max surge of the deployment to 100%.
C.Set the cluster autoscaler scale-down delay to 0.
D.Create a PodDisruptionBudget for the deployment with minAvailable set to a value that ensures availability.
E.Use a single replica per node to simplify management.
AnswersA, D

Multiple replicas ensure that if one node is drained, other replicas handle traffic.

Why this answer

PodDisruptionBudgets (PDBs) ensure a minimum number of pods are available during voluntary disruptions like upgrades. Using multiple replicas across nodes provides redundancy. Increasing max surge helps but is not a direct disruption mitigation.

41
MCQmedium

A company uses Pub/Sub to ingest events from multiple services. They notice a backlog of unacknowledged messages and want to increase the throughput of their subscriber. The subscriber is a single process running on Compute Engine. What is the most effective way to increase throughput?

A.Decrease the flow control max outstanding messages.
B.Increase the acknowledgement deadline to 10 minutes.
C.Add more subscriber instances running in parallel.
D.Enable ordering keys on the subscription.
AnswerC

Multiple subscribers pull from the same subscription, increasing total throughput.

Why this answer

Running multiple subscriber instances (parallel pull consumers) increases the overall throughput by allowing more messages to be pulled and processed concurrently.

42
MCQmedium

Your GKE cluster is running a critical web application that experiences predictable traffic spikes during business hours. You want to minimize latency and avoid pod startup delays during scaling. The application uses CPU-intensive image processing. Which scaling strategy should you use?

A.Set a high number of static pods equal to peak traffic; use cluster autoscaler to add nodes.
B.Use VPA with updateMode: Auto to automatically adjust pod resources; enable cluster autoscaler to add nodes as required.
C.Deploy a CronJob to scale up replicas before business hours; rely on HPA to handle the rest.
D.Configure HPA with a minimum of 2 replicas and scale on CPU utilization; enable cluster autoscaler for node provisioning.
AnswerD

HPA with min replicas ensures baseline capacity to absorb spikes without cold starts; cluster autoscaler adds nodes as needed.

Why this answer

To avoid cold starts while ensuring pods can handle CPU spikes, you need a baseline of pods and dynamic scaling responsive to CPU. HPA with a minimum replicas of 2 ensures baseline capacity; HPA scales on CPU. Cluster autoscaler adds nodes if needed, but does not directly address pod startup delay.

VPA adjusts resource requests, which can help but does not prevent cold starts. Using HPA alone with min replicas avoids pod creation latency.

43
MCQmedium

A Cloud Run service needs to handle background tasks after responding to a client. Which CPU configuration is required to ensure background tasks complete?

A.Set concurrency to 1
B.CPU always-on: false (default)
C.CPU always-on: true
D.Set execution environment to gen1
AnswerC

Background tasks require CPU to remain active after the response.

Why this answer

CPU always-on must be enabled for Cloud Run to run background tasks; otherwise, CPU is throttled after the request is handled.

44
MCQhard

A team has a Cloud SQL instance with high CPU usage from many concurrent connections. They want to reduce connection overhead and improve performance. Which combination of services should they implement?

A.Cloud SQL Auth Proxy with PgBouncer
B.Use a network proxy like HAProxy
C.Cloud SQL Proxy with read replicas
D.Vertical scaling by increasing vCPU
AnswerA

Auth Proxy for secure tunneling, PgBouncer for connection pooling.

Why this answer

Cloud SQL Auth Proxy provides secure connections, and PgBouncer (connection pooler) manages a pool of connections to reduce overhead.

45
MCQmedium

A company is using Cloud Run to deploy a service that processes background tasks. The service takes a few seconds to initialize, and users experience high latency on cold starts. How can the company eliminate cold starts for this service?

A.Set the minimum number of instances to a value based on the baseline traffic.
B.Set the maximum number of instances to a higher value.
C.Use the gen1 execution environment.
D.Set the concurrency to 1.
AnswerA

Min instances keep instances warm, eliminating cold starts for the configured number of instances.

Why this answer

Setting a minimum number of instances ensures that at least that many instances are always running and ready to serve requests, eliminating cold starts.

46
Multi-Selecteasy

A DevOps team is using Pub/Sub to process high-volume event streams. They notice that the subscriber is falling behind and messages are being redelivered frequently. They need to increase throughput. Which TWO actions should they take? (Choose TWO)

Select 2 answers
A.Increase the acknowledgement deadline to give subscribers more time to process messages
B.Enable message ordering keys to ensure orderly processing
C.Change the subscription type from pull to push for faster delivery
D.Increase the number of parallel pull consumers in the subscriber
E.Decrease the flow control max outstanding messages to reduce load on subscribers
AnswersA, D

A longer acknowledgement deadline reduces the chance of redelivery due to timeout, allowing more time for processing.

Why this answer

Increasing the acknowledgement deadline gives subscribers more time to process messages, reducing redeliveries. Using multiple parallel pull consumers increases the rate at which messages are pulled. Flow control should be increased, not decreased, to allow more outstanding messages.

Ordering keys reduce throughput because they limit parallelism. Subscription type is fixed at creation time.

47
MCQmedium

Your Cloud SQL for MySQL instance is experiencing high CPU usage due to a burst of concurrent connections. You want to handle up to 500 concurrent connections without over-provisioning the instance. What should you do?

A.Create read replicas to distribute read traffic.
B.Right-size the instance to a tier that supports 500 concurrent connections.
C.Enable automatic storage increase to handle the load.
D.Use Cloud SQL Auth Proxy with a connection pooler like PgBouncer.
AnswerB

Choosing a tier with enough vCPU and memory allows 500 connections without over-provisioning.

Why this answer

Cloud SQL for MySQL has a maximum connections limit (based on tier). To handle 500 concurrent connections, you need to choose a tier with sufficient vCPU and memory. The max_connections is typically calculated as (available memory)/1257280 * 500, but the simplest approach is to use a tier that supports at least 500 connections (e.g., db-n1-standard-2 or higher).

However, using Cloud SQL Auth Proxy with PgBouncer is for PostgreSQL, not MySQL. Connection pooling with ProxySQL or a similar tool could help, but the question says 'without over-provisioning', so right-sizing the tier is key.

48
MCQmedium

An application running on Cloud SQL experiences high read latency. The team wants to offload read traffic from the primary instance and improve performance. Which approach should they take?

A.Create a single read replica and route read-only queries to it
B.Add more memory to the primary instance
C.Enable the query cache
D.Use Cloud SQL Auth Proxy
AnswerA

Read replicas handle SELECT queries, offloading the primary.

Why this answer

Cloud SQL read replicas allow distributing read traffic, reducing load on the primary instance and improving read performance.

49
MCQeasy

A team wants to automatically adjust the node count in a GKE cluster based on pending pod resource requests. Which component should they enable?

A.Cluster Autoscaler
B.Vertical Pod Autoscaler
C.Node auto-provisioning
D.Horizontal Pod Autoscaler
AnswerA

Cluster Autoscaler adjusts node count based on resource demands.

Why this answer

The Cluster Autoscaler automatically adds or removes nodes from the cluster based on pending pods or underutilized nodes.

50
Multi-Selecthard

A Cloud Pub/Sub subscription is used to ingest real-time events. The subscriber's processing rate is slower than the publish rate, causing messages to back up. The team needs to increase throughput without losing messages. Which three actions should they take? (Choose three.)

Select 3 answers
A.Increase the number of subscriber clients (parallel pull consumers)
B.Set ordering keys on the subscription
C.Use a push subscription instead of pull
D.Increase the max outstanding messages per subscriber client
E.Use a pull subscription with an asynchronous puller
AnswersA, D, E

More subscribers pull messages concurrently, increasing overall throughput.

Why this answer

Increasing the acknowledgement deadline prevents premature redelivery but does not increase throughput. Using flow control (max outstanding messages) can actually reduce throughput. To increase throughput: increase the number of subscriber clients (more parallel pulls), use pull subscriptions (more efficient than push for high volume), and increase the max outstanding messages per client (allows more concurrent processing).

Ordering keys are not needed for throughput and can reduce it.

51
MCQhard

A team is using Cloud Spanner with a primary key of UUID v4 values. They notice that read performance is suboptimal for range scans over a subset of keys. Which index strategy improves range scan performance?

A.Add a hash prefix to the primary key
B.Create a secondary index using INTERLEAVE IN the base table
C.Remove the UUID primary key and use a sequential key
D.Create a secondary index without interleaving (global index)
AnswerB

An interleaved index stores index entries with the base data, making range scans local to one split.

Why this answer

A secondary index with an interleaved parent stores index entries in the same tablet as the base table rows, reducing cross-node fan-out for range scans. A hash prefix would help for point lookups but not range scans. Storing the index in a separate table (global index) increases latency.

Dropping the index makes range scans worse.

52
MCQeasy

A company is using Cloud Run for a service that performs background computation even when there are no incoming requests. They find that the service is being throttled and not completing the background work. What is the most likely cause and solution?

A.The service needs more memory; increase memory limit.
B.The service must have CPU always-on enabled.
C.The service needs to set min instances to 1.
D.The service should be migrated to GKE.
AnswerB

CPU always-on prevents throttling when no request is being processed, allowing background tasks to run.

Why this answer

Cloud Run instances have CPU throttled when not handling requests. Setting CPU always-on ensures the instance can use CPU continuously for background tasks.

53
MCQhard

A company has a GKE cluster with cluster autoscaler enabled. They notice that after a batch job completes, the cluster takes a long time to scale down, leaving idle nodes running and incurring costs. Which configuration change would reduce the scale-down delay?

A.Reduce the scale-down delay from 10 minutes to 2 minutes.
B.Enable node auto-provisioning.
C.Increase the min node count to match the peak.
D.Decrease the max node count.
AnswerA

A shorter scale-down delay makes the cluster autoscaler remove unneeded nodes faster.

Why this answer

The cluster autoscaler has a default scale-down delay (e.g., 10 minutes for unneeded nodes). Reducing this delay causes nodes to be removed sooner after becoming idle.

54
MCQmedium

Your Pub/Sub subscription is not keeping up with the message publishing rate. The subscriber is a Cloud Run service that processes each message in about 2 seconds. You have already increased the number of subscribers to 10. What is the next best step to increase throughput?

A.Enable message ordering to ensure sequential processing.
B.Switch to a pull subscription instead of push.
C.Increase the acknowledgement deadline to 30 seconds.
D.Reduce the flow control max outstanding messages to 100.
AnswerC

With 2-second processing time, a 10-second deadline may cause premature redelivery if there is any delay; increasing it reduces redeliveries and improves throughput.

Why this answer

If increasing subscribers does not help, the issue may be the acknowledgement deadline. If the deadline is too short, messages are redelivered before processing completes, causing duplicates and wasted work. Increasing the deadline (from default 10 seconds to something higher like 30 seconds) gives time to process.

Flow control limits throughput. Ordering keys can reduce throughput.

55
MCQmedium

Your Cloud Run service processes requests from an external API that sends a burst of up to 100 requests per second. You want to maximize throughput while minimizing instances. The service is CPU-bound. What configuration should you use?

A.Use the Gen2 execution environment with higher memory.
B.Set concurrency to 1 to give each request full CPU, and enable CPU always-on.
C.Set concurrency to 1000 to handle burst efficiently.
D.Set concurrency to 80 (default) and CPU always-on.
AnswerB

Concurrency 1 ensures each instance handles one request at a time, maximizing CPU per request.

Why this answer

For CPU-bound services, the default concurrency of 80 may be too high, causing resource contention and slowing down each request. Reducing concurrency to a lower value, such as 1, dedicates the entire CPU to each request, potentially improving throughput per instance. CPU always-on is needed for background tasks but not necessarily for request handling.

Gen2 execution environment can help with higher memory but not CPU-bound throughput directly.

56
MCQmedium

A company runs a Cloud SQL PostgreSQL instance for a SaaS application. They notice that the database CPU is consistently above 90% during peak hours, and queries slow down. The application is read-heavy and can tolerate some replication lag. Which action would MOST effectively reduce CPU load on the primary?

A.Use EXPLAIN ANALYZE to optimize the slowest queries
B.Create read replicas and route read-only queries to them
C.Increase the number of vCPUs on the primary instance
D.Enable connection pooling with PgBouncer via Cloud SQL Auth Proxy
AnswerB

Read replicas offload read traffic from the primary, reducing its CPU utilization effectively.

Why this answer

Creating one or more read replicas and offloading SELECT queries to them reduces CPU load on the primary instance. Adding more vCPU to the primary (scaling up) increases capacity but is more expensive and may not be as cost-effective as read replicas. PgBouncer helps with connection overhead but not CPU load from queries.

Query optimization helps but may not reduce load enough if the volume is high.

57
MCQeasy

You want to ensure that a critical deployment on GKE has minimal downtime during rolling updates. You also want to ensure that at least 2 pods are always available. Which Kubernetes resource should you configure?

A.Cluster autoscaler with minNodes: 2
B.HorizontalPodAutoscaler with minReplicas: 2
C.VerticalPodAutoscaler with updateMode: Auto
D.PodDisruptionBudget with minAvailable: 2
AnswerD

PDB ensures at least 2 pods remain available during voluntary disruptions.

Why this answer

PodDisruptionBudget (PDB) specifies the minimum number or percentage of pods that must be available during voluntary disruptions like rolling updates. Setting minAvailable: 2 ensures at least 2 pods are running during updates. HPA, VPA, and cluster autoscaler do not control pod availability during updates.

58
MCQmedium

A GKE cluster runs a stateful workload that requires persistent volumes. The nodes are managed by a node pool with autoscaling enabled. During scale-down, the cluster autoscaler sometimes removes nodes that host critical pods with local data. How can the team prevent this?

A.Set a PodDisruptionBudget with maxUnavailable=0 for the critical workloads
B.Use node taints and tolerations to pin pods to specific nodes
C.Set the cluster autoscaler flag --scale-down-delay to a high value
D.Configure Vertical Pod Autoscaler to increase pod resources
AnswerA

A PDB ensures that the cluster autoscaler does not remove nodes that would cause too many pods to be unavailable.

Why this answer

PodDisruptionBudgets (PDB) allow specifying the minimum number of available pods during voluntary disruptions like cluster autoscaler scale-down. By setting a PDB with maxUnavailable=0, the autoscaler will not drain nodes that would violate the budget. Node taints and tolerations control scheduling but not disruption.

Cluster autoscaler flags like scale-down-delay only delay scale-down, not prevent it for specific pods. VPA does not affect node selection.

59
MCQmedium

A Pub/Sub subscription is processing messages but the subscriber cannot keep up. The team notices that many messages are being resent. Which parameter should they adjust to reduce duplicate processing?

A.Decrease the acknowledgement deadline
B.Increase the retention duration
C.Enable ordering keys
D.Increase the acknowledgement deadline
AnswerD

A longer deadline allows subscribers more time to process, reducing redelivery.

Why this answer

Increasing the acknowledgement deadline gives the subscriber more time to process and ack messages, reducing the chance that they expire and are redelivered.

60
Multi-Selecthard

A company is experiencing slow query performance on Cloud Spanner. They have identified a query that joins a parent table with a child table frequently. Which THREE design choices can improve the performance of this join? (Choose three.)

Select 3 answers
A.Split the child table into multiple smaller tables.
B.Create a secondary index on the parent table's primary key.
C.Use interleaved tables to store child rows within the parent row.
D.Use `spanner_interleave_in_parent` option when creating the secondary index on the child table.
E.Add a secondary index on the foreign key of the child table.
AnswersC, D, E

Interleaved tables co-locate parent and child data, improving join performance.

Why this answer

Interleaved tables physically store child rows with the parent, reducing cross-node communication. Secondary indexes help with non-key lookups. Using `spanner_interleave_in_parent` on indexes stores index entries with the parent.

Splitting tables into smaller tables does not help joins. Bit-reversed keys prevent hotspots but not join performance.

61
MCQhard

A Cloud Spanner database uses a sequential customer ID as the primary key, causing frequent hotspotting on a single split. The team needs to eliminate hotspots. Which key design should they implement?

A.Use a composite key with a monotonically increasing timestamp as the first part
B.Use a random UUID as the primary key
C.Add a hash prefix derived from the customer ID
D.Keep the sequential key but add a secondary index
AnswerC

Hashing the key distributes writes evenly across splits.

Why this answer

Hotspots occur with monotonically increasing keys. Using a hash prefix or UUID spreads writes across splits. Bit-reverse is another technique for integers.

The simplest is to add a hash prefix to the key.

62
Multi-Selectmedium

A Cloud Spanner database is experiencing read performance issues. The team wants to optimize query performance. Which two approaches should they use? (Choose TWO).

Select 2 answers
A.Create secondary indexes on frequently filtered columns
B.Enable read replicas
C.Use interleaved tables for all tables
D.Increase the number of nodes
E.Use the query explain plan to analyze query execution
AnswersA, E

Indexes avoid full table scans.

Why this answer

Using query explain plan helps identify bottlenecks; secondary indexes speed up lookups.

63
MCQeasy

A team is using Cloud Spanner and wants to reduce latency for queries that filter on a column that is not part of the primary key. Which feature should they use?

A.Storing index
B.Secondary index
C.Interleaved table
D.Query explain plan
AnswerB

Indexes speed up lookups on non-key columns.

Why this answer

Secondary indexes allow efficient queries on non-primary-key columns.

64
MCQmedium

A company runs a batch data processing job on Compute Engine that is fault-tolerant. They want to reduce costs without affecting job completion time. The job can handle instance preemption gracefully. Which compute option should they use?

A.Use regular VMs with committed use discounts for 1 year.
B.Use GPU-accelerated instances.
C.Use preemptible VMs.
D.Use sole-tenant nodes.
AnswerC

Preemptible VMs cost about 60-80% less than regular VMs and are ideal for fault-tolerant batch workloads.

Why this answer

Preemptible VMs are significantly cheaper and suitable for fault-tolerant batch jobs because they can be interrupted but the job can resume on new instances.

65
MCQeasy

A company wants to use the Vertical Pod Autoscaler (VPA) to automatically adjust resource requests for their pods. They want the VPA to update the resource requests of running pods without recreating them. Which VPA updateMode should they use?

A.Auto
B.Initial
C.Recreate
D.Off
AnswerA

Auto automatically applies resource recommendations by recreating pods when needed.

Why this answer

The correct mode is `Auto`. VPA in `Auto` mode automatically adjusts resource requests and limits by recreating pods. While the requirement states 'without recreating them', VPA's `Auto` mode does recreate pods because resource requests are immutable.

However, `Auto` is the only mode that automatically applies recommendations; `Recreate` only applies on pod creation, `Initial` only at pod start, and `Off` provides recommendations only. Thus, `Auto` is the best choice for ongoing automatic adjustment.

Ready to test yourself?

Try a timed practice session using only Pcde Optimising Performance questions.