Courseiva

PMLE Automating and Orchestrating ML Pipelines Practice Question

An ML pipeline must run a set of preprocessing tasks for each data shard in parallel. Which KFP SDK features should they use to implement this? (Choose two.)

⚠ Common exam trap

In the Google PMLE exam, note that dsl.ParallelFor is used for parallel iteration over data shards, and dsl.Collected gathers outputs from all iterations. Candidates often confuse these with dsl.Condition (for branching) or dsl.PipelineParam (for parameters), so carefully read whether the question asks for parallel processing or conditional logic.

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.ParallelFor

dsl.ParallelFor (A) is correct because it is the KFP SDK construct that iterates over a list (such as the set of data shards) and fans out the loop body into parallel task executions, which is exactly what is needed to run preprocessing per shard concurrently. dsl.Collected (C) is correct because it is used with dsl.ParallelFor to gather the outputs of all parallel iterations into a single list, allowing downstream pipeline steps to consume the aggregated results of the per-shard preprocessing. dsl.PipelineParam (B) is not the mechanism for parallel iteration; it only represents a runtime parameter passed into a pipeline or component. dsl.Condition (D) implements conditional branching (if/else) rather than parallel fan-out, and dsl.ExitHandler (E) defines cleanup logic that runs when a scope exits, neither of which provides the required parallel execution over shards.

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 this is correct

    dsl.ParallelFor iterates over the shard list at pipeline-compile time, generating one preprocessing task instance per shard that KFP schedules concurrently. This directly satisfies the requirement to run preprocessing tasks for each data shard in parallel.

  • ✗

    dsl.PipelineParam

    Why it's wrong here

    dsl.PipelineParam passes a single value into a pipeline run; it cannot fan out work across shards. It is tempting because parameterising pipelines is genuinely useful for reusable, configurable workflows, but parallel per-shard execution requires dsl.ParallelFor to iterate the shard list and spawn concurrent tasks.

  • ✓

    dsl.Collected

    Why this is correct

    dsl.Collected wraps the output of a dsl.ParallelFor loop, gathering each shard's task outputs into one list for downstream consumption. It satisfies the fan-in requirement after parallel preprocessing, letting subsequent pipeline steps iterate over all shard results without manual aggregation.

  • ✗

    dsl.Condition

    Why it's wrong here

    dsl.Condition branches on a boolean predicate, executing one path or another; it cannot iterate a shard collection to launch concurrent tasks. It is tempting because conditional branching is genuinely useful for optional pipeline steps, but the scenario needs dsl.ParallelFor to fan out identical preprocessing tasks across every shard.

  • ✗

    dsl.ExitHandler

    Why it's wrong here

    dsl.ExitHandler runs a cleanup or notification task after a pipeline scope completes or fails; it does not iterate shards or spawn parallel tasks. It is tempting because exit handlers are genuinely useful for teardown and error notification, but per-shard parallelism requires dsl.ParallelFor to iterate the shard list.

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 →

How Courseiva writes practice questions · Editorial policy

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.