Courseiva
easyMultiple Choice

MLA-C01 Practice Question: Refer to the exhibit

Exhibit

#!/bin/bash
set -e
cd /home/ec2-user/SageMaker
git clone https://github.com/org/repo.git
pip install -r requirements.txt

Refer to the exhibit. A user launches a SageMaker notebook instance with this lifecycle configuration. What happens?

⚠ Common exam trap

The key trap in this question is the distinction between 'on-start' and 'on-create' lifecycle events in SageMaker. Candidates often assume that a lifecycle script runs only once or on kernel resets, but 'on-start' executes every time the notebook instance is started, including after stopping and starting.

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

✓

The script runs every time the notebook is started

The lifecycle configuration script is set to run 'on-start', which means it executes every time the SageMaker notebook instance transitions to the 'InService' state, including initial creation and subsequent starts. This is distinct from 'on-create', which runs only once during instance provisioning. Therefore, the script runs on every start, making option A correct.

Answer analysis

Option-by-option breakdown

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

  • ✓

    The script runs every time the notebook is started

    Why this is correct

    A lifecycle configuration script placed in the start-notebook lifecycle hook executes each time the instance transitions to running, including after stop and restart. This satisfies the scenario's launch behaviour, since the script is invoked on every start rather than only at initial creation.

  • ✗

    The script runs after each kernel reset

    Why it's wrong here

    A lifecycle configuration's on-start script executes once when the notebook instance starts, not on every kernel reset. Kernel restarts re-run only content already in the notebook, so the script does not fire again. This option would be right if the configuration used a separate mechanism triggered by kernel events, which SageMaker does not provide.

  • ✗

    The script runs only on the first start

    Why it's wrong here

    The on-start script runs on every instance start, including restarts after stopping, so it is not limited to the first start. This option would be correct only if the script were guarded by a marker file or condition checking prior execution, which the configuration does not include.

  • ✗

    The script runs only when creating the instance

    Why it's wrong here

    The on-start script runs each time the instance starts, not only at creation. Stopping and restarting the instance re-executes it. Creation-only execution would require a different provisioning hook, such as a CloudFormation or custom image build step, not a lifecycle configuration attached to the notebook instance.

About these practice questions

This MLA-C01 question is part of Courseiva's 665-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 MLA-C01 practice question is part of Courseiva's free Amazon Web Services 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 MLA-C01 exam.