0
0
MLOpsdevops~20 mins

Pipeline components and DAGs in MLOps - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pipeline Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding DAG structure in ML pipelines

In an ML pipeline, a Directed Acyclic Graph (DAG) defines the order of tasks. Which statement best describes a DAG?

AA graph where tasks are connected with no cycles, ensuring a clear execution order.
BA graph where tasks can loop back to previous tasks forming cycles.
CA graph that allows tasks to run in any order without dependencies.
DA graph that only contains a single task with no connections.
Attempts:
2 left
💡 Hint

Think about what 'acyclic' means in the graph context.

💻 Command Output
intermediate
1:30remaining
Output of a pipeline task execution command

Given the following command to run an ML pipeline task:

mlflow run . -P entry_point=train_model

What is the expected output if the task runs successfully?

ARun completed successfully with metrics logged and model saved.
BERROR: Entry point 'train_model' not found in the project.
CSyntaxError: invalid syntax in command line.
DTask skipped due to unmet dependencies.
Attempts:
2 left
💡 Hint

Consider what happens when a valid entry point is executed in MLflow.

Configuration
advanced
2:00remaining
Correct DAG YAML configuration snippet

Which YAML snippet correctly defines a DAG with three tasks where preprocess runs before train, and train runs before evaluate?

A
tasks:
  preprocess:
    depends_on: [train, evaluate]
  train:
    depends_on: []
  evaluate:
    depends_on: [preprocess]
B
tasks:
  preprocess:
    depends_on: [train]
  train:
    depends_on: [evaluate]
  evaluate:
    depends_on: []
C
tasks:
  preprocess:
    depends_on: [evaluate]
  train:
    depends_on: []
  evaluate:
    depends_on: [train]
D
tasks:
  preprocess:
    depends_on: []
  train:
    depends_on: [preprocess]
  evaluate:
    depends_on: [train]
Attempts:
2 left
💡 Hint

Check the order of dependencies to ensure no cycles and correct sequence.

Troubleshoot
advanced
2:00remaining
Identifying cause of pipeline task failure

You run a pipeline and the evaluate task fails with the error: FileNotFoundError: model.pkl not found. Which is the most likely cause?

AThe <code>evaluate</code> task has a syntax error in its script.
BThe <code>train</code> task did not run or failed to save the model file.
CThe pipeline DAG has a cycle causing infinite loops.
DThe <code>preprocess</code> task deleted the model file by mistake.
Attempts:
2 left
💡 Hint

Think about which task creates the model file and what happens if it is missing.

🔀 Workflow
expert
2:30remaining
Determining pipeline execution order from DAG

Given the following DAG dependencies:

tasks:
  data_ingest:
    depends_on: []
  feature_engineering:
    depends_on: [data_ingest]
  model_training:
    depends_on: [feature_engineering]
  model_validation:
    depends_on: [model_training]
  deployment:
    depends_on: [model_validation, feature_engineering]

What is the correct order of task execution?

Adata_ingest → feature_engineering → model_training → deployment → model_validation
Bdata_ingest → feature_engineering → deployment → model_training → model_validation
Cdata_ingest → feature_engineering → model_training → model_validation → deployment
Ddata_ingest → model_training → feature_engineering → model_validation → deployment
Attempts:
2 left
💡 Hint

Remember that a task can only run after all its dependencies have completed.