Courseiva

CCNA Data Pipeline Orchestration Questions

48 questions · Data Pipeline Orchestration · All types, answers revealed

1
MCQmedium

Your team runs a Cloud Composer 2 environment that processes financial data. A critical DAG must run exactly once per day at 02:00 UTC, and the Airflow scheduler must not backfill missed runs from the previous week when the DAG is unpaused. You need to configure the DAG so that only future scheduled runs execute. What should you set in the DAG definition?

A.Set catchup=True and use a TimeDeltaSchedule with timedelta(days=1).
B.Set start_date to the current date and schedule_interval=None in the DAG constructor.
C.Set max_active_runs=1 and schedule='0 2 * * *' in the DAG constructor.
D.Set catchup=False in the DAG constructor and define schedule='0 2 * * *'.
AnswerD

Setting catchup=False tells the Airflow scheduler to skip all historical intervals that elapsed before the DAG was enabled, so only runs from the current time forward are created. Combined with the cron expression '0 2 * * *', the DAG fires daily at 02:00 UTC without backfilling the previous week. This directly satisfies the requirement of no historical runs.

Why this answer

The requirement is a daily 02:00 UTC run with no historical backfill. In Cloud Composer, catchup=False suppresses the creation of runs for intervals that elapsed before the DAG was enabled, while the cron schedule controls future timing. Other parameters such as max_active_runs or start_date adjustments do not disable backfill, and schedule=None removes the automatic cadence entirely.

Exam trap

The trap here is assuming that changing start_date or limiting concurrency prevents backfill, when only catchup=False disables historical run creation.

2
MCQmedium

You are using Airflow with a Cloud Composer environment. You want to ensure that a specific task runs on a specific day of the week. How do you configure the schedule?

A.Set 'schedule_interval' using cron syntax.
B.Create a separate DAG for each day of the week.
C.Enable the 'weekday_only' flag in the DAG configuration.
D.Use the 'timedelta' object with a 7-day offset.
AnswerA

Cron syntax in `schedule_interval` accepts five fields, letting you pin execution to a specific weekday (for example `0 9 * * 1` for Monday 09:00). This directly satisfies the stem's requirement for a task running on a chosen day of the week, since Airflow parses the day-of-week field natively.

Why this answer

In Airflow (and thus Cloud Composer), the schedule of a DAG is controlled by the 'schedule_interval' parameter, which accepts cron expressions, timedelta objects, or presets like '@daily'. To run a task on a specific day of the week, you use a cron expression such as '0 0 * * 1' for every Monday. This is the standard, declarative way to define weekly schedules in Airflow.

Exam trap

GCP-ADP often tests the misconception that Airflow requires separate DAGs or special flags for weekly schedules, when in fact cron syntax within schedule_interval is the correct and flexible method.

How to eliminate wrong answers

Option B is wrong because creating a separate DAG for each day is an anti-pattern that duplicates code, complicates maintenance, and does not leverage Airflow's built-in scheduling. Option C is wrong because there is no 'weekday_only' flag in Airflow DAG configuration; scheduling is handled via schedule_interval, not a boolean flag. Option D is wrong because a timedelta with a 7-day offset only sets a fixed interval from the start date, not a specific day of the week, and it lacks the precision of cron for day-of-week targeting.

3
Multi-Selectmedium

Which TWO of the following are true about Workflows' serverless nature?

Select 2 answers
A.Requires a dedicated GKE cluster
B.Scales automatically
C.No infrastructure to manage
D.Is always free
E.Requires constant manual patching
AnswersB, C

Workflows scales automatically because it is a fully managed, serverless orchestration service: Google provisions and elastically adjusts the underlying compute as execution demand rises or falls. This satisfies the stem's serverless constraint, since you never size, patch or manage instances, and pay only per step executed rather than for idle capacity.

Why this answer

Option B is correct because Workflows is a fully managed serverless orchestration service that automatically scales its execution capacity with demand, so you never provision or size workers yourself. Option C is correct because, as a serverless offering, Google manages all underlying infrastructure — servers, scaling, and availability — leaving you with no infrastructure to manage. Option A is wrong because Workflows does not require a dedicated GKE cluster; it runs on Google-managed infrastructure and can call GKE-hosted services but does not depend on a cluster.

Option D is wrong because Workflows is not always free — it is billed per step executed, with a free tier only up to certain monthly limits. Option E is wrong because patching is handled by Google, not manually by the user, which is a core benefit of the serverless model.

Exam trap

GCP-ADP often tests the misconception that serverless always means free or that it requires some underlying cluster, confusing Workflows with GKE-based solutions like Argo Workflows.

4
MCQeasy

What is the primary function of the Airflow 'Executor' in Cloud Composer?

A.Serving the Airflow UI web pages.
B.Deciding how to distribute tasks to workers.
C.Storing the DAG file metadata.
D.Automatically scaling the GKE cluster.
AnswerB

The Executor determines how and where task instances run, distributing queued tasks across workers. In Cloud Composer, this satisfies the requirement to scale parallel task execution: the Celery Executor dispatches work to worker pods via a queue, while KubernetesExecutor launches a pod per task, directly controlling task-to-worker allocation.

Why this answer

The Executor in Airflow determines how tasks are distributed and run — it decides whether tasks execute locally, on Celery workers, on Kubernetes pods, or via other backends. In Cloud Composer, the executor configuration (CeleryExecutor or KubernetesExecutor) directly controls task distribution across the worker pool. This is the executor's core responsibility in the Airflow architecture.

Exam trap

GCP-ADP often tests whether candidates conflate Airflow components — the trap is attributing webserver, scheduler, or database responsibilities to the executor, when its sole job is task distribution.

How to eliminate wrong answers

Option A is wrong because serving the Airflow UI is the job of the webserver component, not the executor. Option C is wrong because DAG file metadata is stored in the Airflow metadata database (typically Cloud SQL in Composer) and managed by the scheduler, not the executor. Option D is wrong because GKE cluster autoscaling is handled by Composer's environment autoscaling and GKE's cluster autoscaler, not by the Airflow executor.

5
MCQmedium

You maintain a Cloud Composer 2 DAG that processes files as they land in Cloud Storage. Instead of polling, you want the DAG to start processing within seconds of a new object being created, and you want the trigger to be reliable even if the Composer environment is briefly restarting. Which approach should you use?

A.Create a Cloud Storage notification that publishes object events to a Pub/Sub topic, and run a sensor or triggerer-based component that starts the DAG when a message arrives.
B.Schedule the DAG to run every minute with a short interval and use a GCSObjectExistenceSensor to detect new files.
C.Configure an Object Lifecycle Management rule on the bucket that transitions new objects to Nearline storage, which signals the DAG to run.
D.Use a Cloud Scheduler job that calls the Airflow REST API to trigger the DAG every five minutes.
AnswerA

Cloud Storage can publish object change notifications to a Pub/Sub topic, which durably buffers events even if the Composer environment is temporarily unavailable. A consumer in the environment, such as a Pub/Sub sensor or an event-driven trigger, then starts the DAG as soon as a message is received, giving near-real-time start with resilience to brief outages.

Why this answer

Event-driven processing on Cloud Storage uses Pub/Sub notifications. Cloud Storage publishes object events to a topic, and a consumer in Cloud Composer starts the DAG when messages arrive. Pub/Sub retains messages during brief Composer restarts, so no events are lost.

Polling schedules, Cloud Scheduler intervals, and lifecycle rules do not provide low-latency, durable, per-object triggering.

Exam trap

The trap here is choosing a frequent polling schedule for near-real-time needs, when Pub/Sub notifications are the durable event-driven mechanism designed for this.

6
MCQhard

You are building a Workflows definition that calls a Cloud Run service and then passes the returned JSON payload to a Cloud Function. The Cloud Run response body is stored in a variable named result. Which syntax correctly passes that value as an argument in the subsequent call step?

A.args: body: ${"result"}
B.args: body: $result
C.args: body: ${result}
D.args: body: ${result.body}
AnswerC

In Workflows, the ${} syntax substitutes the value of a variable or expression into the step definition. Since result already holds the parsed JSON payload from the Cloud Run response, referencing ${result} passes that entire object as the body argument to the Cloud Function call. This is the documented way to chain outputs between steps without manual serialization.

Why this answer

Workflows uses ${...} to embed variable and expression values into YAML fields. When a previous step's response is assigned to a variable such as result, referencing ${result} substitutes that parsed JSON object directly into the next step's arguments. Omitting the braces, adding quotes, or inventing a body subfield all prevent the actual payload from being passed correctly.

Exam trap

The trap here is confusing the ${} expression delimiter with shell-style variable expansion or JSON string literals, which leads to passing text instead of the parsed object.

7
MCQmedium

