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 migrating a microservices application to Google Kubernetes Engine (GKE) across separate development, staging, and production clusters. You need to configure an automated CI/CD workflow using Cloud Build and Artifact Registry that meets the following requirements:
Which CI/CD workflow pattern should you implement?
$SHORT_SHA, validate it with Container Structure Tests, store it in Artifact Registry using the images field, and create a Cloud Deploy release to promote the immutable image across staging and production GKE clusters with externalized configuration.This pattern separates continuous integration (CI) and continuous delivery (CD) into a cohesive, automated pipeline. Cloud Build automatically compiles, tests, and packages source code into an immutable container image stored in Artifact Registry, while Cloud Deploy manages progressive, repeatable releases of that exact artifact across multiple GKE environments.
$SHORT_SHA substitution tags each image with the seven-character Git commit SHA, while specifying the images field ensures the pushed artifact is officially recorded in Cloud Build results and provenance metadata.images field enables build provenance tracking and SLSA compliance.Unlike rebuilding per branch or relying on mutable tags like latest, the build-once, promote-everywhere model eliminates variance across environments. Combining automated structure testing, commit-based tagging, Artifact Registry storage, and managed delivery with Cloud Deploy provides the most reliable and repeatable GKE deployment lifecycle.
docker push step without the images field, and deploy static manifests to all GKE clusters using kubectl.This configuration uses a Cloud Build trigger to execute unit tests, builds a Docker image tagged with the Git branch name (such as main), uploads it via an explicit docker push build step without declaring the images field, and runs kubectl against static manifests across GKE clusters.
$SHORT_SHA. Furthermore, using docker push without the images field prevents Cloud Build from displaying the stored image in build results.kubectl does not automatically pin images by immutable digest or enforce progressive staging-to-production promotion.images field in cloudbuild.yaml, built containers do not appear on the Google Cloud console Build description page or in gcloud builds list outputs.kubectl commands lack built-in release tracking and approval gates across environments.You only needed a lightweight, single-environment development script where recording artifacts in Cloud Build results, validating container structure, and promoting immutable digests across stages were unnecessary.
Although docker push can upload images during a build step, declaring the images field in cloudbuild.yaml is essential when you want Cloud Build to track the artifact in build results and generate build provenance metadata.
pack build, bake environment-specific configuration files into separate staging and production container images, push both images to Artifact Registry with semantic version tags, and deploy them using gke-deploy.This method uses the local Pack CLI (pack build) with Cloud Native Buildpacks on a developer workstation to assemble container images without a Dockerfile, embeds environment-specific config files directly inside separate staging and production images, pushes them to Artifact Registry, and deploys with gke-deploy.
pack build locally bypasses Cloud Build triggers, meaning builds are manual, depend on local machine state, and are not recorded in Cloud Build results.gke-deploy rightly resolves tags to digests and waits for resource readiness, it cannot compensate for producing separate, non-identical images per environment.A developer wanted to rapidly prototype and test a buildpacks container image locally before committing code, rather than establishing an automated, team-wide CI/CD pipeline.
When using buildpacks in an automated pipeline, you can invoke them remotely via Cloud Build (gcloud builds submit --pack or a pack step in cloudbuild.yaml) and keep runtime settings externalized in Kubernetes ConfigMaps or Secrets so one immutable image serves every environment.
latest, and apply Kubernetes manifests directly using the kubectl builder.This approach configures independent Cloud Build triggers on environment-specific Git branches (staging and production), recompiling and repackaging the container image separately for each branch, overwriting a single latest tag in Artifact Registry, and pushing raw manifests via the kubectl builder.
latest tag breaks the one-to-one mapping between a running container and the exact Git commit SHA that produced it.latest makes rollbacks difficult because Kubernetes nodes may cache stale layers or pull unintended versions.kubectl lacks managed release history, stage approvals, and progressive promotion across GKE clusters.The team were only prototyping in an isolated sandbox environment where strict artifact immutability, staging-to-production parity, and commit-level auditability were not required.
A common misconception is that merging code between staging and production branches guarantees identical behavior when rebuilt. In practice, time gaps between builds can cause base image updates or package manager shifts unless a single immutable image is built once and promoted.
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