Courseiva
Back to AWS Certified Machine Learning Engineer Associate MLA-C01 questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise AWS Certified Machine Learning Engineer Associate MLA-C01 practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
MLA-C01
exam code
Amazon Web Services
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related MLA-C01 topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1hardmultiple choice
Full question →

Refer to the exhibit. A data engineer runs an AWS Glue ETL job with the following script portion. The job fails with an error: 'An error occurred while calling o113.pyWriteDynamicFrame. No such file or directory'. What is the most likely cause?

Exhibit

import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job

args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)

raw = glueContext.create_dynamic_frame.from_options(
    connection_type="s3",
    connection_options={"paths": ["s3://bucket/input/year=2023/month=01/"]},
    format="json")

transformed = raw.select_fields(["col1", "col2"]).rename_field("col1", "new_col")

glueContext.write_dynamic_frame.from_options(
    frame=transformed,
    connection_type="s3",
    connection_options={"path": "s3://bucket/output/transformed"},
    format="parquet")

job.commit()
Question 2mediummultiple choice
Full question →

A data scientist runs the exhibit AWS Glue ETL job. The job fails with a Spark stage failure error. What is the most likely cause?

Exhibit

Refer to the exhibit. A data scientist runs the following AWS Glue ETL job script (Spark) to prepare data for ML:

```python
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job

args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)

datasource = glueContext.create_dynamic_frame.from_options(
    connection_type = "s3",
    connection_options = {"paths": ["s3://bucket/input/"]},
    format = "csv",
    format_options = {"withHeader": True}
)

applymapping = ApplyMapping.apply(frame = datasource, mappings = [("id", "int", "id", "int"), ("value", "string", "value", "double")])
...
```

The job fails with an error: "Job run failed: org.apache.spark.SparkException: Job aborted due to stage failure: Task failed while writing rows." What is the most likely cause of this error?
Question 3hardmultiple choice
Full question →

A data scientist creates a feature group as shown in the exhibit. When ingesting data with an 'age' column of integer values, the ingestion fails. What is the most likely cause?

Exhibit

Refer to the exhibit. A data scientist uses the following SageMaker Feature Store feature definition (using the Boto3 SDK) to create a feature group:

```python
import boto3
sagemaker = boto3.client('sagemaker', region_name='us-east-1')
response = sagemaker.create_feature_group(
    FeatureGroupName='my-feature-group',
    RecordIdentifierFeatureName='customer_id',
    EventTimeFeatureName='timestamp',
    FeatureDefinitions=[
        {'FeatureName': 'customer_id', 'FeatureType': 'String'},
        {'FeatureName': 'age', 'FeatureType': 'String'},
        {'FeatureName': 'income', 'FeatureType': 'Fractional'}
    ],
    OnlineStoreConfig={'EnableOnlineStore': True},
    RoleArn='arn:aws:iam::123456789012:role/SageMakerRole'
)
```

The data scientist later tries to ingest data with an 'age' column containing integer values. The ingestion fails. What is the most likely reason?
Question 4easymultiple choice
Full question →

Refer to the exhibit. A data scientist ran a training job using a custom algorithm container. The job failed with the error shown. What is the most likely cause?

Exhibit

{
    "TrainingJobName": "my-training-job",
    "TrainingJobStatus": "Failed",
    "FailureReason": "ClientError: Cannot evaluate expression: loss",
    "AlgorithmSpecification": {
        "TrainingImage": "123456789012.dkr.ecr.us-east-1.amazonaws.com/custom-latest",
        "TrainingInputMode": "File"
    },
    "ResourceConfig": {
        "InstanceType": "ml.m5.large",
        "InstanceCount": 1,
        "VolumeSizeInGB": 30
    },
    "StoppingCondition": {
        "MaxRuntimeInSeconds": 86400
    },
    "OutputDataConfig": {
        "S3OutputPath": "s3://my-bucket/output"
    }
}
Question 5easymultiple choice
Full question →

Refer to the exhibit. A data scientist is trying to use AWS Glue to read data from the S3 bucket `ml-data-bucket`. The Glue job fails with an access denied error. What is the most likely cause?