Your Cloud Composer DAG includes a task that runs a long-running data export, and you have observed that the task sometimes exceeds the default Airflow worker pod timeout, causing the task to be killed and retried. You want to increase the allowed execution time for this task without affecting other tasks. What should you do?

A.Add a retry_delay and increase retries in the task's default_args.
B.Change the DAG's schedule_interval to run less frequently.
C.Increase the worker pod timeout in the Cloud Composer environment configuration.
D.Set the execution_timeout parameter on the specific task in the DAG.
AnswerD

Airflow's execution_timeout is a task-level parameter that overrides the default timeout for that task. Setting it on the long-running task allows it to run longer without changing the environment-wide worker timeout or affecting other tasks, directly solving the problem.

Why this answer

The execution_timeout parameter on an individual task sets the maximum runtime for that task, overriding any default. This is the correct way to extend time for a specific long-running task without altering global settings. Retries, schedule changes, and worker pod timeouts do not provide a targeted per-task timeout adjustment.

Exam trap

The trap here is confusing the Airflow task execution_timeout with the Cloud Composer worker pod timeout, which are different layers.

8
Multi-Selectmedium

Which THREE of the following are key benefits of using Cloud Composer for data orchestration?

Select 3 answers
A.Uses standard open-source Airflow
B.Automatic data transformation
C.Free tier for all users
D.Fully managed infrastructure
E.Integration with GCP services
AnswersA, D, E

Cloud Composer runs managed Apache Airflow, so existing DAGs, operators and plugins work unchanged, avoiding vendor lock-in and retraining. This directly satisfies the stem's orchestration benefit: teams port Python-defined workflows without rewriting them, and the open-source ecosystem supplies prebuilt operators for GCP services.

Why this answer

Option A is correct because Cloud Composer is built on the open-source Apache Airflow project, so users can author DAGs with standard Airflow operators, hooks, and Python APIs without vendor-specific rewrites. Option D is correct because Cloud Composer is a fully managed service: Google provisions and maintains the Airflow environment, including the scheduler, web server, workers, and database, plus upgrades and patching. Option E is correct because Cloud Composer provides native integrations with GCP services such as BigQuery, Cloud Storage, Dataflow, Dataproc, and Pub/Sub through built-in operators and connections.

Option B is not a key benefit of Composer itself, since transformation is performed by the tasks/services the DAGs invoke rather than by the orchestration layer. Option C is incorrect because Cloud Composer is not free for all users; it is a paid service billed for the environment's underlying compute, storage, and networking resources.

Exam trap

GCP-ADP often tests whether candidates recognize that Composer is managed orchestration, not a transformation engine — the trap is selecting 'automatic data transformation' as a benefit.

9
MCQeasy

In Cloud Composer, what is the default behavior if a DAG execution takes longer than the 'dagrun_timeout' setting?

A.The DAG enters a 'running' state indefinitely.
B.The DAG run is paused.
C.The scheduler automatically restarts the DAG.
D.The DAG run is marked as failed.
AnswerD

Exceeding `dagrun_timeout` causes the scheduler to mark the DAG run as failed and terminate its running tasks, satisfying the stem's requirement for default behaviour without extra configuration. This differs from task-level `execution_timeout`, which fails only the individual task rather than the whole DAG run.

Why this answer

In Cloud Composer (Apache Airflow), if a DAG run exceeds the dagrun_timeout setting, the scheduler marks the DAG run as failed. This prevents stuck runs from consuming resources indefinitely and allows alerting or retry logic to kick in.

Exam trap

GCP-ADP often tests the distinction between dagrun_timeout (marks the DAG run failed) and task-level execution_timeout or SLA miss, causing candidates to choose 'paused' or 'restarted' instead of 'failed'.

How to eliminate wrong answers

Option A is wrong because the DAG run does not remain in a running state indefinitely — dagrun_timeout exists precisely to terminate long-running runs. Option B is wrong because pausing is a manual or scheduled state, not the automatic behavior when a timeout is exceeded. Option C is wrong because the scheduler does not automatically restart the DAG; it marks the run as failed, and any retry must be configured separately (e.g., via retries on tasks or a new DAG run).

10
MCQhard

A Cloud Composer environment is experiencing high latency in the Airflow UI. What is a common cause and mitigation for this?

A.Excessive DAG complexity; optimize/simplify DAG code.
B.GKE node power failure; restart cluster.
C.Too many users logged in; force logout.
D.Browser cache; clear your local cache.
AnswerA

Complex DAGs with many tasks, dependencies, or heavy parsing increase scheduler and webserver load, causing UI latency. Simplifying DAG code reduces the parsing and scheduling overhead, directly mitigating the slow Airflow UI in Cloud Composer.

Why this answer

Cloud Composer's Airflow UI (webserver) performance degrades when the scheduler and webserver must parse and render an excessive number of complex DAGs, tasks, and dependencies. Overly complex DAG code — deep task graphs, heavy top-level Python, dynamic task generation — increases parsing time and metadata DB load, which manifests as UI latency. Simplifying and optimizing DAG code (reducing task count, avoiding top-level DB calls, using static DAGs) is the standard mitigation.

Exam trap

GCP-ADP often tests whether candidates blame infrastructure (nodes, users, browser) for symptoms that are actually caused by application-level design, so the trap is overlooking DAG code complexity as the root cause of Airflow UI latency.

How to eliminate wrong answers

Option B is wrong because a GKE node power failure would cause environment failure or task errors, not gradual UI latency, and restarting the cluster is a disruptive non-fix. Option C is wrong because concurrent user logins are not a primary driver of Airflow UI latency; the webserver scales independently and user count rarely causes this symptom. Option D is wrong because browser cache is a client-side issue that would affect only one user, not the environment-wide latency described.

11
MCQmedium

You have a Cloud Composer 2 DAG that uses a PythonOperator to run a script that connects to a Cloud SQL database. The script needs a password. You want to avoid hardcoding the password in the DAG or in environment variables. What should you do?

A.Store the password in Secret Manager and use the Secret Manager Airflow operator or hook to retrieve it at runtime, granting the Composer service account the Secret Accessor role.
B.Use the Cloud Composer environment's Airflow metadata database to store the password in a custom table, and query it from the PythonOperator.
C.Define the password as an Airflow Variable in the Cloud Composer environment and reference it in the PythonOperator.
D.Store the password in a Cloud Storage bucket and have the PythonOperator download it using the Cloud Storage client library.
AnswerA

Secret Manager is the recommended service for storing sensitive data. By granting the Composer service account the Secret Accessor role, the DAG can retrieve the secret at runtime without hardcoding it. This follows security best practices and integrates natively with Cloud Composer.

Why this answer

Secret Manager is designed for storing, managing, and accessing secrets securely. By using the Secret Manager operator or hook, the DAG retrieves the password at runtime, and IAM controls access. Other options store secrets in less secure locations like Cloud Storage, the Airflow database, or Airflow Variables, which lack the necessary security controls.

Exam trap

The trap here is thinking Airflow Variables or environment variables are secure enough for secrets, when Secret Manager is the dedicated service with proper encryption and IAM.

12
Multi-Selectmedium

Which TWO of the following are best practices for managing Cloud Composer DAG dependencies?

Select 2 answers
A.Use plugins for shared code
B.Store DAGs in a database
C.Hardcode all configurations
D.Run all tasks in a single DAG file
E.Keep DAG files small
AnswersA, E

Shared code belongs in plugins rather than duplicated across DAG files. Plugins are deployed to the Composer environment's plugins folder and imported by DAGs, so common operators and helpers stay versioned in one place, avoiding drift between pipelines.

Why this answer

Option A is correct because Cloud Composer plugins let you package and reuse shared code (operators, hooks, sensors, and libraries) in a versioned, centrally managed way, avoiding duplication and drift across many DAGs. Option E is correct because keeping DAG files small and focused reduces parse time in the Composer scheduler, limits the blast radius of changes, and makes dependencies between DAGs easier to reason about and maintain. Option B is wrong because DAGs are Python files that belong in the Composer environment's dags/ folder (or a synced GCS bucket), not in a database.

Option C is wrong because hardcoding configurations is an anti-pattern; you should use Airflow Variables, Connections, environment variables, or secrets managers. Option D is wrong because cramming all tasks into a single DAG file creates a monolithic, hard-to-maintain DAG and does not reflect best practice for managing dependencies.

Exam trap

GCP-ADP often tests the misconception that DAGs can be stored in a database or that one giant DAG file is fine — both violate Airflow's file-based parsing model and hurt scheduler performance.

13
Multi-Selecthard

Which THREE of the following are valid methods for troubleshooting failed tasks in Cloud Composer?

Select 3 answers
A.Checking the Airflow web UI task state
B.Rebuilding the entire GKE cluster
C.Deleting the environment bucket
D.Examining scheduler logs
E.Reviewing task instance logs
AnswersA, D, E

The Airflow web UI shows each task instance's state, letting you identify failed, upstream_failed or retry states and open logs. Checking task state satisfies the stem's requirement for a valid troubleshooting method for failed tasks in Cloud Composer.

Why this answer

Option A is correct because the Airflow web UI shows each task instance's state (queued, running, success, failed, up_for_retry, etc.), letting you quickly identify which tasks failed and drill into their details. Option D is correct because the Composer scheduler logs record DAG parsing errors, scheduling decisions, and task-queueing problems, which are essential for diagnosing why tasks never ran or were stuck. Option E is correct because task instance logs capture the actual stdout/stderr from the task's execution, revealing the specific exception or failure cause.

Option B is not appropriate because rebuilding the entire GKE cluster is a drastic, disruptive action that destroys the environment rather than a troubleshooting step. Option C is not appropriate because deleting the environment bucket removes DAGs, logs, and data, causing data loss and breaking the environment instead of diagnosing the failure.

Exam trap

The trap is selecting destructive or irrelevant actions (rebuilding cluster, deleting bucket) as 'troubleshooting' — the exam expects you to know the non-destructive, diagnostic tools: UI state, scheduler logs, and task logs.

14
MCQmedium

You are orchestrating a pipeline with Workflows that invokes several Cloud Functions. You need to pass the output of one function as an argument to the next. What is the correct syntax?

A.Use global environment variables to store intermediate state.
B.Assign the call result to a variable and reference it in the next step.
C.Combine all function calls into a single synchronous block.
D.Write the output to a temporary GCS file and read it back.
AnswerB

Workflows steps reference prior outputs through variables assigned from call results, so storing the function's return value and passing it as an argument in the subsequent step satisfies the requirement to chain outputs between functions.

Why this answer

Workflows uses a YAML/JSON syntax where each step's return value can be assigned to a variable, and subsequent steps reference that variable using ${variableName} syntax. This is the idiomatic way to chain Cloud Functions and pass outputs forward. For example: 'call: http.post' with 'result: fn1Result', then the next step uses '${fn1Result.body}'.

Exam trap

GCP-ADP often tests whether candidates understand native orchestration primitives — the trap is over-engineering with external state stores (GCS, env vars) when Workflows already supports direct variable assignment from step results.

How to eliminate wrong answers

Option A is wrong because Workflows has no global environment variables for mutable intermediate state — environment variables are static configuration, not runtime data passing. Option C is wrong because combining calls into a single synchronous block defeats the purpose of orchestration and is not a supported Workflows pattern; steps are inherently sequential or parallel, not merged. Option D is wrong because writing to GCS and reading back is an anti-pattern that adds latency, cost, and complexity when Workflows natively supports variable assignment from step results.

15
MCQhard

You are using Cloud Composer to orchestrate a data pipeline. A critical task in your DAG is failing intermittently due to a known transient error in an external API. You want to automatically retry the task up to 5 times with a 2-minute delay between retries. Which Airflow feature should you configure to achieve this?

A.Configure a `SLA` (Service Level Agreement) with a timeout to force a retry.
B.Set `retries=5` and `retry_delay=timedelta(minutes=2)` in the task's default arguments.
C.Implement a custom operator that loops until success, with a sleep between attempts.
D.Use the `on_failure_callback` to trigger a new task run after a delay.
AnswerB

In Airflow, the `retries` parameter specifies the number of retry attempts, and `retry_delay` defines the wait time between retries. Setting these in the task's arguments or DAG default_args will automatically retry the task as specified, which is exactly what is needed for transient errors.

Why this answer

Airflow's built-in retry mechanism is configured via the `retries` and `retry_delay` parameters. These can be set at the DAG level (default_args) or per task. When a task fails, Airflow will automatically retry it after the specified delay, up to the maximum number of retries.

This is the standard way to handle transient failures.

Exam trap

The trap here is confusing failure callbacks or SLAs with retry mechanisms; only `retries` and `retry_delay` control automatic retries.

16
Multi-Selecteasy

Which TWO of the following are valid ways to trigger a Cloud Composer DAG?

Select 2 answers
A.Sending an email to the Airflow scheduler.
B.Clicking 'Run' in the Cloud Composer console environment list.
C.Airflow Web UI
D.Directly editing the DAG file in the bucket.
E.Airflow CLI
AnswersC, E

The Airflow web server exposes the DAGs page, where a run can be triggered manually via the Trigger DAG button. This satisfies the stem's requirement for a valid trigger method, since the web UI issues the same DagRun creation call the scheduler processes.

Why this answer

Option C (Airflow Web UI) is correct because Cloud Composer exposes the Airflow web server, and from the DAGs view you can manually trigger a DAG run using the 'Trigger DAG' (play) button, which creates a dag_run via the Airflow metadata database. Option E (Airflow CLI) is correct because Cloud Composer supports running Airflow CLI commands such as 'gcloud composer environments run ENVIRONMENT --location LOCATION dags trigger -- DAG_ID', which invokes the same scheduler-side trigger mechanism. Option A is wrong because the Airflow scheduler does not receive triggers by email; it only schedules DAG runs based on the DAG's schedule and metadata.

Option B is wrong because the Cloud Composer console environment list does not provide a 'Run' button to trigger a DAG; it only manages environments. Option D is wrong because editing the DAG file in the bucket merely updates the DAG definition and does not itself trigger a run.

Exam trap

GCP-ADP often tests whether candidates confuse the GCP Cloud Composer console (environment management) with the Airflow Web UI (DAG operations), leading them to pick the console 'Run' option that does not exist.

17
Multi-Selectmedium

You are designing a Cloud Composer 2 DAG that must process files as they arrive in a Cloud Storage bucket. You want to minimize latency and avoid unnecessary worker resource consumption. Which TWO approaches should you use? (Choose two.)

Select 2 answers
A.Configure the bucket to send object change notifications to a Pub/Sub topic, and use a Pub/Sub sensor in the DAG to wait for messages.
B.Schedule the DAG to run every minute with a cron expression and have it list the bucket for new files.
C.Use a Cloud Function triggered by Cloud Storage events to start a Cloud Composer DAG run via the Airflow REST API.
D.Use a Cloud Storage sensor that checks for new files at a fixed interval.
E.Increase the number of workers in the Cloud Composer environment to ensure sensors never block other tasks.
AnswersA, C

This is event-driven: the sensor waits for a Pub/Sub message and unblocks as soon as the event arrives, minimizing latency. It does not poll the bucket, reducing API calls and worker resource consumption. This is the recommended pattern for reacting to new files with low latency.

Why this answer

Both a Pub/Sub sensor and a Cloud Function triggered by Cloud Storage events provide event-driven reactions to new files, minimizing latency and avoiding polling. The Pub/Sub sensor uses native Airflow operators and no custom code, while the Cloud Function uses the Airflow REST API to trigger the DAG. Polling sensors or frequent scheduled runs add latency and waste resources.

Exam trap

The trap here is assuming that polling sensors or more workers solve latency and resource issues, when event-driven triggers are the correct way to react immediately without holding worker slots.

18
MCQeasy

Which Cloud Composer metric should you monitor to identify if your Airflow scheduler is struggling to parse your DAGs in a timely manner?

A.airflow_task_execution_time
B.dag_run_success_count
C.dag_processing_total_parse_time
D.scheduler_heartbeat
AnswerC

Monitoring `dag_processing_total_parse_time` directly exposes cumulative seconds Airflow spends parsing DAG files, so rising values reveal the scheduler falling behind on parsing. This satisfies the stem's constraint of identifying timely DAG parsing, unlike task-execution or queue metrics that ignore the parsing bottleneck entirely.

Why this answer

The dag_processing_total_parse_time metric measures the cumulative time Airflow spends parsing DAG files, which directly indicates whether the scheduler is struggling to keep up with DAG parsing. A rising or consistently high value signals that DAGs are too complex, too numerous, or inefficiently written, delaying task scheduling. This is the canonical Cloud Composer metric for diagnosing scheduler parse bottlenecks.

Exam trap

GCP-ADP often tests whether candidates can distinguish scheduler-health metrics (parse time, heartbeat) from task-execution metrics, so picking airflow_task_execution_time confuses symptom with cause.

How to eliminate wrong answers

Option A is wrong because airflow_task_execution_time measures how long individual tasks run, which reflects worker performance rather than DAG parsing. Option B is wrong because dag_run_success_count is a business-outcome metric tracking successful DAG runs, not scheduler parsing health. Option D is wrong because scheduler_heartbeat indicates whether the scheduler process is alive and emitting heartbeats, which detects crashes or hangs but not parsing performance degradation.

19
MCQeasy

You are deploying a Cloud Composer 2 environment and need to ensure that the DAG files are automatically synchronized to all workers. Where should you store these files?

A.Inside a Docker volume configured in the environment's YAML manifest.
B.In the local /home/airflow/gcs/dags directory of each worker node.
C.In the 'dags/' folder of the environment's bucket.
D.In a custom persistent disk attached to the Airflow scheduler.
AnswerC

Cloud Composer 2 continuously synchronises the 'dags/' folder of the environment's Cloud Storage bucket to every worker's local filesystem. Storing DAG files there guarantees automatic propagation, satisfying the requirement that all workers receive the DAGs.

Why this answer

In Cloud Composer 2, the environment's Cloud Storage bucket contains a 'dags/' folder that is automatically synchronized to all Airflow worker nodes (and the scheduler). Uploading DAG files to gs://<environment-bucket>/dags/ is the supported, automatic way to distribute DAGs, and Composer's built-in sync process pushes changes to every component.

Exam trap

GCP-ADP often tests that Composer DAG distribution is via the environment's GCS bucket 'dags/' folder, so candidates who think they must write to each worker's local filesystem or configure Docker volumes pick the wrong answer.

How to eliminate wrong answers

Option A is wrong because Docker volumes are not the mechanism Composer uses to distribute DAGs — Composer manages the Airflow containers, and users do not configure DAG distribution via Docker volumes in the environment YAML. Option B is wrong because /home/airflow/gcs/dags is the local mount point inside the worker where the GCS bucket is mounted; writing directly to a worker's local filesystem is ephemeral and not synchronized to other workers. Option D is wrong because attaching a custom persistent disk to the scheduler is not a supported Composer pattern and would not sync DAGs to workers.

20
Multi-Selectmedium

Which THREE of the following are valid Airflow connection types in Cloud Composer?

Select 3 answers
A.HTTP
B.Kubernetes Pod
C.Python
D.Google Cloud
E.Postgres
AnswersA, D, E

HTTP is a built-in Airflow connection type, used to define host, port, schema and credentials for REST endpoints. It is one of the connection types natively supported by Cloud Composer's Airflow environment, making it valid for this selection.

Why this answer

Option A (HTTP) is correct because Cloud Composer's Airflow connection types include 'HTTP', which stores host, schema, login, password, and port for calling REST endpoints via the HttpHook. Option D (Google Cloud) is correct because 'Google Cloud' is a built-in connection type used to store a GCP service account key or scopes, enabling operators like BigQueryInsertJobOperator and GCS hooks to authenticate. Option E (Postgres) is correct because 'Postgres' is a standard Airflow connection type that stores host, schema, login, password, and port for the PostgresHook and PostgresOperator.

Option B (Kubernetes Pod) is not a connection type; KubernetesPodOperator uses a 'Kubernetes' connection (or in-cluster config), not 'Kubernetes Pod'. Option C (Python) is not a connection type; Python callables are executed via the PythonOperator, and no 'Python' connection exists in Airflow's connection type list.

Exam trap

GCP-ADP often tests the distinction between Airflow connection types and operator types, causing candidates to confuse 'Kubernetes Pod' as a connection when it is actually an operator.

21
MCQhard

A Cloud Composer DAG is failing because the Airflow database is locking up during high-concurrency periods. What is the most effective way to address this?

A.Delete all past DAG run logs.
B.Increase the number of DAGs in the repository.
C.Scale up the Cloud Composer environment size to increase database resources.
D.Set the 'parallelism' parameter to a very high value.
AnswerC

Scaling the environment size increases the underlying Cloud SQL database tier, raising IOPS and connection limits so row-level locks clear faster under high concurrency. This directly addresses the database locking constraint, since Composer's metadata database scales with environment size rather than worker count.

Why this answer

Cloud Composer's Airflow metadata database (backed by Cloud SQL) is the bottleneck during high-concurrency DAG runs because every task instance, DAG run, and log entry writes to it. Scaling up the Composer environment size increases the Cloud SQL tier (CPU, memory, IOPS), which directly relieves database lock contention and connection saturation. This is the recommended remediation when the scheduler/DB cannot keep up with task state updates.

Exam trap

GCP-ADP often tests the misconception that tuning Airflow parameters like 'parallelism' fixes database lockups, when in fact increasing parallelism makes metadata DB contention worse and the correct fix is scaling the Composer environment.

How to eliminate wrong answers

Option A is wrong because deleting past DAG run logs only frees storage and does not reduce concurrent write contention on the metadata DB during active runs. Option B is wrong because adding more DAGs increases scheduler parsing load and DB writes, worsening the locking problem. Option D is wrong because raising 'parallelism' allows more concurrent task instances, which multiplies simultaneous writes to the Airflow metadata database and intensifies lock contention rather than relieving it.

22
MCQmedium

You are troubleshooting a stuck task in Cloud Composer. You want to see the stdout/stderr logs for that specific task attempt. Where can you find them?

A.In the 'logs/' folder in the environment's GCS bucket.
B.In the Airflow metadata database directly.
C.In the Cloud Composer environment console logs.
D.Via the 'kubectl' logs command on the worker pod.
AnswerA

Task attempt stdout/stderr is written by the Airflow worker to the environment's Cloud Storage bucket, under the logs/ prefix, in a path keyed by DAG, task and attempt. That per-attempt object satisfies the stem's requirement to inspect one specific stuck attempt, unlike Cloud Logging's aggregated streams.

Why this answer

In Cloud Composer, task logs (stdout/stderr) for each task attempt are stored in the environment's GCS bucket under the logs/ folder, organized by DAG and task. This is the canonical location for retrieving raw task output, especially for tasks that have completed or whose pods have been deleted.

Exam trap

The trap is assuming kubectl logs is the primary method — it works only for running pods, but Cloud Composer's design persists task logs to GCS, which is the correct answer for stuck or historical tasks.

How to eliminate wrong answers

Option B is wrong because the Airflow metadata database stores task state and metadata, not stdout/stderr logs. Option C is wrong because the Cloud Composer environment console shows environment-level logs (e.g., Airflow components), not per-task stdout/stderr. Option D is wrong because kubectl logs only works while the worker pod is still running; for stuck or completed tasks, the pod may be gone, and the logs are already archived in GCS.

23
MCQhard

You are designing a Cloud Workflows pipeline that calls a series of Cloud Functions. The output of the first function must be passed as an argument to the second function, and the output of the second to the third. You need to define the workflow in YAML. Which Workflows syntax correctly assigns the result of a function call to a variable and then uses that variable in a subsequent call?

A.- call: firstFunction output: firstResult - call: secondFunction args: input: ${firstResult}
B.- call: firstFunction result: firstResult - call: secondFunction args: ${firstResult}
C.- call: firstFunction result: firstResult - call: secondFunction args: input: ${firstResult}
D.- call: firstFunction result: firstResult - call: secondFunction input: ${firstResult}
AnswerC

In Workflows YAML, the 'result' keyword captures the return value of a call into a variable. Then, you can reference that variable in the 'args' of a subsequent call using the ${} syntax. This correctly passes the output of firstFunction to secondFunction as an argument named 'input'.

Why this answer

In Cloud Workflows, the 'result' keyword captures a call's return value into a variable. Subsequent calls can reference that variable within their 'args' block using ${}. This allows chaining outputs to inputs.

The correct syntax uses 'result' to store the output and then 'args' with a named parameter to pass it along.

Exam trap

The trap here is confusing the keyword for capturing output ('result') with other terms like 'output', and misplacing the variable reference outside the 'args' block.

24
MCQmedium

A Cloud Composer 2 task runs a Python script that performs a long-running data transformation and regularly exceeds the default worker pod timeout, causing tasks to be killed and marked as failed. The transformation cannot be shortened and must complete within a single task. What should you do to allow the task to run to completion?

A.Convert the task to use the KubernetesPodOperator with a larger machine type.
B.Set retries=5 and retry_delay=timedelta(minutes=10) on the task.
C.Change the task's queue to default and increase the environment's worker count.
D.Increase the execution_timeout and dagrun_timeout parameters on the task and DAG, and verify the Celery worker visibility timeout is sufficient.
AnswerD

In Cloud Composer 2, tasks run on Celery workers, and the worker visibility timeout controls how long a task can run before the broker considers it lost. Raising execution_timeout on the task, dagrun_timeout on the DAG, and the worker visibility timeout ensures the task is not prematurely killed. This directly addresses the timeout that is terminating the long-running transformation.

Why this answer

Long-running tasks in Cloud Composer 2 are bounded by Airflow execution timeouts and by the Celery worker visibility timeout used by the broker. Increasing execution_timeout and dagrun_timeout, and ensuring the worker visibility timeout is long enough, allows the transformation to finish in one attempt. Adding workers, retrying, or switching operator type does not extend the per-task runtime limit.

