Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team is building a distributed batch media-transcoding pipeline on Compute Engine. Profiling shows that each worker instance requires 6 vCPUs and 32 GB of memory to prevent CPU bottlenecks and avoid spilling intermediate buffers to disk.
The workload also has the following characteristics and constraints:
Which Compute Engine configuration should you choose?
Standard (on-demand) VMs provide dedicated, non-preemptible compute instances billed at standard rates. Pairing them with a 1-year resource-based Committed Use Discount (CUD) lets organizations commit to steady-state vCPU and memory capacity in a specific region for one year in exchange for discounts of up to 55% to 70% off on-demand prices. The n2-highmem-8 machine type is a predefined N2 shape with 8 vCPUs and 64 GB of memory.
n2-highmem-8 allocates 33% more vCPUs and double the memory, wasting budget on idle compute and RAM across every worker.n2-standard-8 offers 32 GB of RAM (with 8 vCPUs), while n2-highmem-8 doubles RAM to 64 GB.This configuration would be appropriate for a steady-state, stateful, business-critical application—such as a large in-memory database—that runs continuously for at least a year, cannot tolerate preemption, and actively utilizes 8 vCPUs and 64 GB of RAM.
Even when high availability is required, overprovisioning memory to 64 GB when only 32 GB is needed inflates costs unnecessarily. For interruptible batch workloads, custom Spot VMs provide substantial savings without long-term commitments.
c2-standard-8 VMs in a Zonal MIG DoThe c2-standard-8 machine type is part of the compute-optimized (C2) machine family, providing 8 vCPUs and 32 GB of memory with high per-core performance tailored for CPU-bound workloads. Deploying instances in a zonal managed instance group (MIG) confines all VMs in the group to a single availability zone.
c2-standard-8 supplies the required 32 GB of memory, it forces you to pay for 8 vCPUs instead of 6 vCPUs on a higher-cost compute-optimized series rather than a cost-optimized E2 series. Moreover, the C machine series does not support custom machine types, so you cannot tailor it down to 6 vCPUs.ANY or BALANCED distribution shapes) and cannot fall back across zones when hardware capacity is constrained.This option would be suitable if the workload required ultra-low-latency single-zone placement, depended on high per-core C2 performance across 8 vCPUs, and could afford to wait whenever Spot capacity in that single zone became unavailable.
For Spot VM fleets, regional MIGs are strongly preferred over zonal MIGs because they maximize resource obtainability and allow Compute Engine to automatically recover preempted instances across multiple zones in a region.
e2-highmem-4 Machine Types DoPredefined highmem machine types in the general-purpose E2 machine series are fixed-configuration VMs engineered for workloads that need a high memory-to-vCPU ratio—typically 8 GB of memory per vCPU. An e2-highmem-4 instance supplies 4 vCPUs and 32 GB of memory with non-modifiable hardware proportions.
e2-highmem-4 provides the required 32 GB of memory, it only delivers 4 vCPUs. Because profiling confirmed that each media-transcoding worker needs 6 vCPUs, running on 4 vCPUs introduces a CPU bottleneck that slows job execution and violates the workload's performance requirements.e2-highmem-8) jumps to 8 vCPUs and 64 GB of memory, resulting in unnecessary overprovisioning.highmem types lock memory at approximately 8 GB per vCPU, standard types provide roughly 4 GB per vCPU, and highcpu types provide roughly 2 GB per vCPU.This configuration would be optimal if the transcoding workers were purely memory-bound and required 32 GB of memory while running efficiently on 4 vCPUs or fewer.
A common misconception is that predefined machine types are always the most economical choice. When a workload's CPU and memory profile falls between predefined tiers—such as needing 6 vCPUs with 32 GB of RAM—an E2 custom machine type prevents both CPU starvation and paying for an oversized 8-vCPU VM.
Custom machine types allow you to specify exact vCPU and memory allocations for virtual machines in the N and E general-purpose machine series when predefined shapes do not fit a workload cleanly. Spot VMs are Compute Engine instances backed by excess cloud capacity that offer steep discounts in exchange for allowing Compute Engine to preempt them when capacity is needed elsewhere. A regional managed instance group (MIG) manages a fleet of identical VMs distributed across multiple zones in a region.
e2-custom-6-32768) allocates 6 vCPUs and 32 GB (32,768 MB) of memory. This provides roughly 5.33 GB of memory per vCPU, which falls squarely within E2's supported range of 0.5 GB to 8 GB per vCPU and avoids paying for unused resources in an 8-vCPU predefined shape.Predefined highmem-4 instances underprovision vCPUs, highmem-8 Standard VMs waste money on unused hardware and unnecessary uptime guarantees, and zonal c2-standard-8 instances lock the deployment to a single zone at higher compute-optimized rates. Combining an E2 custom machine type, Spot VMs, and a regional MIG delivers the exact performance profile at the lowest cost with automated recovery.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated