PMLE Automating and Orchestrating ML Pipelines Practice Question
A machine learning team uses Vertex AI Pipelines for model training. They want to implement a conditional step that runs additional evaluation if the model accuracy exceeds 0.9, otherwise it runs a data augmentation component. Which two Kubeflow Pipelines SDK v2 constructs can they use to achieve this? (Choose two.)
⚠ Common exam trap
Candidates often confuse `dsl.ParallelFor` or `dsl.ExitHandler` with conditional constructs, but `dsl.If` and `dsl.Else` are the only SDK v2 constructs specifically designed for branching based on runtime conditions.
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
✓
dsl.Else
The team needs branching logic in a Vertex AI Pipelines (Kubeflow Pipelines SDK v2) graph, and dsl.If (option E) is the SDK v2 construct that creates a conditional branch whose condition is evaluated at runtime, so it correctly expresses 'if accuracy > 0.9, run the evaluation component.' dsl.Else (option B) is the companion construct used together with dsl.If to define the alternative branch, so it correctly expresses 'otherwise run the data augmentation component.' Together, dsl.If and dsl.Else form the if/else control-flow pattern required for this scenario. dsl.ParallelFor (option A) is for iterating over a list and launching parallel tasks, not for conditional branching. dsl.ExitHandler (option C) is for defining cleanup or exit tasks that run when a scope completes or fails, not for choosing between two branches. dsl.Collected (option D) is a type annotation used to collect outputs from loops, not a conditional construct.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
dsl.ParallelFor
Why it's wrong here
dsl.ParallelFor iterates over a list, launching concurrent branches for each item; it cannot branch on a boolean accuracy threshold. It is tempting because it handles fan-out workloads such as hyperparameter tuning or per-dataset training, where the same component runs repeatedly across a collection rather than following one conditional path.
- ✓
dsl.Else
Why this is correct
dsl.Else provides the alternative branch executed when the dsl.If condition evaluates false, so the data augmentation component runs whenever accuracy does not exceed 0.9. It is the required companion construct to dsl.If for building if/else conditionals in Kubeflow Pipelines SDK v2.
- ✗
dsl.ExitHandler
Why it's wrong here
dsl.ExitHandler runs a cleanup component when the pipeline exits, whether successfully or after failure; it cannot branch on accuracy. It is tempting because it does conditionally execute a component, but that trigger is pipeline termination, not a data-dependent boolean. Conditional branching on a threshold requires dsl.Condition instead.
- ✗
dsl.Collected
Why it's wrong here
dsl.Collected groups outputs from a loop, not conditional execution. Branching requires dsl.Condition with an if-expression, so Collected cannot select between the evaluation and augmentation components. It is tempting because it appears in pipeline-authoring examples alongside control-flow constructs.
- ✓
dsl.If
Why this is correct
dsl.If evaluates a boolean condition at runtime and executes its enclosed tasks only when that condition holds, so the additional evaluation step runs when accuracy exceeds 0.9. It is the primary conditional construct in Kubeflow Pipelines SDK v2, paired with dsl.Else.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.