Exam trap

The trap here is assuming that retries or more workers solve a timeout, when the actual limit is the per-task execution and visibility timeout configuration.

25
MCQeasy

Which property in a Workflows YAML definition is required to define the entry point of the workflow?

A.main
B.entry_point
C.init
D.start
AnswerA

Workflows YAML requires a main block, which names the subworkflow executed first when the workflow runs. Without main, the definition has no defined entry point, so execution cannot begin; other blocks are only reachable once main calls them.

Why this answer

In Google Cloud Workflows YAML definitions, the 'main' property defines the entry point of the workflow — the first step that executes when the workflow runs. It is a required top-level field that names the starting step, and all other steps are reached via transitions from it.

Exam trap

The trap is assuming the entry point field follows naming conventions from other orchestration tools (entry_point, start, init) rather than the actual GCP Workflows schema, which uses 'main'.

How to eliminate wrong answers

Option B is wrong because 'entry_point' is not a valid Workflows YAML property; it is a term used in other systems (e.g., some orchestration tools) but not in GCP Workflows. Option C is wrong because 'init' is not a Workflows YAML property; it may be confused with initialization steps in other languages or tools. Option D is wrong because 'start' is not a valid Workflows property; while conceptually the workflow starts somewhere, the actual field name is 'main'.

26
MCQeasy

A data engineer needs a lightweight, serverless orchestrator on Google Cloud to run a sequence of HTTP calls to internal microservices, retry the calls a few times on failure, and expose the whole sequence as a single REST endpoint. The workflow must not require provisioning any cluster or VM. Which Google Cloud service should be used?

A.Dataflow
B.Cloud Composer
C.Workflows
D.Cloud Scheduler
AnswerC

Workflows is a fully managed, serverless orchestration service that runs YAML- or JSON-defined sequences of steps, including HTTP calls, with built-in retry policies and error handling. It exposes each workflow as an execution endpoint that can be invoked via the Workflows API, gcloud, or client libraries, and it requires no cluster or VM, matching every constraint in the scenario.

Why this answer

Workflows is the serverless orchestration product on Google Cloud and is purpose-built for sequences of steps such as HTTP calls with retries and error handling. It requires no cluster or VM, and each workflow can be executed through a REST endpoint. Cloud Composer is heavier and cluster-based, Cloud Scheduler only triggers jobs, and Dataflow is a data processing runner rather than a service orchestrator.

Exam trap

The trap here is conflating orchestration with scheduling, so a candidate may pick Cloud Scheduler even though it cannot chain steps or pass data between them.

27
Multi-Selectmedium

You are designing a Cloud Composer 2 DAG that must run a task only after a daily file has arrived in a Cloud Storage bucket. You want the DAG to avoid failing prematurely and to avoid consuming a worker slot while waiting. Which two approaches should you use? (Choose two.)

Select 2 answers
A.Configure the DAG's catchup parameter to True so missed runs backfill until the file appears.
B.Set the sensor's mode to reschedule so the task releases its worker slot between pokes.
C.Wrap a gsutil ls command in a BashOperator and rely on its non-zero exit code to retry the task until the file appears.
D.Use a TimeDeltaSensor set to 24 hours so the task always runs exactly one day after the DAG starts.
E.Use a GCSObjectExistenceSensor with the appropriate bucket and object parameters set from an Airflow variable.
AnswersB, E

Setting mode to reschedule makes the sensor task exit its worker slot between poke intervals and be rescheduled later, so a long wait does not block a worker. Combined with a GCSObjectExistenceSensor, this is the classic way to wait for a file without starving other tasks, and it is the pre-deferrable equivalent of deferring. Using mode poke instead would hold the slot continuously.

Why this answer

Waiting for an external file is a sensor use case. GCSObjectExistenceSensor checks for the object and succeeds only when it appears, and running the sensor with mode set to reschedule frees the worker between pokes so a long wait does not occupy a slot. Bash-based polling abuses retries, a fixed delay does not reflect file arrival, and catchup is unrelated to external event waiting.

Exam trap

The trap here is treating task retries or fixed delays as substitutes for a sensor, when sensors exist precisely to wait on external conditions without failing tasks.

28
MCQeasy

Which component of Cloud Composer acts as the primary interface for managing and triggering DAGs manually?

A.Cloud Storage Browser
B.Airflow Web Interface
C.Cloud Shell
D.BigQuery Console
AnswerB

The Airflow Web Interface (the Airflow UI served by the Composer web server) is the primary interface for inspecting, triggering and managing DAGs manually. The scheduler and workers execute DAGs but offer no manual trigger surface.

Why this answer

The Airflow Web Interface (the Airflow UI) is the primary interface in Cloud Composer for viewing, triggering, and managing DAGs manually. It provides DAG views, task logs, graph view, and manual trigger buttons.

Exam trap

GCP-ADP often tests the distinction between the Airflow UI (interactive management) and the GCS bucket (DAG deployment) — candidates who pick Cloud Storage Browser confuse where DAGs live with where they are managed.

How to eliminate wrong answers

Option A is wrong because Cloud Storage Browser is for managing the GCS bucket that backs the Composer environment (DAGs, plugins, data), not for triggering DAGs. Option C is wrong because Cloud Shell is a command-line environment where you can run gcloud or Airflow CLI commands, but it is not the primary UI for managing DAGs. Option D is wrong because BigQuery Console is for SQL queries and dataset management, unrelated to Airflow DAG orchestration.

29
MCQhard

In a Cloud Composer DAG, you need to trigger a BigQuery job that runs as a service account other than the one assigned to the GKE nodes. How should you implement this?

A.Hardcode the credentials in a JSON file inside the DAG folder.
B.Use the 'impersonation_chain' parameter in the BigQueryInsertJobOperator.
C.Change the worker node's identity in the Cloud Console.
D.Configure a connection with the 'Service Account Key' type in Airflow UI.
AnswerB

The impersonation_chain parameter makes the operator obtain short-lived credentials for a specified service account, so the BigQuery job runs under that identity rather than the node service account. This satisfies the stem's requirement to use a different service account.

Why this answer

The 'impersonation_chain' parameter is the native Airflow mechanism for a task to assume a different service account identity at runtime. When set on BigQueryInsertJobOperator, the operator calls the IAM Credentials API to generate short-lived access tokens for the target service account, so the BigQuery job executes under that SA's permissions rather than the Composer worker SA. This preserves least privilege without storing any long-lived secrets.

Exam trap

GCP-ADP often tests whether candidates know that Composer's recommended pattern for cross-identity execution is impersonation_chain rather than downloading and storing service account keys.

How to eliminate wrong answers

Option A is wrong because hardcoding service account JSON keys in the DAG folder exposes long-lived credentials in GCS and violates Google's key-management best practices. Option C is wrong because changing the GKE node identity affects every workload on the cluster, not just this DAG, and Composer manages node pools so manual identity changes are unsupported. Option D is wrong because the 'Service Account Key' connection type still requires a downloaded JSON key stored in Airflow, which is the exact anti-pattern impersonation_chain was designed to eliminate.

30
MCQmedium

Your organization uses Workflows to orchestrate multi-step API calls. You need to handle transient failures in a specific HTTP request by retrying it up to 5 times with exponential backoff. Which block should you use?

A.A 'loop' block with a counter increment.
B.An 'if' statement checking for 500 status codes.
C.A global 'exception' handler at the end of the workflow.
D.A 'try' block with a 'retry' policy.
AnswerD

Wrapping the HTTP call in a try block with a retry policy lets Workflows re-execute that step on transient errors, applying exponential backoff automatically. This satisfies the requirement of up to 5 retries on the specific request without affecting other steps in the orchestration.

Why this answer

Workflows provides a try/retry block where you can specify a retry policy with max_retries and a backoff (initial delay, multiplier, max delay), which is exactly the mechanism for retrying a transient HTTP failure up to 5 times with exponential backoff. The retry policy is attached to the try block and applies to the steps inside it.

Exam trap

GCP-ADP often tests the misconception that a loop or if-statement can implement retry with backoff — only the try/retry block provides native exponential backoff and retry semantics.

How to eliminate wrong answers

Option A is wrong because a loop with a counter manually re-implements retry logic and does not provide built-in exponential backoff or integration with Workflows' error semantics. Option B is wrong because an if statement checking for 500 status codes only branches on the response — it does not retry the call or apply backoff. Option C is wrong because a global exception handler catches errors at the end of the workflow but does not retry the specific failing step with a backoff policy.

31
MCQmedium

You are orchestrating a data pipeline in Cloud Composer 2. A task in your DAG downloads a large dataset from Cloud Storage and can take up to 45 minutes to complete, but it occasionally fails and needs to be retried. You want the task to automatically retry up to 3 times with a 5-minute delay between attempts. Which Airflow task parameter should you configure to achieve this?

