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.
Your organization uses a global external Application Load Balancer (EXTERNAL_MANAGED) for api.example.com. You must configure its pathMatcher to satisfy these requirements:
/v2/{region}/catalog/{path=**} requests (where {region} is one segment) 90% to catalog-stable and 10% to catalog-canary, rewriting the path to /catalog/{path} while preserving query parameters./v2/ requests with header X-Chaos-Test: true exclusively to catalog-canary with an HTTP 503 abort on 25% of requests, taking precedence over canary routing./v2/ requests to catalog-stable and unmatched paths to backend bucket static-assets-bucket.Which URL map configuration should you implement?
defaultService to static-assets-bucket and configure routeRules with: priority: 10 matching prefixMatch: /v2/ to catalog-stable; priority: 20 matching pathTemplateMatch: /v2/{region}/catalog/{path=**} with weightedBackendServices (90/10) and urlRedirect.pathRedirect: /catalog/{path}; and priority: 30 matching prefixMatch: /v2/ and headerMatches (X-Chaos-Test: true) using faultInjectionPolicy.abort (httpStatus: 503, percentage: 25) to catalog-canary.This configuration places all rules inside routeRules and uses pathTemplateMatch alongside urlRedirect and faultInjectionPolicy, but reverses the priority ordering and substitutes a URL redirect for a URL rewrite.
0 is highest), not longest-path-matches-first. Because prefixMatch: /v2/ is assigned priority: 10, every request starting with /v2/ matches this rule first and routes immediately to catalog-stable, completely bypassing priority: 20 (canary) and priority: 30 (chaos testing).urlRedirect: urlRedirect returns an HTTP 3xx response with a Location header asking the client to issue a new request, rather than transparently rewriting the path before forwarding to backends. Furthermore, urlRedirect is mutually exclusive with routeAction (weightedBackendServices), so both cannot be combined in the same rule, and pathRedirect does not perform pathTemplateMatch variable substitution.routeRule matches a request, the load balancer stops evaluating all higher-numbered (lower-priority) rules.routeRule supports only one primary action: routing to a single service, splitting via weightedBackendServices, or returning a urlRedirect.routeAction.urlRewrite, not urlRedirect.The /v2/ catch-all rule had the highest numerical priority (priority: 30), the client needed an external HTTP 301/302 browser redirect instead of a transparent backend path rewrite, and no weightedBackendServices action was attached to the redirect rule.
Engineers familiar with simple pathRules often expect longest-path-matches-first behavior regardless of rule order. In routeRules, placing a broad prefixMatch at a low priority number is a frequent cause of unexpected 4xx/5xx errors or zero traffic on downstream rules.
defaultService to static-assets-bucket, add a pathRules entry for /v2/* to catalog-stable, and add routeRules with: priority: 10 matching prefixMatch: /v2/ and headerMatches (X-Chaos-Test: true) using faultInjectionPolicy.abort (httpStatus: 503, percentage: 25) to catalog-canary; and priority: 20 matching prefixMatch: /v2/*/catalog/* with weightedBackendServices (90/10) and urlRewrite.pathPrefixRewrite: /catalog/.This configuration attempts to combine simple path rules (pathRules) with advanced route rules (routeRules) inside a single pathMatcher, while using prefixMatch with asterisks (*) and pathPrefixRewrite to perform wildcard path stripping.
pathRules and routeRules cannot coexist within the same pathMatcher. A URL map must use either simple host and path rules (pathRules) or advanced host, path, and route rules (routeRules).prefixMatch: Within routeRules[].matchRules[], the prefixMatch field treats * as a literal asterisk character, not as a wildcard. Consequently, prefixMatch: /v2/*/catalog/* only matches URLs containing literal * characters and never matches paths like /v2/us/catalog/items.pathPrefixRewrite replaces only the static prefix matched by prefixMatch. It cannot capture a dynamic single-segment variable like {region} and preserve {path} while omitting {region}.pathRules vs. routeRules: Advanced features such as headerMatches, weightedBackendServices, and faultInjectionPolicy are only supported in routeRules, which must replace pathRules entirely in that pathMatcher.pathTemplateMatch using {name} (single segment) and {name=**} (remaining segments) operators.pathTemplateRewrite, which references variables defined in pathTemplateMatch.Simple static prefix routing without header matching, weighted splitting, or fault injection was needed, in which case pathRules alone could direct /v2/* to catalog-stable, or if routeRules were used exclusively with pathTemplateMatch and pathTemplateRewrite.
A common misconception is assuming prefixMatch supports glob-style * wildcards just like pathRules (paths: ['/v2/*']). In routeRules, * wildcards are only evaluated when using pathTemplateMatch.
defaultService to static-assets-bucket and configure routeRules with: priority: 10 matching prefixMatch: /v2/ and headerMatches (X-Chaos-Test: true) using faultInjectionPolicy.abort (httpStatus: 503, percentage: 25) to catalog-canary; priority: 20 matching pathTemplateMatch: /v2/{region}/catalog/{path=**} with weightedBackendServices (90/10) and urlRewrite.pathTemplateRewrite: /catalog/{path}; and priority: 30 matching prefixMatch: /v2/ to catalog-stable.URL map route rules (routeRules) enable advanced Layer 7 traffic steering and traffic actions on Google Cloud global external Application Load Balancers (EXTERNAL_MANAGED). Unlike simple pathRules, routeRules evaluate HTTP attributes—including paths, headers, and query parameters—in strict numerical priority order (where lower numbers represent higher priority) and apply actions such as weighted traffic splitting, URL rewrites, and fault injection.
priority: 10): Evaluating prefixMatch: /v2/ combined with headerMatches (X-Chaos-Test: true) first ensures any /v2/ request carrying the test header is intercepted before canary or fallback rules run. The routeAction directs 100% of matching traffic to catalog-canary while faultInjectionPolicy.abort returns HTTP 503 directly for 25% of requests.priority: 20): pathTemplateMatch: /v2/{region}/catalog/{path=**} captures {region} as a single path segment and {path=**} as all remaining segments. weightedBackendServices splits traffic 90/10 between catalog-stable and catalog-canary, while urlRewrite.pathTemplateRewrite: /catalog/{path} omits {region} and automatically preserves query parameters.priority: 30 and defaultService): Remaining /v2/ requests fall through to prefixMatch: /v2/ at priority: 30 and route to catalog-stable, while any unmatched path falls back to the pathMatcher's defaultService (static-assets-bucket).pathTemplateRewrite, query parameters are automatically split before rewriting and re-appended afterward.x-client-request-url and x-envoy-original-path headers so backends can inspect the original pre-rewrite URL.pathMatcher can route dynamic API paths to backend services and unmatched static paths to a Cloud Storage backend bucket.Using routeRules exclusively avoids invalid mixing with pathRules, orders rules cleanly from most specific (priority: 10) to broadest (priority: 30), and uses pathTemplateMatch/pathTemplateRewrite rather than literal prefixMatch or client-visible redirects.
defaultService to static-assets-bucket and configure routeRules with: priority: 10 matching pathTemplateMatch: /v2/{region}/catalog/{path=**} with weightedBackendServices (90/10) and urlRewrite.pathPrefixRewrite: /catalog/; priority: 20 matching prefixMatch: /v2/ and headerMatches (X-Chaos-Test: true) using faultInjectionPolicy.abort (httpStatus: 503, percentage: 25) to catalog-canary; and priority: 30 matching prefixMatch: /v2/ to catalog-stable.This configuration uses routeRules exclusively and correctly assigns priority: 30 to the /v2/ fallback rule, but reverses the priority between canary routing and chaos testing while pairing pathTemplateMatch with pathPrefixRewrite.
priority: 10 to pathTemplateMatch and priority: 20 to the X-Chaos-Test: true header rule violates the precedence requirement. Any request to /v2/us/catalog/items that includes X-Chaos-Test: true matches priority: 10 first, splitting traffic 90/10 between catalog-stable and catalog-canary without injecting the 25% HTTP 503 abort fault.pathPrefixRewrite): urlRewrite.pathPrefixRewrite only replaces the static prefix matched by prefixMatch; it cannot reference or reconstruct the {path} variable captured by pathTemplateMatch. Using pathTemplateMatch requires urlRewrite.pathTemplateRewrite: /catalog/{path}.pathPrefixRewrite pairs with prefixMatch, whereas pathTemplateRewrite must be used with a corresponding pathTemplateMatch on the same route rule.pathTemplateMatch (such as {region} and {path}) can be referenced or selectively omitted in pathTemplateRewrite.matchRules evaluate all conditions within a rule using logical AND, header-specific override rules must hold a lower priority number than overlapping path-only rules.The chaos-testing rule were assigned priority: 10, the canary rule were assigned priority: 20, and urlRewrite.pathTemplateRewrite: /catalog/{path} replaced pathPrefixRewrite: /catalog/.
In URL map YAML definitions, pathPrefixRewrite and pathTemplateRewrite are mutually exclusive fields under urlRewrite. Attempting to omit a middle path segment ({region}) while retaining trailing segments ({path}) is only possible with pathTemplateMatch and pathTemplateRewrite.
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