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.
A media company hosts a global web application behind a Global external Application Load Balancer with Compute Engine managed instance groups (MIGs). The application serves both stateful user sessions and static media assets through a single backend service configured with CLIENT_IP session affinity and the UTILIZATION balancing mode.
During peak traffic, users behind corporate NAT gateways and mobile carrier proxies experience timeouts. Monitoring shows a few backend VMs at 100% CPU while others remain underutilized, alongside high latency and excessive origin load for static assets.
Which architectural change should the team implement to eliminate backend hotspots and optimize content delivery?
CLIENT_IP session affinity with the UTILIZATION balancing mode, and switch the localityLbPolicy to RING_HASH.RING_HASH with UTILIZATION Balancing Mode DoesRING_HASH is a consistent hashing locality policy that maps eligible backend instances onto a hash circle so that adding or removing a host affects only a minimal fraction (1/N) of connections. The UTILIZATION balancing mode routes traffic to backend instance groups based on measured VM CPU utilization and target capacity.
RING_HASH, CLIENT_IP session affinity still computes the hash from the client's source IP address. Thousands of users behind a single corporate NAT gateway share one effective source IP, so RING_HASH still directs all of their dynamic requests—and any CDN cache misses—to the same overloaded VM.UTILIZATION balancing mode alongside any session affinity other than NONE causes unpredictable changes in perceived backend fullness as CPU spikes, which breaks session affinity and shifts traffic erratically.CLIENT_IP affinity enabled on the same backend service used for Cloud CDN is unnecessary for static assets and does not follow best practices for separating cacheable and stateful routes.RING_HASH distributes keys evenly only when the affinity key itself (such as unique cookies or headers) has high cardinality across clients.UTILIZATION sensitivity: When average VM utilization fluctuates or drops below 10%, UTILIZATION mode becomes overly sensitive to minor variations, causing traffic imbalances.NONE session affinity requires RATE, IN-FLIGHT, or CONNECTION balancing modes for stable behavior.The team needed RING_HASH for an internal or non-NATted workload using unique per-user headers or cookies and paired it with the RATE balancing mode rather than UTILIZATION.
Changing the hashing algorithm from MAGLEV to RING_HASH does not fix low-cardinality input keys; when CLIENT_IP collapses many users behind a NAT into one key, hot instances remain unavoidable.
CLIENT_IP session affinity, change localityLbPolicy to MAGLEV, and configure a serviceLbPolicy of SPRAY_TO_REGION to distribute traffic evenly across zones.SPRAY_TO_REGION and MAGLEV DoA service load balancing policy (serviceLbPolicy) controls how second-layer Google Front Ends (GFEs) distribute traffic across zones within a region. Setting it to SPRAY_TO_REGION instructs GFEs not to prefer backends in the same zone, instead spreading traffic across all zones in the region. Meanwhile, MAGLEV is a consistent hashing locality policy used within each zone to map requests to specific backend instances.
CLIENT_IP session affinity hashes only the 2-tuple of source and destination IP addresses, all users behind a shared corporate NAT gateway or carrier proxy produce the exact same hash. Regardless of whether MAGLEV or SPRAY_TO_REGION is enabled, those requests still collapse onto a single backend VM, leaving it at 100% CPU.SPRAY_TO_REGION improves regional zone balance at the cost of higher inter-zone network traffic and potential egress charges.CLIENT_IP, the load balancer already uses MAGLEV as the implied default localityLbPolicy, so explicitly setting MAGLEV changes nothing.CLIENT_IP affinity cannot distinguish individual clients sitting behind an intermediate proxy or NAT device.All clients had unique, un-NATted public IP addresses, the workload had no cacheable static assets, and uneven load was strictly caused by second-layer GFEs favoring backends in a single local zone (WATERFALL_BY_REGION).
Zonal distribution policies address regional imbalances between zones, but they cannot override the pinning effect of 2-tuple IP hashing when a small number of NAT IP addresses generate a disproportionate share of traffic.
NONE session affinity, and route stateful requests to a separate backend service using GENERATED_COOKIE session affinity with the RATE balancing mode.In Google Cloud Load Balancing, session affinity is configured per backend service rather than per backend instance, while a URL map can direct different request paths to separate backend services. Pairing Cloud CDN with a NONE session affinity backend service for static assets and cookie-based session affinity (GENERATED_COOKIE) with the RATE balancing mode for stateful traffic aligns each workload with optimal routing behavior.
CLIENT_IP with GENERATED_COOKIE assigns each client browser or session a unique GCLB cookie. Even when thousands of users share a single corporate NAT or carrier proxy IP address, their cookies hash to different backend VMs, preventing single-instance overload.UTILIZATION to the RATE balancing mode prevents fluctuating CPU metrics from unpredictably shifting backend fullness and breaking session affinity.NONE session affinity allows Google Front Ends (GFEs) at the network edge to cache and serve static objects directly, dramatically lowering round-trip latency and shielding origin VMs.MAGLEV: Enabling GENERATED_COOKIE automatically defaults the locality policy to MAGLEV for even per-client distribution.Unlike solutions that retain CLIENT_IP or keep static files behind a stateful origin, splitting backend services at the URL map resolves both the hot-instance bottleneck caused by shared NAT IP addresses and the latency penalty of uncached static content.
STRONG_COOKIE_AFFINITY, change the balancing mode to RATE, and disable Cloud CDN so session cookies are always processed by the origin.Stateful cookie-based session affinity (STRONG_COOKIE_AFFINITY) encodes the identity of a specific backend instance directly inside an HTTP cookie returned in the Set-Cookie header. Because the cookie explicitly identifies the target VM, affinity remains intact even when autoscaling or autohealing adds or removes other instances in the managed instance group.
STRONG_COOKIE_AFFINITY works with any localityLbPolicy and balancing mode and is unaffected when new instances scale up.The application served exclusively dynamic, uncacheable, and highly stateful traffic that required strict session persistence across frequent MIG autoscaling events, with no static assets to offload to a CDN.
While STRONG_COOKIE_AFFINITY effectively solves the corporate NAT hotspot problem by identifying individual client sessions via cookies rather than source IP, failing to separate static media into a Cloud CDN-enabled backend service leaves edge latency and origin load unoptimized.
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