A.sla=timedelta(minutes=5), retries=3
B.retries=3, retry_delay=timedelta(minutes=5)
C.execution_timeout=timedelta(minutes=45), retries=3
D.retry_exponential_backoff=True, max_retry_delay=timedelta(minutes=5)
AnswerB

The retries parameter specifies the number of retry attempts, and retry_delay defines the wait time between retries. Setting retries=3 and retry_delay=timedelta(minutes=5) ensures the task retries up to three times with a five-minute delay, matching the requirement exactly.

Why this answer

To configure automatic retries with a specific delay, you must set both the retries and retry_delay parameters on the task. The retries parameter controls how many times the task will be retried after failure, and retry_delay specifies the time to wait between attempts. Using retries=3 and retry_delay=timedelta(minutes=5) directly satisfies the requirement.

Exam trap

The trap here is assuming that setting retries alone is sufficient, but without explicitly setting retry_delay, the default delay (often 5 minutes) is used, which may not match the required delay if defaults are changed.

32
MCQmedium

Your team runs a Cloud Composer 2 environment where several DAGs import a shared internal Python library. After a library update, tasks begin failing with ModuleNotFoundError across all workers. You need the library to be installed automatically on every worker and scheduler node, including after autoscaling events. What should you do?

A.SSH into each worker pod and run pip install manually, then restart the Airflow scheduler.
B.Install the library using a PyPI package specified in the environment's Python dependencies configuration.
C.Upload the library as a zip file to a Cloud Storage bucket and reference it in the DAG's default_args.
D.Add the library to the dags/ folder and import it with a relative path from each DAG file.
AnswerB

Cloud Composer lets you declare PyPI packages as environment Python dependencies; these are installed on the scheduler, workers, and web server, and new worker pods created during autoscaling inherit the same environment, so the shared library is always available.

Why this answer

Declaring the shared library as a PyPI package in the environment's Python dependencies ensures it is installed consistently on the scheduler, web server, and all workers, including those created by autoscaling. Manual installs, DAG-folder copies, and Cloud Storage zip references do not integrate with the managed environment's package lifecycle, so they fail under scaling and recreation events.

Exam trap

The trap here is assuming that anything placed in the dags/ folder is importable as an installed Python package on every worker.

33
MCQhard

You are using Workflows to orchestrate a data pipeline that includes a step calling a Cloud Function. The Cloud Function returns a JSON payload with a field named 'result'. You need to pass this 'result' value to a subsequent step as an argument. How should you reference the output of the Cloud Function step in the Workflows YAML?

A.Use the syntax ${functionStep.body.result} to access the result field.
B.Use the syntax ${functionStep.response.body.result} to access the result field.
C.Use the syntax ${functionStep.result} to access the result field directly.
D.Use the syntax ${functionStep.output.result} to access the result field.
AnswerA

When a Workflows step makes an HTTP call, the response is stored in the step's result under the body property. To access a specific field from the JSON response, you use ${stepName.body.fieldName}. This correctly retrieves the 'result' value from the Cloud Function's JSON response.

Why this answer

In Workflows, the output of an HTTP call step is stored in the step's result under the body property. To access a specific field from the JSON response, you use the expression ${stepName.body.fieldName}. This is the correct way to pass data between steps, ensuring the 'result' value is correctly referenced.

Exam trap

The trap here is assuming that the response body is directly accessible without the body property, or confusing Workflows syntax with other Google Cloud services that use different response structures.

34
MCQhard

You want to dynamically generate tasks in an Airflow DAG based on the number of files in a GCS bucket. What is the standard way to do this?

A.Use the 'SubDagOperator'.
B.Configure an external metadata service to inject tasks.
C.Use the 'DynamicTaskGroup' operator in the Airflow library.
D.Use a Python loop inside the DAG file to instantiate tasks.
AnswerD

Airflow parses the DAG file at schedule time, so a Python loop over the bucket listing (via a hook or operator) instantiates one task per file. This is the standard dynamic task-mapping approach before Airflow's newer dynamic task mapping feature.

Why this answer

The standard way to dynamically generate tasks in Airflow based on external conditions (like the number of files in a GCS bucket) is to use a Python loop inside the DAG file. At DAG parse time, the loop runs and creates task instances dynamically based on the current state (e.g., listing files via a GCS hook). This leverages Airflow's core design: DAGs are Python scripts that are executed to build the task graph.

The loop can call an operator (e.g., PythonOperator, GCSToBigQueryOperator) for each file, generating tasks with unique task_ids. This pattern is widely documented and recommended for dynamic task generation, as long as the number of tasks is not excessively large and the DAG is idempotent.

Exam trap

GCP-ADP often tests the misconception that Airflow has a built-in operator for dynamic task generation, leading candidates to choose non-existent options like 'DynamicTaskGroup' or overcomplicate with SubDags, when the correct answer is the simple Python loop pattern.

How to eliminate wrong answers

Option A is wrong because SubDagOperator is used for grouping tasks into a sub-DAG, not for dynamically generating tasks based on external data; it also has known performance and scheduling issues and is deprecated in favor of TaskGroups. Option B is wrong because Airflow does not support injecting tasks via an external metadata service; the DAG definition must be in the DAG file, and while Airflow stores metadata in its own database, it does not allow external services to dynamically add tasks at runtime. Option C is wrong because there is no built-in 'DynamicTaskGroup' operator in the Airflow library; TaskGroups are static groupings, and dynamic task generation is achieved via Python loops, not a special operator.

35
Multi-Selecteasy

Which THREE of the following are common steps in a typical data pipeline orchestration pattern?

Select 3 answers
A.Validation
B.Network cable installation
C.Data ingestion
D.Transformation
E.Hardware provisioning
AnswersA, C, D

Validation checks data quality, schema conformance and completeness before downstream processing, satisfying the pipeline's need to catch corrupt or malformed records early. In orchestration patterns, it typically runs as a discrete task between ingestion and transformation, allowing failed batches to be quarantined rather than propagated, which protects subsequent stages from propagating errors.

Why this answer

In a typical data pipeline orchestration pattern, data ingestion (C) is a core step because it moves raw data from sources such as databases, APIs, or files into the pipeline for processing. Transformation (D) is also essential, as it cleanses, enriches, aggregates, or otherwise converts ingested data into a usable format for analytics or downstream systems. Validation (A) is a common pipeline step that checks data for schema conformance, completeness, quality, and business rules before or after transformation to prevent bad data from propagating.

Network cable installation (B) and hardware provisioning (E) are infrastructure or physical-layer tasks, not orchestration steps within a data pipeline workflow, so they are not correct.

Exam trap

GCP-ADP often tests the confusion between logical pipeline stages (ingest, validate, transform) and physical infrastructure tasks (cabling, hardware), tempting candidates to select infrastructure options that sound technical but are out of scope.

36
MCQmedium

Your team runs a Cloud Composer 2 environment with several DAGs that process data in Cloud Storage. You need to design a DAG that reliably handles transient failures when calling the Cloud Storage API. The DAG should retry failed tasks automatically without manual intervention, but you also want to avoid overwhelming the API during an outage. Which combination of Airflow features should you implement to achieve this?

A.Use a single task with a long timeout and rely on the Cloud Storage client library's internal retry mechanism.
B.Implement a custom operator that catches exceptions and sleeps for a fixed interval before re-executing the API call.
C.Configure the DAG to run on a schedule with a high number of max_active_runs, and let failed tasks be skipped.
D.Set retries and retry_delay on the DAG's default_args, and use exponential backoff with max_retry_delay.
AnswerD

Configuring retries and retry_delay in default_args ensures that failed tasks are retried automatically. Adding exponential backoff with max_retry_delay increases the wait time between retries, which prevents hammering the Cloud Storage API during an outage and gives it time to recover. This approach is standard for handling transient failures in Airflow DAGs.

Why this answer

Setting retries and retry_delay in default_args enables automatic retries for failed tasks. Exponential backoff with max_retry_delay spaces out retries increasingly, reducing load on the Cloud Storage API during an outage. This combination is the recommended way to handle transient failures in Airflow while avoiding API overload, and it requires no custom code.

Exam trap

The trap here is assuming that client library retries or custom sleep logic are sufficient, when Airflow's built-in retry and backoff settings provide more reliable and configurable handling.

37
MCQmedium

Your team uses Cloud Composer (Airflow) to run a daily ETL DAG. A task occasionally fails due to transient network errors when calling an external API. You want the task to retry automatically up to 3 times with a 5-minute delay between attempts, and you want the DAG to continue running other tasks even if this task ultimately fails. Which combination of Airflow task parameters should you configure?

