Courseiva
Question 1,315 of 1,672
Machine Learning Implementation and OperationseasyMultiple ChoiceObjective-mapped

Custom Inference Container in SageMaker

A machine learning engineer needs to deploy a model that requires custom inference code with dependencies. Which SageMaker deployment option should be used?

Quick Answer

The answer is to create a custom Docker container and deploy it to a SageMaker endpoint. This is the correct choice because a custom container gives you full control over the inference code and its dependencies, allowing you to package any libraries, binaries, or system configurations that your model requires to run predictions. On the AWS Certified Machine Learning Specialty MLS-C01 exam, this scenario tests your understanding of SageMaker deployment flexibility versus built-in limitations; a common trap is confusing development environments like notebook instances with production deployment options, or assuming batch transform jobs can serve real-time traffic. The search intent for deploying models with custom inference code and dependencies using SageMaker custom containers directly maps to this solution, as built-in algorithms cannot accommodate arbitrary code. Memory tip: think “custom container for custom code” — if your inference logic or dependencies are non-standard, you must build and host your own Docker image.

⚠ Common exam trap

A common mistake is assuming a SageMaker notebook instance can be used as an inference endpoint, but notebook instances are for development and experimentation only. To serve custom inference code, you must package it in a Docker container and deploy it to a SageMaker endpoint.

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

Create a custom Docker container and deploy to SageMaker endpoint.

When a model requires custom inference code with dependencies, the only way to fully control the runtime environment, libraries, and inference logic is to package everything into a custom Docker container. SageMaker endpoints can then deploy this container, allowing the engineer to specify the exact inference script and dependencies (e.g., via a Dockerfile and a requirements.txt). This approach supports any framework or custom logic that built-in algorithms cannot provide.

Answer analysis

Option-by-option breakdown

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

  • Use a SageMaker notebook instance as an endpoint.

    Why it's wrong here

    Notebook instances are not designed for production endpoints.

  • Create a custom Docker container and deploy to SageMaker endpoint.

    Why this is correct

    Custom container provides flexibility for custom code and dependencies.

  • Use a built-in SageMaker algorithm.

    Why it's wrong here

    Built-in algorithms have fixed code; cannot add custom inference.

  • Use a SageMaker batch transform job.

    Why it's wrong here

    A SageMaker batch transform job is designed for asynchronous, offline inference on large datasets, not for deploying a model that requires real-time, synchronous predictions via an endpoint. While batch transform does support custom inference code and dependencies, its operational model does not provide the continuous, low-latency service needed for live deployment. This option would be correct for scenarios where a large volume of data needs processing periodically without immediate response requirements.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on MLS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. An ML engineer is deploying a model to a SageMaker endpoint for real-time inference. The model requires a custom inference script that preprocesses input data and postprocesses predictions. Which SageMaker feature should be used to implement this custom logic?

medium
  • A.Use SageMaker Ground Truth to transform inference requests
  • B.Use SageMaker Processing jobs to preprocess data before inference
  • C.Use a built-in SageMaker algorithm with the default inference code
  • D.Create a SageMaker model with a custom inference script that includes pre- and post-processing functions

Why D: SageMaker allows you to bring your own container or use a pre-built container with a custom inference script that defines `input_fn`, `predict_fn`, `output_fn`, and `model_fn` functions. These functions handle preprocessing of input data, model prediction, and postprocessing of predictions, enabling custom logic for real-time inference endpoints without requiring separate infrastructure.

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This MLS-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 MLS-C01 exam.