Question 493 of 506
Collaborating to manage data and modelshardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to reorder the tasks in the YAML so that task1 is defined before task2. This is correct because Vertex AI pipeline definitions require that tasks be declared in the order they appear in the dependency graph; the YAML parser validates the `dependentTasks` field by checking that referenced tasks are already defined. Defining `task1` before `task2` ensures that when `task2` declares a dependency on `task1`, `task1` is already in scope, resolving the invalid dependency order error. On the Google Professional Machine Learning Engineer exam, this tests your understanding of how Vertex AI pipelines parse task dependency order—a common trap is assuming the pipeline compiler will reorder tasks automatically, but the YAML definition must follow a top-down, dependency-first sequence. A useful memory tip: think of it like building a house—you must lay the foundation (task1) before you can frame the walls (task2).

PMLE Collaborating to manage data and models Practice Question

This PMLE practice question tests your understanding of collaborating to manage data and models. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Exhibit

Refer to the exhibit.

# pipeline.yaml
pipeline:
  name: training-pipeline
  description: End-to-end ML pipeline
  params:
    project_id: {type: String}
    dataset_id: {type: String}
  tasks:
    - task1:
        component: preprocessing
        inputs:
          project_id: {inputValue: project_id}
          dataset_id: {inputValue: dataset_id}
    - task2:
        component: training
        inputs:
          data: {taskOutputs: task1.output}
        dependentTasks: [task1]

Error: (gsutil cp pipeline.yaml gs://my-bucket/pipelines/): RuntimeException: Failed to compile pipeline. Invalid pipeline definition: task 'task2' depends on 'task1' but 'task1' is defined after 'task2' in YAML ordering.

Refer to the exhibit. A user is trying to upload a Vertex AI pipeline definition. The error indicates an invalid dependency order. What should the user do to fix this?

Question 1hardmultiple choice
Full question →

Exhibit

Refer to the exhibit.

# pipeline.yaml
pipeline:
  name: training-pipeline
  description: End-to-end ML pipeline
  params:
    project_id: {type: String}
    dataset_id: {type: String}
  tasks:
    - task1:
        component: preprocessing
        inputs:
          project_id: {inputValue: project_id}
          dataset_id: {inputValue: dataset_id}
    - task2:
        component: training
        inputs:
          data: {taskOutputs: task1.output}
        dependentTasks: [task1]

Error: (gsutil cp pipeline.yaml gs://my-bucket/pipelines/): RuntimeException: Failed to compile pipeline. Invalid pipeline definition: task 'task2' depends on 'task1' but 'task1' is defined after 'task2' in YAML ordering.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Reorder the tasks in the YAML so that task1 is defined before task2.

Option A is correct because Vertex AI pipeline definitions require that tasks be declared in the order they appear in the dependency graph. The YAML parser validates the `dependentTasks` field by checking that referenced tasks are already defined. Defining `task1` before `task2` ensures that when `task2` declares a dependency on `task1`, `task1` is already in scope, resolving the invalid dependency order error.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Reorder the tasks in the YAML so that task1 is defined before task2.

    Why this is correct

    YAML ordering determines execution order when dependencies are declared.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Rename task1 to a name that comes alphabetically before task2.

    Why it's wrong here

    The issue is positional, not alphabetical.

  • Change the dependency of task2 to be independent of task1.

    Why it's wrong here

    The dependency is intended; removing it changes the pipeline logic.

  • Remove the dependentTasks field from task2 and rely on implicit ordering.

    Why it's wrong here

    Implicit ordering is not guaranteed; explicit dependencies are recommended.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the misconception that alphabetical naming or implicit ordering can resolve dependency declaration errors, when in fact the YAML parser strictly requires tasks to be defined in topological order.

Detailed technical explanation

How to think about this question

Vertex AI pipelines use a YAML-based DSL where each task is a dictionary entry under `pipelineSpec.root.tasks`. The pipeline compiler (e.g., using KFP SDK) validates the DAG by ensuring that all dependencies are declared after their prerequisites. This is similar to how Kubernetes Job dependencies work in Argo Workflows, where task ordering must be explicit. In practice, if you have a complex pipeline with dozens of tasks, reordering them manually can be error-prone; using a pipeline builder like the KFP SDK automatically handles declaration order when you compile the pipeline from Python code.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PMLE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PMLE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PMLE question test?

Collaborating to manage data and models — This question tests Collaborating to manage data and models — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Reorder the tasks in the YAML so that task1 is defined before task2. — Option A is correct because Vertex AI pipeline definitions require that tasks be declared in the order they appear in the dependency graph. The YAML parser validates the `dependentTasks` field by checking that referenced tasks are already defined. Defining `task1` before `task2` ensures that when `task2` declares a dependency on `task1`, `task1` is already in scope, resolving the invalid dependency order error.

What should I do if I get this PMLE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.