A.Set retries=3, retry_delay=timedelta(minutes=5), and set the task's trigger_rule='all_failed'.
B.Set retries=3, retry_delay=timedelta(minutes=5), and set the task's trigger_rule='all_success'.
C.Set retries=3, retry_delay=timedelta(minutes=5), and set the task's downstream tasks to use trigger_rule='all_done'.
D.Set retries=3, retry_delay=timedelta(minutes=5), and trigger_rule='all_done' on the task.
AnswerC

This correctly configures the task to retry 3 times with a 5-minute delay. By setting downstream tasks to trigger_rule='all_done', they will execute even if the upstream task fails after retries. This allows the DAG to continue running other tasks, satisfying both requirements without altering the task's own trigger rule.

Why this answer

To handle transient failures, configure retries and retry_delay on the task. To allow the DAG to continue despite a task failure, set the downstream tasks' trigger_rule to 'all_done', which triggers them regardless of upstream success or failure. This combination ensures retries occur and subsequent tasks are not blocked, meeting both requirements.

Exam trap

The trap here is assuming that setting trigger_rule on the failing task itself will control downstream execution, when actually trigger_rule on downstream tasks determines their behavior.

38
Multi-Selectmedium

You are using Cloud Scheduler to trigger a Cloud Workflows execution every hour. You need to ensure that the scheduler authenticates to the Workflows API securely. Which two of the following are valid methods for authenticating Cloud Scheduler to Workflows? (Choose two.)

Select 2 answers
A.Use an API key associated with the Workflows API and include it in the request header.
B.Use an OAuth 2.0 client ID and secret stored in Cloud Scheduler's configuration.
C.Use an OAuth token generated for a service account that has the Workflows Invoker role.
D.Use an OIDC token generated for a service account that has the Workflows Invoker role.
E.Use a static username and password stored in Secret Manager and referenced by Cloud Scheduler.
AnswersC, D

Cloud Scheduler can also use OAuth tokens for authentication. By configuring an OAuth service account with the roles/workflows.invoker role, Cloud Scheduler will generate an OAuth access token and include it in the Authorization header. This is another valid and secure method for authenticating to the Workflows API.

Why this answer

Cloud Scheduler can authenticate to Workflows using either OIDC or OAuth tokens generated for a service account. The service account must have the Workflows Invoker role. These methods leverage Google Cloud IAM and avoid managing static secrets, making them secure and recommended.

API keys and basic auth are not supported for the Workflows API.

Exam trap

The trap here is assuming that API keys or basic authentication can be used, when Workflows requires IAM-based tokens from a service account.

39
MCQhard

Your Workflows definition calls three Cloud Run services in sequence. The second service occasionally returns HTTP 503 during cold starts, and you want Workflows to retry those specific failures with exponential backoff while treating HTTP 400 responses as permanent failures. How should you configure this?

A.Configure a Cloud Scheduler job to re-trigger the entire workflow whenever it fails.
B.Set the workflow-level execution timeout to a long value and rely on Cloud Run's own request retries to handle failures.
C.Add a retry block to the step with max_retries and a predicate that matches the 503 status code, and let 400 responses propagate as errors.
D.Wrap the second call in a try/except block and re-invoke it in the except handler until it succeeds.
AnswerC

A step-level retry block accepts max_retries, an interval with optional exponential backoff, and a predicate expressed in CEL that decides which responses are retryable. Matching only the 503 status means transient cold-start failures are retried, while a 400 response does not satisfy the predicate and is raised as a step error, which is exactly the desired distinction.

Why this answer

Workflows supports a retry policy on individual steps, including max_retries, an interval with exponential backoff, and a predicate written in CEL. By matching only the 503 status in the predicate, transient cold-start failures are retried while 400 responses fail immediately. Manual try/except loops, longer timeouts, and scheduler-based restarts do not provide the same targeted behavior.

Exam trap

The trap here is assuming Cloud Run retries failed requests on its own, when in fact the caller such as Workflows must implement the retry policy.

40
MCQeasy

Which command-line tool do you primarily use to deploy and manage Workflows?

A.gsutil
B.kubectl
C.gcloud
D.bq
AnswerC

The `gcloud` CLI provides the `gcloud workflows deploy` and `gcloud workflows run` commands, giving direct command-line control over Workflow deployment and execution. This satisfies the stem's requirement for a primary deployment and management tool, as Workflows is a Google Cloud service administered through the gcloud interface rather than a separate utility.

Why this answer

The gcloud CLI is the primary tool for deploying and managing Workflows, using commands like gcloud workflows deploy, gcloud workflows execute, and gcloud workflows describe. It authenticates via gcloud auth and integrates with all Workflows management APIs. This is the documented and supported interface for lifecycle operations.

Exam trap

GCP-ADP often tests tool-to-service mapping — candidates may pick gsutil or bq because they recognize 'gcloud-family' tools without matching the specific service.

How to eliminate wrong answers

Option A is wrong because gsutil is specifically for Cloud Storage bucket and object operations (copy, ls, rsync), not Workflows. Option B is wrong because kubectl manages Kubernetes clusters and resources, not Workflows executions. Option D is wrong because bq is the BigQuery command-line tool for datasets, tables, and queries — it has no Workflows functionality.

41
MCQhard

You need to run a Workflows execution based on a schedule. Which Google Cloud service is designed to manage this triggering?

A.Eventarc
B.Cloud Tasks
C.Cloud Scheduler
D.Pub/Sub
AnswerC

Cloud Scheduler is purpose-built for cron-style triggering, invoking Workflows executions on a defined timetable via HTTP targets. It satisfies the scheduling constraint directly, unlike Eventarc (event-driven) or Pub/Sub (message-based). Cloud Scheduler handles retries and time-zone-aware cron expressions, making it the designed service for time-based Workflows invocation.

Why this answer

Cloud Scheduler is Google Cloud's fully managed cron service, purpose-built to invoke HTTP endpoints, Pub/Sub topics, or App Engine routes on a defined schedule. Workflows exposes an HTTP trigger endpoint, so a Cloud Scheduler job can POST to that endpoint on a cron expression to start executions. This is the canonical, documented pattern for scheduled Workflows runs.

Exam trap

GCP-ADP often tests the distinction between event-driven triggers (Eventarc, Pub/Sub) and time-driven triggers (Cloud Scheduler) — candidates confuse Pub/Sub with a scheduler.

How to eliminate wrong answers

Option A is wrong because Eventarc is an event-routing service that reacts to CloudEvents from sources like Audit Logs or Cloud Storage — it has no native cron scheduling capability. Option B is wrong because Cloud Tasks is a queue for asynchronous task dispatch with rate/delay controls, not a time-based scheduler for arbitrary endpoints. Option D is wrong because Pub/Sub is a messaging bus; it can deliver a message that triggers Workflows, but it cannot itself generate the schedule — you would still need Cloud Scheduler to publish on a cron.

42
MCQhard

Your team needs to audit all modifications made to DAG files in the GCS bucket used by Cloud Composer. What is the most efficient way to achieve this?

A.Enable Data Access audit logs on the GCS bucket.
B.Enable 'Version History' in the Airflow UI.
C.Use Cloud Monitoring to alert on 'gcs_object_write' events.
D.Write a custom DAG to scan the bucket every minute.
AnswerA

Data Access audit logs on the GCS bucket record object-level operations, including reads and writes to DAG files, capturing who modified what and when. This satisfies the audit requirement without deploying additional tooling, making it the most efficient native mechanism.

Why this answer

Enabling Data Access audit logs on the GCS bucket is the most efficient way to audit all modifications made to DAG files because it automatically logs all object-level operations, including who modified what and when. This provides a comprehensive audit trail without requiring custom code or manual monitoring. Data Access audit logs capture both read and write operations, and can be exported to Cloud Logging for analysis and retention.

Exam trap

GCP-ADP often tests the difference between audit logs and monitoring alerts, and candidates may choose monitoring because it seems simpler, but monitoring does not provide the detailed audit trail required for compliance.

How to eliminate wrong answers

Option B is wrong because 'Version History' in the Airflow UI only tracks changes to DAG files within the Airflow environment, not modifications made directly to the GCS bucket, and it does not provide a detailed audit log of who made the changes. Option C is wrong because Cloud Monitoring alerts on 'gcs_object_write' events only notify you of writes but do not provide a detailed audit trail of all modifications, and setting up alerts is not an efficient way to audit all changes. Option D is wrong because writing a custom DAG to scan the bucket every minute is inefficient, does not provide real-time auditing, and would only detect changes after the fact without capturing who made them or other metadata.

43
MCQeasy

When configuring a Workflows execution, you want to ensure the workflow can be triggered by an HTTP POST request. Which feature allows this?

