Prepare and test your skills

Prepare and test your skills

Free sample question, answered and explained below. The Professional Data Engineer practice bank has 1,353 more like it. Try 10 free: instant score, no account.
Your data engineering team manages cloud data infrastructure—including BigQuery datasets, Cloud Storage buckets, and Dataflow pipelines—across dev and prod environments on Google Cloud. You need to implement a continuous integration and continuous deployment (CI/CD) GitOps workflow using Terraform and Cloud Build that meets the following requirements:
How should you structure your Terraform configuration, state storage, and Cloud Build triggers?
terraform init and terraform plan on feature branch pull requests as required status checks, and run terraform apply only on merges to the dev and prod branches targeting their respective environment directories.This solution implements a declarative GitOps pipeline using Cloud Build and Terraform configured with a Cloud Storage (GCS) remote backend across isolated environment branches and directories.
backend "gcs") automatically provides state locking to prevent concurrent modification race conditions. Defining distinct prefixes (e.g., prefix = "env/dev" and prefix = "env/prod") separates environment state files, while enabling Object Versioning on the bucket maintains an audit history and provides recovery points against accidental state corruption.terraform init and terraform plan against environment subfolders. Configuring these builds as required status checks under branch protection rules ensures that syntax errors or unintended infrastructure mutations are caught before code is merged.terraform apply is strictly restricted to pushes/merges onto the designated dev and prod branches. Infrastructure is first tested in dev, and promoting the tested code via a pull request from dev to prod triggers the production terraform apply against the production environment directory.This pattern establishes an automated, repeatable, and secure workflow. It prevents unauthorized live changes, ensures code peer reviews include plan outputs, and cleanly separates environment state without managing complex external orchestrators.
terraform.tfstate files directly within Git feature and environment branches. Configure Cloud Build triggers to execute terraform apply -auto-approve immediately whenever any commit is pushed to a feature branch, and delete the state file after deployment.This option relies on storing Terraform local state files (terraform.tfstate) directly inside the Git repository and executing terraform apply automatically on every commit pushed to feature branches.
terraform apply on unmerged feature branches deploys speculative, unreviewed changes directly into live infrastructure, completely bypassing promotion gates and peer reviews..gitignore.You were running a single-user proof-of-concept on a local machine with no persistent cloud infrastructure or automated CI/CD pipeline requirements.
terraform apply whenever a developer pushes commits to their local workstation branch.This approach attempts to use Cloud Deploy with Skaffold to orchestrate Terraform execution, persists Terraform state onto Compute Engine persistent disks, and triggers deployments via Cloud Functions on local Git workstation pushes.
You were deploying containerized microservices to Google Kubernetes Engine (GKE) clusters through a release and rollout promotion sequence.
terraform apply simultaneously against both dev and prod directories whenever a pull request is created.This approach uses a single shared Cloud Storage path/prefix across environments and configures Cloud Build to run terraform apply simultaneously across both dev and prod environments as soon as a pull request is submitted.
dev and prod causes the environments to overwrite each other's state data, leading to severe state corruption and resource destruction.You were deploying an immutable single-tier environment where development and production architectures are unified into a single global deployment without lifecycle stages.
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