Google Cloud Professional Data Engineer · 18% practice allocation

Google Cloud Professional Data Engineer: Maintaining and automating workloads Practice Questions

5 free sample questions from the Maintaining and automating workloads domain, with answers and explanations. The full Professional Data Engineer bank has 252 questions across 5 domains. Questions are scenario-based and written from the official Google Cloud exam guide.

1.

Your organization runs multiple BigQuery batch jobs that load data from Cloud Storage, perform joins, and write results. Recently, you've noticed that some jobs fail intermittently with: 'Error: Cannot write to destination table, concurrent writes detected.' Which two approaches best resolve this without losing data or increasing latency?

  • A. Use BigQuery MERGE with WHEN MATCHED/NOT MATCHED clauses to idempotently upsert data rather than overwriting, and serialize writes at the application level if necessary✓ Correct
  • B. Enable BigQuery's concurrent slot reservation to prioritize write operations
  • C. Use BigQuery table snapshots to create read-only copies before each load, preventing concurrent write conflicts
  • D. Redesign the pipeline to write to separate intermediate tables per job, then use a final merge/consolidation step to combine results into the destination table✓ Correct
  • E. Implement a distributed locking mechanism (e.g., using Firestore or Cloud Datastore) to serialize writes to the destination table across jobs
Explanation

Options 3 and 4 are correct. Option 3 isolates writes by having each job write to a unique intermediate table, then a controlled merge step consolidates results. This is the cleanest solution and doesn't require external coordination. Option 4 uses MERGE semantics, which are idempotent and work well if writes are properly sequenced. Option 1 (snapshots) is read-only and doesn't solve write conflicts. Option 2 (external locking) adds operational complexity and latency—if not carefully implemented, it can cause deadlocks. Option 5 mentions concurrent slot reservation, which doesn't exist or doesn't address write conflicts (slot reservations control query capacity, not write serialization).

2.

You manage a Cloud Scheduler job that triggers a Cloud Run service every 5 minutes. The service submits Dataflow batch jobs. Recently, you've observed that Dataflow job submission is failing intermittently due to API quota limits. What is the best remediation without increasing infrastructure costs?

  • A. Reduce Cloud Scheduler frequency (e.g., every 15 minutes) and configure the Cloud Run service to submit multiple Dataflow jobs per invocation if the previous job completed
  • B. Deploy the Cloud Run service on Cloud Functions instead to reduce latency and avoid quota issues
  • C. Request a quota increase for Dataflow API submissions in the Google Cloud Console✓ Correct
  • D. Increase Cloud Scheduler frequency to every 1 minute to submit jobs more frequently
Explanation

Option 2 is correct. The issue is quota exhaustion, which happens when job submission frequency exceeds the API quota. Reducing submission frequency and batching multiple jobs per invocation keeps the submission rate below the quota without requesting increases. This is cost-effective and doesn't require external approvals. Option 1 (increasing frequency) worsens the problem. Option 2 (quota increase) is necessary but should be combined with option 2 to avoid recurring quota issues—increasing quota alone just defers the problem if traffic grows. Option 4 (Cloud Functions) doesn't solve quota issues; the bottleneck is Dataflow API, not Cloud Run.

3.

You manage a Cloud Composer DAG that processes customer data and writes results to BigQuery. A data quality check task fails periodically when input data is malformed. Instead of failing the entire DAG, you want to trigger a notification and continue with downstream tasks using a placeholder result. Which error handling pattern should you implement?

A) Set trigger_rule='all_done' on downstream tasks so they execute regardless of upstream failure B) Use trigger_rule='none_skipped' and wrap the failing task in a try-except block C) Set trigger_rule='none_failed' on the quality check task to prevent it from stopping the DAG D) Create a custom sensor that polls for data quality status and uses trigger_rule='none_failed_or_skipped' with a fallback BranchPythonOperator

  • A. Set trigger_rule='all_done' on downstream tasks so they execute regardless of upstream failure✓ Correct
  • B. Use trigger_rule='none_skipped' and wrap the failing task in a try-except block
  • C. Set trigger_rule='none_failed' on the quality check task to prevent it from stopping the DAG
  • D. Create a custom sensor that polls for data quality status and uses trigger_rule='none_failed_or_skipped' with a fallback BranchPythonOperator
Explanation

The correct answer is A. The trigger_rule='all_done' allows downstream tasks to run regardless of whether upstream tasks succeed or fail. Combined with an alerting task (e.g., sending a notification), this pattern lets the pipeline continue with a fallback path. Option B's none_skipped rule skips tasks only if previous tasks were skipped, not failed. Option C sets the rule on the failing task, not downstream—this doesn't solve the problem. Option D is overcomplicated; it uses sensor logic unnecessarily. A simple trigger_rule='all_done' on downstream tasks is the standard Airflow pattern for this scenario.

4.

Your organization runs nightly BigQuery batch jobs that cost significantly more than expected. You query the INFORMATION_SCHEMA to investigate. Which view should you query to find the top 10 most expensive queries by bytes billed in the past 7 days?

  • A. INFORMATION_SCHEMA.JOBS_BY_PROJECT, filtering on creation_time and ordering by total_bytes_billed DESC.✓ Correct
  • B. INFORMATION_SCHEMA.PARTITIONS, joining to INFORMATION_SCHEMA.TABLES and ordering by total_rows DESC.
  • C. INFORMATION_SCHEMA.TABLE_STORAGE, filtering on last_modified_time and ordering by total_logical_bytes DESC.
  • D. INFORMATION_SCHEMA.SCHEMATA, joining to INFORMATION_SCHEMA.JOBS and ordering by query_cost DESC.
Explanation

INFORMATION_SCHEMA.JOBS_BY_PROJECT contains one row per query job and includes fields such as total_bytes_billed, creation_time, user_email, and query text, making it the correct view for auditing query costs. Option C (TABLE_STORAGE) tracks storage consumption per table, not query execution costs. Option B (PARTITIONS) provides metadata about table partitions and row counts, not query billing. Option D is incorrect because INFORMATION_SCHEMA.SCHEMATA lists datasets, not jobs, and there is no query_cost column in that view.

5.

You have a Cloud Composer 2 DAG that processes data in stages: extraction, transformation, and loading into BigQuery. The transformation stage is resource-intensive and should only run if the extraction stage completes successfully. Currently, the DAG runs all stages in parallel, causing unnecessary compute costs when extraction fails. What should you do to optimize this?

A) Set the transformation task's pool to a lower priority than extraction B) Use the depends_on parameter in Airflow to create a dependency relationship C) Configure the extraction task with a pool limit of 1 D) Move transformation to a separate DAG that Cloud Scheduler triggers after extraction succeeds

  • A. Use the depends_on parameter in Airflow to create a dependency relationship✓ Correct
  • B. Configure the extraction task with a pool limit of 1
  • C. Set the transformation task's pool to a lower priority than extraction
  • D. Move transformation to a separate DAG that Cloud Scheduler triggers after extraction succeeds
Explanation

The correct answer is A. In Apache Airflow, task dependencies are explicitly defined using the depends_on parameter or the >> operator (e.g., extraction >> transformation >> loading). This ensures the transformation task waits for extraction to complete successfully before executing. Option C (pool priority) controls concurrency but doesn't establish a dependency relationship. Option B (pool limit) would serialize all extraction tasks, not create inter-stage dependencies. Option D is unnecessarily complex; there's no reason to move transformation to a separate DAG when Airflow natively supports task dependencies within the same DAG.

Test yourself across every Professional Data Engineer domain

The free Professional Data Engineer practice test mixes about 20 questions weighted like the exam. The full 252-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Maintaining and automating workloads study guide (Professional Data Engineer) →

Other Professional Data Engineer domains

← All Google Cloud Professional Data Engineer study resources