A.Executing the workflow via the REST API.
B.Configuring a Cloud Scheduler job with an HTTP target.
C.Enabling the 'HTTP Gateway' on the workflow itself.
D.Creating a Service Account with 'Public Access'.
AnswerA

Invoking the workflow through the REST API satisfies the HTTP POST trigger requirement, since Workflows exposes an execution endpoint that accepts POST requests carrying the workflow ID and runtime arguments. This lets external callers start executions directly over HTTP, matching the stem's constraint without needing an Eventarc or Pub/Sub intermediary.

Why this answer

Workflows executions can be triggered by an HTTP POST request using the Workflows REST API (executions.create endpoint). This allows external systems to start a workflow by sending an authenticated POST to the Workflows API with the workflow ID and input arguments.

Exam trap

GCP-ADP often tests the difference between the Workflows REST API (the actual trigger mechanism) and orchestration services like Cloud Scheduler or Eventarc that can call it, causing candidates to pick the scheduler instead of the API.

How to eliminate wrong answers

Option B is wrong because Cloud Scheduler can trigger a workflow via HTTP, but it is a scheduling service, not the feature that enables HTTP POST triggering itself — the underlying capability is the Workflows REST API. Option C is wrong because there is no 'HTTP Gateway' feature on a Workflows workflow; HTTP triggering is done via the API, not a gateway toggle. Option D is wrong because creating a service account with public access does not enable HTTP POST triggering and would be a security anti-pattern; authentication is required via IAM.

44
MCQmedium

You are using Cloud Scheduler to trigger a Workflows execution every hour. The Workflows definition expects an argument 'projectId' to be passed at runtime. You need to ensure the argument is provided correctly. What should you include in the Cloud Scheduler job configuration?

A.In the 'URL' field, append the argument as a query parameter, e.g., ?projectId=my-project.
B.In the 'Attributes' field, define a key-value pair with 'projectId' as the key and 'my-project' as the value.
C.In the 'Headers' field, add a custom header like 'X-Project-Id: my-project'.
D.In the 'Body' field, provide a JSON payload with the argument, e.g., {"projectId": "my-project"}.
AnswerD

Cloud Scheduler can invoke Workflows via an HTTP POST request. The Workflows API expects runtime arguments in the request body as JSON. By setting the 'Body' field to {"projectId": "my-project"}, the argument is passed correctly. The Workflows execution will receive it as part of the execution context, making it available to the workflow definition.

Why this answer

When Cloud Scheduler triggers a Workflows execution, it sends an HTTP POST request to the Workflows API endpoint. Runtime arguments must be included in the request body as a JSON object. The 'Body' field in Cloud Scheduler allows you to specify this JSON payload, ensuring the workflow receives the 'projectId' argument.

Other fields like URL, headers, or non-existent attributes do not serve this purpose.

Exam trap

The trap here is assuming that workflow arguments can be passed via URL query parameters or headers, when the Workflows API requires them in the JSON body.

45
MCQeasy

When using Cloud Scheduler to trigger a Workflows execution, what is the best practice for authenticating the scheduler to the Workflows API?

A.Use an API Key generated in the console.
B.Hardcode credentials in the scheduler job.
C.Use 'Public' access for the workflow.
D.Use an OIDC token with a service account.
AnswerD

OIDC tokens carry a signed identity assertion that Workflows validates against the caller's service account, satisfying the stem's requirement for authenticated HTTP invocation. Cloud Scheduler attaches this token in the Authorization header, and granting that service account the Workflows Invoker role scopes permission precisely, avoiding broader OAuth scopes.

Why this answer

The best practice for Cloud Scheduler to authenticate to the Workflows API is to configure the job with an OIDC token tied to a service account that has permission to invoke the workflow. Cloud Scheduler supports OIDC authentication for HTTP targets, and the service account's identity is verified by Workflows via IAM. This avoids static credentials and follows least-privilege.

Exam trap

GCP-ADP often tests whether candidates choose secure identity-based auth (OIDC + service account) over insecure shortcuts like API keys or public access, so candidates may pick API key thinking it is simpler.

How to eliminate wrong answers

Option A is wrong because API keys are not the recommended or supported authentication mechanism for invoking Workflows; API keys lack identity and fine-grained IAM control. Option B is wrong because hardcoding credentials is a security anti-pattern and not a supported Cloud Scheduler authentication method. Option C is wrong because making the workflow public removes authentication entirely, violating security best practices and exposing the workflow to unauthorized invocation.

46
MCQmedium

You are using Cloud Composer to orchestrate a daily ETL pipeline. A task that normally completes in 10 minutes occasionally runs for over 2 hours due to unexpected data volume. You want to prevent this task from indefinitely blocking the workflow and ensure it fails after 30 minutes so downstream tasks can be retried or alerted. What should you configure on the task?

A.Set the DAG's dagrun_timeout to 30 minutes.
B.Set the task's retries parameter to 0.
C.Set the scheduler's max_threads to a higher value.
D.Set execution_timeout to 30 minutes in the task definition.
AnswerD

execution_timeout is an Airflow task parameter that sets the maximum time a task is allowed to run. If the task exceeds this duration, it is terminated and marked as failed. Setting it to 30 minutes ensures that long-running tasks are killed, allowing downstream tasks to handle the failure or alerts to be triggered. This directly addresses the requirement to avoid indefinite blocking.

Why this answer

In Cloud Composer, Airflow tasks support an execution_timeout parameter that defines the maximum runtime for a single task. When the timeout is reached, the task is terminated and marked as failed, enabling downstream tasks to proceed or alerts to fire. Configuring this on the specific task ensures that only that task is affected, preserving the rest of the DAG's execution.

Exam trap

The trap here is confusing task-level execution_timeout with DAG-level dagrun_timeout, which applies to the entire DAG run rather than a single task.

47
Multi-Selecthard

Which TWO of the following strategies help reduce Cloud Composer costs?

Select 2 answers
A.Keep all historical logs forever
B.Use the largest environment size
C.Delete unused environments
D.Increase scheduler frequency
E.Enable auto-scaling
AnswersC, E

Deleting unused environments removes the underlying GKE cluster, Cloud SQL instance, and storage buckets that Composer provisions per environment, eliminating their hourly compute and database charges. This directly satisfies the stem's cost-reduction goal, since idle environments still bill continuously even when no DAGs run.

Why this answer

Option C (Delete unused environments) is correct because Cloud Composer charges for the underlying GKE nodes, Cloud SQL database, and web server that run continuously per environment, so removing environments that are no longer needed eliminates those recurring infrastructure costs. Option E (Enable auto-scaling) is correct because Composer's autoscaling dynamically adjusts the number of worker nodes based on the workload's queue demand, allowing the environment to scale down during idle periods and avoid paying for excess capacity. Option A (Keep all historical logs forever) is wrong because retaining logs indefinitely increases Cloud Logging storage costs rather than reducing them.

Option B (Use the largest environment size) is wrong because larger environments provision more workers and thus cost more, not less. Option D (Increase scheduler frequency) is wrong because more frequent scheduler runs increase resource consumption and can raise costs instead of lowering them.

Exam trap

GCP-ADP often tests the misconception that 'more resources equals better performance at no cost' — candidates pick the largest environment or higher scheduler frequency thinking it improves reliability, when the question is explicitly about reducing cost.

48
MCQhard

You are using Workflows to orchestrate a series of steps that call external HTTP APIs. One API occasionally returns a 503 error, and you want the workflow to retry that specific step with exponential backoff, but not retry on 404 errors. How should you configure the step?

A.Configure the entire workflow to retry on any error by setting a global retry policy, and rely on the API to eventually return success for 404s.
B.Wrap the API call in a try/except block and use a loop with a sleep timer that doubles each iteration, manually checking for 503 before retrying.
C.Use a Cloud Scheduler job to invoke the API step repeatedly with increasing intervals until it succeeds, then trigger the rest of the workflow.
D.Set the step's retry predicate to check for a 503 status code and configure a retry policy with exponential backoff, and do not include 404 in the predicate.
AnswerD

Workflows allows you to define a retry predicate that examines the error or response and a retry policy with backoff parameters. By predicating only on 503, the step retries on server errors but fails immediately on 404. This matches the requirement precisely and uses native Workflows retry capabilities.

Why this answer

Workflows steps support a retry policy with a predicate that can inspect the error or response. By predicating on 503 only, the step retries with exponential backoff on server errors and fails fast on 404. Manual loops or global retries do not provide the same granular control, and Cloud Scheduler is not designed for in-workflow retries.

Exam trap

The trap here is thinking you need to implement retry logic manually with loops or use a global retry policy, when Workflows provides per-step retry predicates and backoff configuration.

Ready to test yourself?

Try a timed practice session using only Data Pipeline Orchestration questions.