Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Machine Learning Engineer practice bank has an additional 974 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your ML engineering team serves a fraud-detection XGBoost model (model.bst) on a Vertex AI Endpoint (fraud-endpoint) using a prebuilt XGBoost serving container. You need to deploy model version v2 to the same endpoint with a 10% canary traffic split while retaining 90% on v1, subject to these constraints:
Dockerfile, plus local container testing with Docker before deployment.predict API.Which deployment strategy should you implement?
v2 XGBoost artifact to Cloud Storage as model.bst, implement a custom Predictor subclass with Custom Prediction Routines (CPR) and a requirements.txt file, build and locally verify the container using LocalModel.build_cpr_model and deploy_to_local_endpoint, push the image to Artifact Registry, upload v2 to Vertex AI Model Registry, and deploy it to fraud-endpoint with traffic_percentage=10 while setting v1 to 90.Custom Prediction Routines (CPR) is a Vertex AI SDK framework that generates custom serving containers around user-defined preprocessing, prediction, and postprocessing logic without requiring engineers to write a web server or Dockerfile. By subclassing the Predictor interface (or inheriting from framework-specific base predictors), you encapsulate ML lifecycle logic while Vertex AI supplies the production HTTP server and health-check infrastructure.
Predictor overrides load(), preprocess(), predict(), and postprocess(). Inside preprocess(), your code can issue REST calls to external enrichment services before invoking the loaded XGBoost Booster (model.bst), while postprocess() applies custom fraud thresholds and formats business outputs.Predictor class, and requirements.txt to LocalModel.build_cpr_model() automatically builds the Docker image. Calling local_model.deploy_to_local_endpoint() lets you validate run_health_check() and predict() locally against Cloud Storage artifacts before pushing.Handler implements the standard Vertex AI JSON request/response contract, downstream clients continue using the predict API seamlessly. Uploading the image and artifacts to Vertex AI Model Registry and deploying to fraud-endpoint with traffic_percentage=10 splits live traffic across DeployedModel resources on the same endpoint.Dockerfile maintenance.requirements.txt inside the generated container.Handler) cleanly separated from ML logic (Predictor).Prebuilt XGBoost containers cannot execute external REST enrichment or custom postprocessing, while building a full custom container from scratch adds unnecessary Dockerfile and server maintenance. CPR provides the exact middle ground—full Python extensibility with managed serving scaffolding and native predict compatibility.
Pipeline, serialize the pipeline to model.joblib, register v2 in Model Registry with the Vertex AI prebuilt scikit-learn serving container, and deploy it to fraud-endpoint with traffic_percentage=10.Vertex AI's prebuilt scikit-learn serving container is a managed image built to load a model.joblib file containing standard scikit-learn estimators or scikit-learn Pipeline objects and invoke their .predict() method against incoming JSON instances.
requirements.txt build step. Serializing custom Python functions (such as FunctionTransformer wrappers calling external REST APIs) with joblib breaks if custom modules or HTTP client packages are absent from the prebuilt image, and can introduce version mismatches with the XGBoost Booster artifact.LocalModel.build_cpr_model or deploy_to_local_endpoint workflow to test external API connectivity and container health checks locally before uploading to Model Registry.model.joblib in the Cloud Storage directory.StandardScaler or OneHotEncoder) paired with a scikit-learn estimator, requiring no external API calls, custom packages, or output postprocessing.Even when using scikit-learn, Vertex AI recommends Custom Prediction Routines (CPR)—optionally subclassing SklearnPredictor—whenever serialized preprocessors require custom logic, external lookups, or postprocessing.
Dockerfile running NVIDIA Triton Inference Server with a Python backend for enrichment and postprocessing, upload v2 to Model Registry, deploy it to fraud-endpoint with a 10% traffic split, and serve predictions via the rawPredict endpoint method.rawPredict isNVIDIA Triton Inference Server is a high-performance serving engine deployed on Vertex AI as a custom container to maximize GPU/CPU utilization, dynamic batching, and multi-framework execution. Because Triton implements the KServe v2 inference protocol rather than Vertex AI's native instances schema, clients must invoke it via the rawPredict API.
predict input format, forcing downstream callers to migrate to rawPredict. Mixing a v1 prebuilt XGBoost model (which expects predict) and a v2 Triton model (which requires rawPredict) behind a 90/10 traffic split on the same endpoint would cause payload failures.Dockerfile, model repository layout, and Python backend violates the constraint to avoid maintaining custom server setups and Dockerfiles from scratch.LocalModel developer ergonomics.rawPredict (or gcloud ai endpoints raw-predict) with KServe v2 JSON or binary payloads instead of predict.config.pbtxt or --strict-model-config=false).rawPredict API.In Vertex AI, rawPredict bypasses standard Vertex AI payload validation and forwards the raw HTTP body directly to the container—useful for Triton or OpenAI-compatible vLLM servers, but incompatible with seamless predict-based canary splits alongside standard prebuilt containers.
model.bst together with a custom Python handler script for external API enrichment and thresholding into a model.mar archive, upload it to Cloud Storage, register v2 in Model Registry using the Vertex AI prebuilt XGBoost serving container, and deploy v2 to fraud-endpoint with a 10% traffic split..mar archive and prebuilt XGBoost containers areA model archive (.mar) file is the packaging format required by TorchServe, the serving engine used in Vertex AI's prebuilt PyTorch containers. By contrast, Vertex AI's prebuilt XGBoost serving containers load raw model binary artifacts directly from Cloud Storage and do not run TorchServe.
model.bst (saved via xgboost.Booster.save_model) or model.joblib (saved via joblib). They cannot unpack or execute a model.mar archive.model.mar—prebuilt XGBoost containers expose no mechanism to inject custom Python preprocessing, external REST calls, or postprocessing scripts.requirements.txt or validating custom enrichment code locally with LocalModel.model.mar containing model weights and a default or custom TorchServe handler.model.bst or model.joblib.v2 model were built in PyTorch rather than XGBoost, and you packaged its weights and custom handler script into model.mar for a prebuilt PyTorch container (noting that advanced multi-dependency workflows still favor custom containers or CPR).Each Vertex AI prebuilt serving container enforces strict framework-specific artifact naming: SavedModel directories for TensorFlow, model.mar for PyTorch, model.bst or model.joblib for XGBoost, and model.joblib for scikit-learn.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated