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 manages an e-commerce checkout service (checkout-svc) on Cloud Run, where revision checkout-svc-v1 currently serves 100% of production traffic. You have built a new container image for a redesigned checkout flow and need to manage the release with the following requirements:
checkout-svc-v2) with an isolated staging URL so QA can test it without affecting live users.checkout-svc-v1 and 20% to checkout-svc-v2.Which sequence of actions should you take?
checkout-svc-staging for isolated QA testing. After sign-off, run gcloud run services update-traffic checkout-svc --to-revisions=checkout-svc-v1=80,checkout-svc-staging=20 to split production traffic across both services, and delete checkout-svc-staging when the experiment concludes.Deploying checkout-svc-staging creates an entirely independent Cloud Run service with its own service URL, IAM policies, scaling limits, and revision history, separate from checkout-svc.
gcloud run services update-traffic command only manages revisions belonging to the same Cloud Run service. Passing a different service name (checkout-svc-staging) to --to-revisions on checkout-svc will fail because checkout-svc-staging is not a revision of checkout-svc.The organization required strict project-level or IAM isolation between staging and production environments and planned to route A/B traffic externally using a Cloud Load Balancer rather than Cloud Run's built-in traffic splitting.
Cloud Run's built-in revision tags (--tag) are specifically designed to provide isolated per-revision testing URLs within a single service, eliminating the need for duplicate staging services during release validation.
gcloud run deploy checkout-svc --image=IMAGE_URL --no-traffic --tag=staging --revision-suffix=v2 for isolated QA testing. After sign-off, run gcloud run services update-traffic checkout-svc --to-revisions=checkout-svc-v1=80,checkout-svc-v2=20 for the A/B test, and later run gcloud run services update-traffic checkout-svc --to-latest to restore default routing.Cloud Run creates an immutable revision every time you deploy a container image or update service configuration. Using revision tags and traffic splitting, you can control exactly which revisions receive live production traffic while exposing non-serving revisions on dedicated URLs for validation.
--no-traffic prevents the new revision (checkout-svc-v2) from receiving any production requests, leaving 100% of live traffic on checkout-svc-v1. Adding --tag=staging generates a dedicated tag URL (prefixed with staging---) that routes requests directly to checkout-svc-v2 for QA testing, while --revision-suffix=v2 ensures a predictable revision name.gcloud run services update-traffic with --to-revisions=checkout-svc-v1=80,checkout-svc-v2=20 configures Cloud Run to distribute incoming production requests according to the exact percentages specified (summing to 100%).--no-traffic and manual traffic splits pin routing away from the LATEST pointer, causing subsequent deployments to receive 0% traffic by default. Running gcloud run services update-traffic checkout-svc --to-latest rebinds 100% of traffic to the LATEST revision so future deployments serve traffic immediately.checkout-svc-v1.--revision-suffix simplifies automation and explicit traffic targeting in CLI commands.This workflow uses native Cloud Run traffic management within a single service, avoiding the overhead of maintaining duplicate services or external load balancers while cleanly transitioning from isolated staging to percentage-based A/B testing and back to standard continuous deployment.
gcloud run deploy checkout-svc --image=IMAGE_URL --tag=staging --revision-suffix=v2 so the tag isolates QA testing from production traffic. After sign-off, run gcloud run services update-traffic checkout-svc --to-revisions=checkout-svc-v1=80,checkout-svc-v2=20 for the A/B test, and later run gcloud run services update-traffic checkout-svc --to-latest to restore default routing.--tag without --no-traffic doesThe --tag flag attaches a named traffic tag to a Cloud Run revision, creating a dedicated URL for directly addressing that revision. However, --tag does not control or suppress the default production traffic routing behavior of a deployment.
checkout-svc currently routes traffic using default LATEST behavior, omitting --no-traffic causes gcloud run deploy to immediately shift 100% of live production traffic to the newly deployed checkout-svc-v2 revision as soon as it passes startup checks.staging--- URL, all real customer checkout requests would be routed to the unverified revision before QA sign-off occurs.--no-traffic is mandatory for dark launches: To deploy a revision that receives 0% of main service traffic when LATEST is active, you must explicitly include --no-traffic.update-traffic commands for the 80/20 split and --to-latest restoration are structurally correct, the initial deployment already violated the isolation requirement.A prior deployment had already pinned traffic away from LATEST (such as an active manual split or earlier --no-traffic deployment), though relying on prior state rather than explicitly passing --no-traffic is error-prone in CI/CD pipelines.
Always pair --tag with --no-traffic in deployment scripts when deploying a candidate revision intended strictly for pre-release validation.
gcloud run deploy checkout-svc --image=IMAGE_URL --no-traffic --tag=staging --revision-suffix=v2 for isolated QA testing. After sign-off, run gcloud run services update-traffic checkout-svc --to-revisions=checkout-svc-v1=80,checkout-svc-v2=20 for the A/B test, and then simply run gcloud run deploy for future releases since Cloud Run automatically resets traffic splits on new deployments.--to-latest after traffic splitting doesWhen you deploy with --no-traffic or configure a manual percentage split using --to-revisions, Cloud Run explicitly binds traffic percentages to named revisions rather than the dynamic LATEST target. Subsequent gcloud run deploy commands create new revisions but preserve the existing traffic split pattern.
gcloud run deploy without resetting traffic to LATEST will deploy a new v3 revision with 0% of production traffic. Production users would continue hitting checkout-svc-v1 (80%) and checkout-svc-v2 (20%) indefinitely.gcloud run services update-traffic checkout-svc --to-latest (or check the Serve this revision immediately option in the console) to restore automatic 100% traffic migration to newly deployed revisions.--no-traffic --tag=staging and --to-revisions 80/20 split) are configured properly, making the final step the critical flaw.The team wanted all future deployments to remain at 0% traffic by default so that every new release requires an explicit manual traffic promotion.
Understanding the lifecycle of traffic splits is essential in Cloud Run: once LATEST is unbound from 100% traffic, it stays unbound until --to-latest is executed.
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