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 deploying a stateful HTTPS web application on Compute Engine managed instance groups for global users. Many users connect behind shared corporate NAT gateways, sharing the same public source IP address.
The solution must meet these requirements:
Which load balancer and session affinity configuration should you implement?
Generated cookie session affinity (GENERATED_COOKIE) is a Layer 7 persistence mechanism supported by Google Cloud Application Load Balancers. On a client's initial HTTP response, the load balancer automatically injects a cookie named GCLB (for Global external and Classic Application Load Balancers) or GCILB (for Regional external and Internal Application Load Balancers) in the Set-Cookie header with a path of /. When the browser includes this cookie in the Cookie request header on subsequent calls, the load balancer maps the cookie value to the same backend VM.
GCLB cookie without requiring you to define a custom cookie name or modify client applications to inject custom HTTP headers.GENERATED_COOKIE affinity requires backend instance groups to use the RATE balancing mode and the backend service's localityLbPolicy to use MAGLEV (the implied default when session affinity is enabled) or RING_HASH.affinityCookieTtlSec values from 0 to 1,209,600 seconds (up to two weeks), where 0 omits the Expires attribute so browsers treat it as a session cookie.MAGLEV or RING_HASH to map cookie indices consistently to healthy backend instances./, it applies seamlessly across backend services on the same URL map that use generated cookie affinity.Unlike CLIENT_IP, GENERATED_COOKIE prevents traffic skew when users share a NAT IP address. Unlike HEADER_FIELD, it requires no custom client-side headers. Finally, an Application Load Balancer is required because Layer 4 Network Load Balancers cannot inspect or issue HTTP cookies.
Header field session affinity (HEADER_FIELD) is a Layer 7 routing option on Global and Regional Application Load Balancers that directs requests to backends by hashing the value of a specified HTTP request header defined in consistentHash.httpHeaderName. Requests sharing the same header value are routed to the same backend VM as long as the backend remains healthy and within capacity.
HEADER_FIELD affinity is only supported when localityLbPolicy is set to RING_HASH or MAGLEV. Setting localityLbPolicy to ROUND_ROBIN violates the configuration requirement because round-robin distribution does not perform consistent hashing on custom HTTP headers.HEADER_FIELD stickiness can break if backend instances are added or removed via autoscaling or fail health checks.Set-Cookie headers to browsers.The application served non-browser API or mobile clients that could not store HTTP cookies, those clients already attached a unique identifier header (such as X-User-Group-ID) to each request, and the backend service configured localityLbPolicy as MAGLEV or RING_HASH instead of ROUND_ROBIN.
An External proxy Network Load Balancer is a Layer 4 reverse proxy that terminates TCP or SSL/TLS connections from external clients and opens new TCP connections to backend VMs. Because it operates at the transport layer rather than the Layer 7 HTTP application layer, it forwards byte streams without parsing HTTP methods, paths, headers, or cookies.
NONE (a 5-tuple or 3-tuple hash) and CLIENT_IP (a 2-tuple hash) session affinity. GENERATED_COOKIE is an HTTP-layer feature supported exclusively by Application Load Balancers.GCLB cookie into a Set-Cookie header or read a Cookie header on subsequent requests.CLIENT_IP) relies on source IP addresses, meaning users behind a shared corporate NAT gateway would all hash to the same backend VM.PROXY_V1) rather than HTTP X-Forwarded-For headers to pass original client connection metadata to backends.CONNECTION and UTILIZATION balancing modes rather than the RATE (requests per second) mode required by GENERATED_COOKIE affinity.The workload used a raw TCP or SSL protocol rather than HTTPS, clients connected from unique IP addresses without shared NAT gateways, and CLIENT_IP session affinity was configured on the proxy Network Load Balancer.
Client IP session affinity (CLIENT_IP) is a hash-based session persistence option supported across Application Load Balancers and Network Load Balancers. It creates a 2-tuple hash from the packet's source IP address and destination IP address so that all requests arriving from the same client IP address are forwarded to the same backend VM while that backend remains healthy and below capacity.
UTILIZATION: Using the UTILIZATION balancing mode causes backend group fullness to fluctuate dynamically based on VM CPU or resource usage. When a backend group reaches its utilization threshold, the load balancer spills requests to other groups and breaks session affinity; RATE (or CONNECTION on Network Load Balancers) is recommended to minimize these breaks.NONE (which hashes a 5-tuple including source port), CLIENT_IP omits port numbers so multiple browser connections from one IP still map to the same backend.CLIENT_IP relies on MAGLEV or RING_HASH to maintain consistent backend mappings.CLIENT_IP mappings.Clients connected directly using distinct IP addresses rather than shared corporate NAT gateways, cookies were unavailable or unsupported, and the backend instance group used RATE balancing mode for predictable capacity limits.
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