Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Network Engineer practice bank has an additional 2,437 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are managing a global external Application Load Balancer for a stateful e-commerce application that stores shopping cart data in local backend memory. Your team configures an A/B test using a URL map routeRule with weightedBackendServices to split traffic:
checkout-v1: weight 90checkout-v2: weight 10Both backend services are configured with sessionAffinity: HTTP_COOKIE, localityLbPolicy: RING_HASH, and a consistentHash cookie configuration. All backend instances are healthy and well below target capacity, yet users intermittently lose their shopping cart state mid-session because requests switch between checkout-v1 and checkout-v2.
What is causing this behavior, and how should you resolve it?
UTILIZATION to RATE and switch sessionAffinity from HTTP_COOKIE to GENERATED_COOKIE with a non-zero affinityCookieTtlSec.The RATE balancing mode directs traffic to backend instance groups or NEGs based on requests per second rather than VM CPU UTILIZATION. GENERATED_COOKIE is a sessionAffinity type where the Application Load Balancer automatically generates and inserts its own session cookie on the first response so subsequent requests with that cookie return to the same backend endpoint.
HTTP_COOKIE, GENERATED_COOKIE is a backend-service-level traffic policy. Because weightedBackendServices in the URL map takes precedence over backend service session affinity, requests will continue to split 90%/10% between checkout-v1 and checkout-v2.UTILIZATION balancing mode can cause affinity breaks when an instance group becomes full and traffic overflows elsewhere, all backend instances in this scenario are healthy and well below target capacity.RATE or CONNECTION instead of UTILIZATION helps minimize unpredictable capacity-fullness transitions across multiple instance groups or NEGs within a single backend service.GENERATED_COOKIE (which issues a load-balancer-managed cookie) still requires RING_HASH or MAGLEV as the localityLbPolicy on global external Application Load Balancers and only maintains stickiness within one backend service.balancingMode nor affinityCookieTtlSec shares session state between checkout-v1 and checkout-v2.All stateful traffic already went to a single backend service spanning multiple instance groups, and session affinity was breaking intermittently because fluctuating CPU UTILIZATION caused one instance group to reach target capacity while others remained underutilized.
Even when GENERATED_COOKIE is configured with a persistent TTL, the URL map evaluates weightedBackendServices independently on every request before inspecting backend service session affinity settings.
checkout-v1 or checkout-v2.On Google Cloud Application Load Balancers, URL map routing rules and backend service traffic policies operate at two distinct stages of request processing. Weighted traffic splitting (weightedBackendServices) is a URL map routeAction evaluated first to select a destination backend service. Session affinity (consistentHash) is a backend service policy that only takes effect after the URL map has already chosen a backend service. Because weighted traffic splitting takes precedence over session affinity, every incoming request matching the weighted route rule is probabilistically assigned to checkout-v1 (90%) or checkout-v2 (10%) regardless of any session affinity cookie.
weightedBackendServices from the stateful route rule prevents the load balancer from re-evaluating the 90/10 split on every HTTP request.routeRules (where priority: 0 is highest and rules are evaluated sequentially) to match HTTP parameters such as request headers ensures all requests from a given client consistently route to the same backend service (checkout-v1 or checkout-v2).HTTP_COOKIE affinity and RING_HASH locality policy keep the user pinned to the same VM instance or NEG endpoint.routeRules are processed in priority order, allowing specific header-based A/B rules to override a default catch-all route.sessionAffinity, localityLbPolicy, and outlierDetection configuration.Unlike modifying consistent hashing algorithms, changing balancing modes, or enabling traffic mirroring, separating deterministic URL map version routing from backend service session affinity directly resolves the evaluation-order conflict between weightedBackendServices and sessionAffinity.
localityLbPolicy from RING_HASH to MAGLEV and increase consistentHash.minimumRingSize on both backend services, because MAGLEV is required for cross-service HTTP_COOKIE session persistence.MAGLEV and RING_HASH are consistent-hashing load balancing locality policies (localityLbPolicy) configured on a backend service to distribute requests across healthy VM instances or network endpoint group (NEG) endpoints. The minimumRingSize field under consistentHash controls the granularity of the hash ring used to map request attributes (such as an HTTP cookie) to individual backend endpoints.
HTTP_COOKIE: Global external Application Load Balancers fulfill HTTP_COOKIE session affinity when localityLbPolicy is set to either RING_HASH or MAGLEV. Switching from RING_HASH to MAGLEV provides no additional stickiness capability.localityLbPolicy and consistentHash only apply within a single backend service after the URL map selects it. Neither setting can prevent URL map weightedBackendServices from sending a user's next request to a different backend service.RING_HASH and MAGLEV map a hash key (like a cookie or header) to a specific healthy endpoint inside a single backend service's pool.minimumRingSize helps produce a more uniform distribution of requests across large backend pools and reduces cache misses, but does not coordinate routing across separate backend services.localityLbPolicy is evaluated.Traffic was already steered deterministically to a single backend service (without weightedBackendServices), and HTTP_COOKIE session affinity was being ignored because localityLbPolicy had been left at the default ROUND_ROBIN or RANDOM setting instead of RING_HASH or MAGLEV.
A common misconception is that consistent hashing policies can track sessions across multiple backend services in a URL map. In reality, each backend service owns an independent hash ring, and URL map weighted routing overrides backend-level stickiness.
checkout-v2 with a requestMirrorPolicy configured with mirrorPercent: 10.0 pointing to checkout-v2, while sending 100% of weighted traffic to checkout-v1.Traffic mirroring (requestMirrorPolicy) is an add-on URL map routeAction that duplicates incoming client requests and sends an identical copy to a designated mirror backend service (checkout-v2), while primary requests continue to be served by the selected backend service (checkout-v1). The optional mirrorPercent field specifies the percentage of requests (from 0 to 100.0) to mirror.
checkout-v2 to the client.checkout-v1, end users never interact with checkout-v2, making true A/B testing impossible.Your team needed to perform shadow testing or debug production issues by replaying 10% of live production traffic against checkout-v2 silently in the background without exposing end users to checkout-v2 responses or disrupting their checkout-v1 sessions.
Traffic mirroring is often confused with canary or A/B traffic splitting. Traffic splitting (weightedBackendServices) actively serves responses from multiple versions to users, whereas requestMirrorPolicy only duplicates requests for non-intrusive validation.
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