Exhibit

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::ml-data-bucket/*"
    }
  ]
}
Question 6easymultiple choice
Full question →

Refer to the exhibit. A SageMaker training job failed. Based on the error message, which action should the engineer take?

Exhibit

{
    "TrainingJobName": "job-123",
    "TrainingJobStatus": "Failed",
    "FailureReason": "ClientError: Review the error message. Training failed due to insufficient instance memory.",
    "AlgorithmSpecification": {
        "TrainingImage": "123456789012.dkr.ecr.us-east-1.amazonaws.com/sagemaker-xgboost:1.0-1",
        "TrainingInputMode": "File"
    },
    "ResourceConfig": {
        "InstanceType": "ml.m5.large",
        "InstanceCount": 1,
        "VolumeSizeInGB": 30
    }
}
Question 7hardmultiple choice
Full question →

Refer to the exhibit. A data engineer deploys this Glue job via CloudFormation. When running, the job fails with a timeout after 2 hours. The job processes a large dataset and expected to take 3 hours. Which change would resolve the issue?

Network Topology
"TempDir": "s3://data-bucket/temp"Resources:MyGlueJob:Type: AWS::Glue::JobProperties:Command:Name: glueetlScriptLocation: s3://data-bucket/scripts/etl.pyPythonVersion: "3"Role: arn:aws:iam::123456789012:role/GlueServiceRoleDefaultArguments:GlueVersion: "2.0"WorkerType: G.1XNumberOfWorkers: 10MaxRetries: 0Timeout: 120
Question 8easymultiple choice
Full question →

Refer to the exhibit. The data scientist wants to update the endpoint to use a new model version without downtime. Which approach should they use?

Exhibit

{
  "EndpointConfigName": "my-config",
  "ProductionVariants": [
    {
      "VariantName": "variant1",
      "ModelName": "my-model-v1",
      "InitialInstanceCount": 1,
      "InstanceType": "ml.c5.large",
      "InitialVariantWeight": 1.0
    }
  ]
}
Question 9mediummultiple choice
Full question →

Refer to the exhibit. A SageMaker Processing job fails with the following error log. Which change during data preparation would resolve the issue?

Exhibit

ProcessingJobError: Execution failed
Error: Traceback (most recent call last):
  File "/opt/ml/processing/input/code/preprocess.py", line 45, in <module>
    df['age'] = df['age'].apply(float)
ValueError: could not convert string to float: 'twenty-five'
Question 10hardmultiple choice
Full question →

Refer to the exhibit. A SageMaker Pipeline fails with 'Invalid output reference' at the TrainingStep. What is the most likely cause?

Exhibit

TrainingStep(
    name="TrainModel",
    step_args=train_args,
    depends_on=[tuning_step]
)
tuning_step = TuningStep(...) # produces multiple artifacts
Question 11easymultiple choice
Full question →

An ML engineer runs the CLI command shown in the exhibit. However, the training job fails immediately with an error: 'Unable to assume role'. What is the most likely cause?

Exhibit

Refer to the exhibit.

aws sagemaker create-training-job \
    --training-job-name my-training-job \
    --algorithm-specification 'TrainingImage=123456789012.dkr.ecr.us-west-2.amazonaws.com/my-custom-training:latest,TrainingInputMode=File' \
    --role-arn arn:aws:iam::123456789012:role/SageMakerExecutionRole \
    --input-data-config '[{"ChannelName":"train","DataSource":{"S3DataSource":{"S3Uri":"s3://my-bucket/train/","S3DataType":"S3Prefix"}},"ContentType":"text/csv"}]' \
    --output-data-config '{"S3OutputPath":"s3://my-bucket/output/"}' \
    --resource-config '{"InstanceType":"ml.m5.large","InstanceCount":1,"VolumeSizeInGB":30}' \
    --vpc-config '{"SecurityGroupIds":["sg-12345678"],"Subnets":["subnet-12345678"]}'
Question 12mediummultiple choice
Full question →

A machine learning engineer observes that a SageMaker training job fails with the error shown in the exhibit. What is the most likely cause of the failure?

Exhibit

Refer to the exhibit.

```
Training Job Name: my-training-job
Status: Failed
Failure Reason: ClientError: Data download failed. Unable to locate credentials. Please configure your SageMaker Execution Role with the necessary permissions.
```
This is the output from `aws sagemaker describe-training-job --training-job-name my-training-job`.
Question 13mediummultiple choice
Full question →

A machine learning engineer has configured a SageMaker Model Monitor schedule for data quality monitoring as shown in the exhibit. The schedule is set to run hourly. However, the engineer notices that the monitoring jobs are not producing output in the specified S3 bucket. What is the most likely cause?

Exhibit

Refer to the exhibit.

SageMaker Model Monitor schedule configuration:
```
{
  "ScheduleConfig": {
    "ScheduleExpression": "cron(0 * * * ? *)",
    "DataAnalysisStartTime": "2023-01-01T00:00:00Z",
    "DataAnalysisEndTime": "2023-01-01T23:59:00Z"
  },
  "JobDefinition": {
    "Environment": {
      "output_path": "s3://my-bucket/reports/"
    }
  },
  "MonitoringType": "DataQuality"
}
```
Question 14easymultiple choice
Full question →

A SageMaker Processing job fails with 'Access Denied' when listing objects in an S3 bucket, despite the IAM policy shown in the exhibit. What is the most likely cause?

Exhibit

Refer to the exhibit. A data scientist is trying to run a SageMaker Processing job that reads data from an S3 bucket. The IAM role attached to the processing job has the following policy:

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::my-bucket/*"
        }
    ]
}
```

The job fails with an error: "Access Denied" when trying to list objects. What is the root cause?
Question 15hardmultiple choice
Full question →

A SageMaker endpoint is failing with the exhibited error. What is the most likely cause of this error?

Exhibit

Refer to the exhibit.

[ERROR] 2022-12-01 10:15:30,123 – model_server – ModelLoadFailed: Unable to load model from /opt/ml/model. Parsed error: FileNotFoundError: [Errno 2] No such file or directory: '/opt/ml/model/classes.txt'

This log is from a SageMaker endpoint instance. The model was packaged as a tar.gz containing model.pth, classes.txt, and inference.py. The Docker container uses the SageMaker inference toolkit.

These MLA-C01 practice questions are part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style MLA-C01 questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.