Ngân hàng đề — Google Cloud Professional Machine Learning Engineer

Tìm thấy 333 câu.

Câu 241
You built a deep learning-based image classification model by using on-premises data. You want to use Vertex AI to deploy the model to production. Due to security concerns, you cannot move your data to the cloud. You are aware that the input data distribution might change over time. You need to detect model performance changes in production. What should you do?
  1. A Use Vertex Explainable AI for model explainability. Configure feature-based explanations.
  2. B Use Vertex Explainable AI for model explainability. Configure example-based explanations.
  3. C Create a Vertex AI Model Monitoring job. Enable training-serving skew detection for your model.
  4. D Create a Vertex AI Model Monitoring job. Enable feature attribution skew and drift detection for your model.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi xoay quanh việc triển khai một mô hình phân loại hình ảnh dựa trên deep learning (đã huấn luyện bằng dữ liệu tại chỗ - on-premises) lên Vertex AI (Google Cloud) để sử dụng trong môi trường production. 📍 Các ràng buộc chính:

  • Do lo ngại bảo mật, không thể di chuyển dữ liệu (data) lên cloud (đặc biệt là dữ liệu huấn luyện).
  • Phân phối dữ liệu đầu vào (input data distribution) có thể thay đổi theo thời gian.
  • Yêu cầu chính: Phát hiện sự thay đổi hiệu suất mô hình (model performance changes) trong production, mà không cần di chuyển dữ liệu.

🛠️ Mục tiêu cốt lõi: Sử dụng Vertex AI Model Monitoring để giám sát drift (sự thay đổi phân phối dữ liệu đầu vào theo thời gian) và skew (sự lệch lạc giữa baseline và dữ liệu serving), nhưng phải phù hợp với tình huống không upload được dữ liệu huấn luyện. Kiến thức dựa trên Vertex AI Model Monitoring phiên bản mới nhất (cập nhật 2024-2026), hỗ trợ giám sát mà chỉ cần dữ liệu serving (prediction requests) từ endpoint.

✅ Đáp án đúng

Đáp án đúng: Create a Vertex AI Model Monitoring job. Enable feature attribution skew and drift detection for your model.
Lý do lựa chọn:

  • Vertex AI Model Monitoring cho phép tạo job giám sát mô hình đã deploy trên endpoint.
  • Feature attribution skew và drift detection là tính năng nâng cao (dựa trên Explainable AI), phát hiện sự thay đổi phân phối dữ liệu đầu vào (drift) và lệch lạc thuộc tính đặc trưng (skew) mà không yêu cầu upload dữ liệu huấn luyện đầy đủ. Nó sử dụng attribution scores từ mô hình để so sánh baseline serving data với dữ liệu mới, phù hợp hoàn hảo với ràng buộc bảo mật.
  • Điều này trực tiếp giải quyết vấn đề phát hiện thay đổi hiệu suất do data drift trong production. ✅

📋 Phân tích chi tiết tất cả các phương án

  • Use Vertex Explainable AI for model explainability. Configure feature-based explanations.
    ❌ Sai: Vertex Explainable AI (XAI) chỉ cung cấp giải thích cho từng prediction riêng lẻ (feature importance), không giám sát sự thay đổi theo thời gian (drift/skew). Nó không detect performance changes ở production mà chỉ dùng cho phân tích post-hoc, không phù hợp với yêu cầu monitoring liên tục.

  • Use Vertex Explainable AI for model explainability. Configure example-based explanations.
    ❌ Sai: Example-based explanations (như counterfactuals hoặc prototypes) cũng chỉ tập trung vào giải thích từng ví dụ cụ thể, không hỗ trợ phát hiện thay đổi phân phối dữ liệu hoặc hiệu suất mô hình theo thời gian. Không giải quyết được vấn đề data distribution shift ở production.

  • Create a Vertex AI Model Monitoring job. Enable training-serving skew detection for your model.
    ❌ Sai: Training-serving skew detection yêu cầu upload dataset huấn luyện (training dataset) làm baseline để so sánh với serving data. Do ràng buộc "cannot move your data to the cloud", không thể thực hiện skew này (Vertex AI cần snapshot training data trong bucket). Nó chỉ detect skew giữa training và serving, nhưng bỏ qua pure drift detection từ serving data.

  • Create a Vertex AI Model Monitoring job. Enable feature attribution skew and drift detection for your model.
    ✅ Đúng: Như đã giải thích ở trên. Tính năng này (cập nhật mới nhất Vertex AI) sử dụng feature attributions (từ XAI) để monitor drift (so với historical serving baseline) và skew mà không cần training data. Hoàn hảo cho on-premises model deploy lên cloud, chỉ cần logs từ prediction requests. Hỗ trợ alerting tự động khi performance thay đổi.

📘 Tài liệu tham khảo

Hy vọng phân tích này giúp bạn ôn tập hiệu quả! 🚀 Nếu cần thêm ví dụ code hoặc demo, hãy hỏi nhé!

Câu 242
You trained a model packaged it with a custom Docker container for serving, and deployed it to Vertex AI Model Registry. When you submit a batch prediction job, it fails with this error: "Error model server never became ready. Please validate that your model file or container configuration are valid. " There are no additional errors in the logs. What should you do?
  1. A Add a logging configuration to your application to emit logs to Cloud Logging
  2. B Change the HTTP port in your model’s configuration to the default value of 8080
  3. C Change the healthRoute value in your model’s configuration to /healthcheck
  4. D Pull the Docker image locally, and use the docker run command to launch it locally. Use the docker logs command to explore the error logs
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm

✅ Nội dung câu hỏi:
Câu hỏi mô tả tình huống bạn đã huấn luyện một mô hình máy học, đóng gói nó vào một container Docker tùy chỉnh để phục vụ (serving), và triển khai lên Vertex AI Model Registry trên Google Cloud. Khi gửi một công việc dự đoán hàng loạt (batch prediction job), nó thất bại với lỗi cụ thể: "Error model server never became ready. Please validate that your model file or container configuration are valid.". Quan trọng là không có lỗi bổ sung nào trong logs (Cloud Logging hoặc logs của Vertex AI).
🛠️ Vấn đề cốt lõi: Lỗi này xảy ra vì model server trong container không bao giờ sẵn sàng (never became ready), thường do container không vượt qua health check của Vertex AI. Vertex AI yêu cầu container phải expose port 8080 (HTTP) và trả về HTTP 200 OK trên health route mặc định là "/" khi khởi động. Nếu container crash sớm, logs có thể trống. Bạn cần debug để xác định vấn đề trong container (như model file sai, dependencies thiếu, hoặc code server lỗi).

📘 Kiến thức cập nhật (Vertex AI phiên bản mới nhất 2026): Theo tài liệu chính thức Google Cloud Vertex AI (Custom prediction routines và Container requirements), lỗi "model server never became ready" phổ biến khi local testing chưa được thực hiện. Vertex AI không expose đầy đủ logs nội bộ container nếu crash ngay lập tức, nên debug local là bước đầu tiên khuyến nghị.

🔗 Tài liệu tham khảo:

🟢 Đáp án đúng và lý do lựa chọn

Pull the Docker image locally, and use the docker run command to launch it locally. Use the docker logs command to explore the error logs
✅ Lý do đúng: Đây là cách debug hiệu quả nhất theo best practices của Google Cloud. Vì logs Vertex AI trống (không có thêm error), bạn cần kéo image Docker về máy local, chạy bằng docker run (với các flag như -p 8080:8080 để simulate môi trường Vertex AI), rồi dùng docker logs để xem logs chi tiết bên trong container. Điều này giúp phát hiện lỗi sớm như: model file không tồn tại, port không bind đúng, hoặc exception khi load model. Vertex AI docs khuyến nghị local testing trước khi deploy để tránh lỗi này. Phương án này an toàn, nhanh chóng và không thay đổi config production.

❌ Phân tích tất cả các phương án

🧩 Phương án A:
Add a logging configuration to your application to emit logs to Cloud Logging
❌ Sai vì: Logs Vertex AI đã trống ngay từ đầu, chứng tỏ container có thể crash trước khi logging code chạy (ví dụ: lỗi import library hoặc file model sai đường dẫn). Thêm logging chỉ hữu ích nếu app đã start, nhưng ở đây vấn đề là server never ready, không phải thiếu logs. Việc rebuild và redeploy sẽ tốn thời gian, trong khi local debug nhanh hơn.

🧩 Phương án B:
Change the HTTP port in your model’s configuration to the default value of 8080
❌ Sai vì: Vertex AI yêu cầu bắt buộc port HTTP là 8080 làm default cho mọi custom container (không configurable khác). Nếu bạn đã deploy thành công lên Model Registry, container phải tuân thủ port này rồi. Thay đổi config chỉ áp dụng cho serving endpoint mới, nhưng lỗi "never ready" thường không phải do port (vì health check check port 8080 tự động), mà do server không start.

🧩 Phương án C:
Change the healthRoute value in your model’s configuration to /healthcheck
❌ Sai vì: Health route mặc định của Vertex AI là "/" (root path), không phải /healthcheck. Vertex AI gửi request GET đến http://localhost:8080/ để check readiness. Nếu config healthRoute thành /healthcheck, health check sẽ fail ngay. Tài liệu chỉ cho phép override healthRoute trong một số advanced cases, nhưng default / là chuẩn và nên dùng trước.

🟢 Phương án D (Đúng):
Pull the Docker image locally, and use the docker run command to launch it locally. Use the docker logs command to explore the error logs
✅ Đúng như đã giải thích ở trên: Phương án chuẩn debug flow, giúp isolate vấn đề nhanh chóng mà không ảnh hưởng production. Sau khi fix local (ví dụ: curl http://localhost:8080/ phải trả 200 OK), redeploy sẽ thành công.

Câu 243
You are developing an ML model to identify your company’s products in images. You have access to over one million images in a Cloud Storage bucket. You plan to experiment with different TensorFlow models by using Vertex AI Training. You need to read images at scale during training while minimizing data I/O bottlenecks. What should you do?
  1. A Load the images directly into the Vertex AI compute nodes by using Cloud Storage FUSE. Read the images by using the tf.data.Dataset.from_tensor_slices function
  2. B Create a Vertex AI managed dataset from your image data. Access the AIP_TRAINING_DATA_URI environment variable to read the images by using the tf.data.Dataset.list_files function.
  3. C Convert the images to TFRecords and store them in a Cloud Storage bucket. Read the TFRecords by using the tf.data.TFRecordDataset function.
  4. D Store the URLs of the images in a CSV file. Read the file by using the tf.data.experimental.CsvDataset function.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi tập trung vào việc phát triển mô hình ML để nhận diện sản phẩm công ty trong hình ảnh, sử dụng Vertex AI Training trên Google Cloud. Bạn có hơn 1 triệu hình ảnh lưu trong Cloud Storage bucket. Mục tiêu là thử nghiệm các mô hình TensorFlow khác nhau trong quá trình training, đồng thời đọc dữ liệu hình ảnh ở quy mô lớn (scale) mà giảm thiểu tắc nghẽn I/O (data I/O bottlenecks).

Vấn đề cốt lõi: Với lượng dữ liệu lớn, việc đọc trực tiếp từ Cloud Storage có thể gây chậm do latency mạng, đặc biệt trong distributed training. Cần phương pháp tối ưu hóa đọc dữ liệu để training nhanh hơn, hiệu quả hơn, phù hợp với TensorFlow và Vertex AI (theo tài liệu cập nhật Vertex AI đến 2024-2026, vẫn khuyến nghị TFRecords cho image data tại scale).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Convert the images to TFRecords and store them in a Cloud Storage bucket. Read the TFRecords by using the tf.data.TFRecordDataset function.

Lý do 🛠️:

  • TFRecords là định dạng chuẩn của TensorFlow để lưu trữ dữ liệu serialized (nhị phân), giúp nén và đọc nhanh hơn so với đọc raw images từ Cloud Storage.
  • Lưu trong Cloud Storage bucket vẫn dễ scale, nhưng đọc bằng tf.data.TFRecordDataset hỗ trợ prefetching, caching, parallelism – giảm I/O bottlenecks đáng kể trong Vertex AI Training (hỗ trợ distributed training với nhiều GPU/TPU).
  • Theo best practices mới nhất (2024+), đây là cách tối ưu nhất cho >1M images, tránh latency của HTTP reads từ GCS. Vertex AI hỗ trợ seamless integration với TFRecords cho custom training jobs.

📋 Giải thích chi tiết tất cả các phương án

Dưới đây là phân tích từng lựa chọn, với văn bản gốc giữ nguyên và giải thích hoàn toàn bằng tiếng Việt:

  • Load the images directly into the Vertex AI compute nodes by using Cloud Storage FUSE. Read the images by using the tf.data.Dataset.from_tensor_slices function
    ❌ Sai: Cloud Storage FUSE (gcsfuse) mount bucket như local filesystem, nhưng không hiệu quả cho training scale lớn vì overhead cao (metadata fetching, consistency issues). from_tensor_slices yêu cầu load toàn bộ data vào memory trước – gây OOM (out-of-memory) với 1M+ images và không parallel tốt trên distributed nodes.

  • Create a Vertex AI managed dataset from your image data. Access the AIP_TRAINING_DATA_URI environment variable to read the images by using the tf.data.Dataset.list_files function.
    ❌ Sai: Vertex AI managed dataset hữu ích cho AutoML, nhưng với custom TensorFlow training, biến môi trường AIP_TRAINING_DATA_URI không chuẩn (có thể ám chỉ AIPLATFORM_TRAINING_DATA_URI cũ, nay deprecated). list_files chỉ list URLs từ GCS – gây I/O bottlenecks nặng do sequential HTTP requests cho mỗi epoch, không scale tốt cho 1M images.

  • Convert the images to TFRecords and store them in a Cloud Storage bucket. Read the TFRecords by using the tf.data.TFRecordDataset function.
    ✅ Đúng: Như đã giải thích ở trên. TFRecords + TFRecordDataset là pipeline tối ưu, hỗ trợ sharding, interleaving, và zero-copy reads từ GCS. Giảm thời gian training lên đến 50-70% so với raw images (theo benchmarks TensorFlow 2.15+ và Vertex AI 2024).

  • Store the URLs of the images in a CSV file. Read the file by using the tf.data.experimental.CsvDataset function.
    ❌ Sai: Lưu URLs vào CSV rồi đọc bằng CsvDataset chỉ lấy danh sách paths – vẫn phải fetch từng image qua HTTP, gây latency cao và bottlenecks I/O nghiêm trọng ở scale lớn. Không serialized, không efficient cho training loops dài, dễ fail trên Vertex AI với nhiều workers.

Câu 244
You work at an ecommerce startup. You need to create a customer churn prediction model. Your company’s recent sales records are stored in a BigQuery table. You want to understand how your initial model is making predictions. You also want to iterate on the model as quickly as possible while minimizing cost. How should you build your first model?
  1. A Export the data to a Cloud Storage bucket. Load the data into a pandas DataFrame on Vertex AI Workbench and train a logistic regression model with scikit-learn.
  2. B Create a tf.data.Dataset by using the TensorFlow BigQueryClient. Implement a deep neural network in TensorFlow.
  3. C Prepare the data in BigQuery and associate the data with a Vertex AI dataset. Create an AutoMLTabularTrainingJob to tram a classification model.
  4. D Export the data to a Cloud Storage bucket. Create a tf.data.Dataset to read the data from Cloud Storage. Implement a deep neural network in TensorFlow.
Xem giải thích

🧩 Giải thích nội dung câu hỏi

Câu hỏi mô tả tình huống bạn làm việc tại một startup thương mại điện tử, cần xây dựng mô hình dự đoán churn khách hàng (khách hàng rời bỏ). Dữ liệu bán hàng gần đây lưu trong bảng BigQuery. Yêu cầu chính:

  • Hiểu cách mô hình ban đầu đưa ra dự đoán (explainability/interpretability).
  • Lặp lại (iterate) mô hình nhanh chóng nhất có thể.
  • Giảm thiểu chi phí (minimizing cost).

Mục tiêu là chọn cách xây dựng mô hình đầu tiên phù hợp nhất trên Google Cloud (Vertex AI ecosystem), tận dụng dữ liệu BigQuery mà không cần di chuyển dữ liệu phức tạp. Đây là câu hỏi kiểm tra kiến thức về Vertex AI AutoML Tabular – giải pháp no-code/low-code lý tưởng cho tabular data như churn prediction (phân loại nhị phân). Kiến thức cập nhật đến 2026: Vertex AI vẫn ưu tiên AutoML cho prototyping nhanh với Model Insights (giải thích dự đoán), tích hợp trực tiếp BigQuery mà không export (giảm cost và thời gian).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Prepare the data in BigQuery and associate the data with a Vertex AI dataset. Create an AutoMLTabularTrainingJob to tram a classification model.

Lý do:

  • 🛠️ Tích hợp trực tiếp BigQuery: Chuẩn bị dữ liệu ngay trong BigQuery (SQL query), liên kết với Vertex AI Dataset mà không cần export → tiết kiệm chi phí lưu trữ/IO và thời gian.
  • 🚀 Iterate nhanh: AutoML Tabular tự động train hàng loạt mô hình (XGBoost, etc.), deploy nhanh, hỗ trợ hyperparameter tuning tự động.
  • 🔍 Hiểu dự đoán: Vertex AI cung cấp Model Insights (feature attributions, global explanations) để giải thích cách mô hình predict churn.
  • 💰 Minimize cost: No-code, serverless, chỉ tính phí training thời gian thực thi (rẻ hơn custom code). Lý tưởng cho mô hình đầu tiên ở startup.
  • Phù hợp churn prediction (tabular classification) theo best practices Vertex AI 2026.

❌ Giải thích tất cả các phương án

Dưới đây là phân tích chi tiết từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá dựa trên yêu cầu: explainability, tốc độ iterate, chi phí.

  • Phương án 1 (SAI): Export the data to a Cloud Storage bucket. Load the data into a pandas DataFrame on Vertex AI Workbench and train a logistic regression model with scikit-learn.
    ❌ Lý do sai: Export sang Cloud Storage tốn kém (storage + transfer cost), load pandas thủ công chậm với dataset lớn. Logistic regression đơn giản nhưng thiếu explainability tự động (phải code SHAP/LIME). Iterate chậm vì phải retrain thủ công trên Workbench, không tối ưu cho prototype nhanh.

  • Phương án 2 (SAI): Create a tf.data.Dataset by using the TensorFlow BigQueryClient. Implement a deep neural network in TensorFlow.
    ❌ Lý do sai: tf.data.Dataset từ BigQueryClient hiệu quả nhưng implement DNN từ đầu quá phức tạp/overkill cho churn (tabular data, linear models tốt hơn). Thiếu explainability native (TensorFlow cần thêm công cụ như TensorFlow Explain). Iterate chậm (code/debug/train), cost cao do GPU/TPU cho DNN không cần thiết.

  • Phương án 3 (ĐÚNG): Prepare the data in BigQuery and associate the data with a Vertex AI dataset. Create an AutoMLTabularTrainingJob to tram a classification model.
    ✅ Lý do đúng: Như đã giải thích ở trên – hoàn hảo khớp tất cả yêu cầu: trực tiếp BigQuery → Vertex AI Dataset → AutoML train classification (fix lỗi "tram" là "train"). Nhanh (giờ thay vì ngày), rẻ, có explainability built-in.

  • Phương án 4 (SAI): Export the data to a Cloud Storage bucket. Create a tf.data.Dataset to read the data from Cloud Storage. Implement a deep neural network in TensorFlow.
    ❌ Lý do sai: Tương tự phương án 1+2: Export không cần thiết (tăng cost), DNN phức tạp cho tabular churn, thiếu explainability dễ dàng. Iterate chậm vì custom TensorFlow pipeline, không phù hợp "first model" ở startup.

Câu 245
You are developing a training pipeline for a new XGBoost classification model based on tabular data. The data is stored in a BigQuery table. You need to complete the following steps:

1. Randomly split the data into training and evaluation datasets in a 65/35 ratio
2. Conduct feature engineering
3. Obtain metrics for the evaluation dataset
4. Compare models trained in different pipeline executions

How should you execute these steps?
  1. A 1. Using Vertex AI Pipelines, add a component to divide the data into training and evaluation sets, and add another component for feature engineering.
    2. Enable autologging of metrics in the training component.
    3. Compare pipeline runs in Vertex AI Experiments.
  2. B 1. Using Vertex AI Pipelines, add a component to divide the data into training and evaluation sets, and add another component for feature engineering.
    2. Enable autologging of metrics in the training component.
    3. Compare models using the artifacts’ lineage in Vertex ML Metadata.
  3. C 1. In BigQuery ML, use the CREATE MODEL statement with BOOSTED_TREE_CLASSIFIER as the model type and use BigQuery to handle the data splits.
    2. Use a SQL view to apply feature engineering and train the model using the data in that view.
    3. Compare the evaluation metrics of the models by using a SQL query with the ML.TRAINING_INFO statement.
  4. D 1. In BigQuery ML, use the CREATE MODEL statement with BOOSTED_TREE_CLASSIFIER as the model type and use BigQuery to handle the data splits.
    2. Use ML TRANSFORM to specify the feature engineering transformations and tram the model using the data in the table.
    3. Compare the evaluation metrics of the models by using a SQL query with the ML.TRAINING_INFO statement.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi yêu cầu xây dựng một pipeline huấn luyện mô hình XGBoost phân loại dựa trên dữ liệu bảng (tabular data) lưu trữ trong BigQuery. Các bước cụ thể cần thực hiện bao gồm:

  • Bước 1: Phân chia ngẫu nhiên dữ liệu thành tập huấn luyện (training) và đánh giá (evaluation) với tỷ lệ 65/35.
  • Bước 2: Thực hiện feature engineering (kỹ thuật xử lý đặc trưng).
  • Bước 3: Lấy metrics (chỉ số đánh giá) trên tập evaluation.
  • Bước 4: So sánh các mô hình được huấn luyện từ các lần chạy pipeline khác nhau.

Mục tiêu là chọn cách thực hiện tối ưu nhất các bước này trong hệ sinh thái Google Cloud Vertex AI (phiên bản mới nhất đến 2026, với Vertex AI Pipelines hỗ trợ Kubeflow và custom components linh hoạt cho XGBoost). Câu hỏi nhấn mạnh vào pipeline có thể tái sử dụng, theo dõi metrics tự động và so sánh thí nghiệm dễ dàng. 📘 Tài liệu tham khảo: Vertex AI Pipelines Documentation, Vertex AI Experiments, BigQuery ML BOOSTED_TREE_CLASSIFIER.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng là lựa chọn đầu tiên:

  1. Using Vertex AI Pipelines, add a component to divide the data into training and evaluation sets, and add another component for feature engineering.
  2. Enable autologging of metrics in the training component.
  3. Compare pipeline runs in Vertex AI Experiments.

Lý do 🛠️:

  • Vertex AI Pipelines hỗ trợ xây dựng pipeline tùy chỉnh với các component riêng biệt: một component đọc dữ liệu từ BigQuery và split 65/35 (sử dụng tfds.core.Split hoặc custom Python), component khác cho feature engineering (như scikit-learn hoặc TensorFlow Transform).
  • Autologging metrics (qua Vertex AI SDK hoặc MLflow integration) tự động ghi metrics từ evaluation dataset vào pipeline run, hỗ trợ XGBoost qua xgboost với vertexai.preview (cập nhật 2024-2026).
  • Vertex AI Experiments cho phép so sánh trực quan các pipeline runs, metrics, hyperparameters và models qua UI/CLI, lý tưởng cho việc track và chọn best model. Đây là cách chuẩn và scalable nhất cho custom XGBoost pipeline. ✅

📋 Giải thích chi tiết tất cả các phương án

Dưới đây là phân tích từng lựa chọn, với giữ nguyên văn bản gốc bằng tiếng Anh. Tôi sử dụng ✅ cho đúng và ❌ cho sai, kèm lý do cụ thể dựa trên tính khả thi, linh hoạt và phù hợp với yêu cầu.

  • ✅ Phương án 1 (Đúng):

    1. Using Vertex AI Pipelines, add a component to divide the data into training and evaluation sets, and add another component for feature engineering.
    2. Enable autologging of metrics in the training component.
    3. Compare pipeline runs in Vertex AI Experiments.
      Giải thích: Như đã nêu ở phần đáp án đúng. Phương án này hoàn hảo khớp tất cả 4 bước, hỗ trợ XGBoost custom training, autologging qua aiplatform.log_metrics(), và Experiments tích hợp sẵn để compare runs (bao gồm lineage, metrics visualization). Linh hoạt cho feature engineering phức tạp. 🏆
  • ❌ Phương án 2 (Sai):

    1. Using Vertex AI Pipelines, add a component to divide the data into training and evaluation sets, and add another component for feature engineering.
    2. Enable autologging of metrics in the training component.
    3. Compare models using the artifacts’ lineage in Vertex ML Metadata.
      Giải thích: Bước 1-2 đúng, nhưng bước 3 sai vì Vertex ML Metadata chỉ dùng để track lineage (dòng dõi artifacts như data/models), không hỗ trợ so sánh metrics/models trực quan như Experiments. Không phù hợp cho "compare models trained in different pipeline executions" một cách dễ dàng. 🧩
  • ❌ Phương án 3 (Sai):

    1. In BigQuery ML, use the CREATE MODEL statement with BOOSTED_TREE_CLASSIFIER as the model type and use BigQuery to handle the data splits.
    2. Use a SQL view to apply feature engineering and train the model using the data in that view.
    3. Compare the evaluation metrics of the models by using a SQL query with the ML.TRAINING_INFO statement.
      Giải thích: BigQuery ML hỗ trợ BOOSTED_TREE_CLASSIFIER (dựa XGBoost) và split data (nhưng mặc định 80/20, có thể tùy chỉnh FRACTION), song:
    • Feature engineering qua SQL view chỉ cơ bản (aggregation, bucketing), không linh hoạt cho complex transforms (như encoding categorical cao cardinality).
    • ML.TRAINING_INFO chỉ query training history của một model, không dễ so sánh multiple models qua SQL queries phức tạp. Không phải pipeline thực thụ, thiếu autologging và UI compare. 🚫
  • ❌ Phương án 4 (Sai):

    1. In BigQuery ML, use the CREATE MODEL statement with BOOSTED_TREE_CLASSIFIER as the model type and use BigQuery to handle the data splits.
    2. Use ML TRANSFORM to specify the feature engineering transformations and tram the model using the data in the table.
    3. Compare the evaluation metrics of the models by using a SQL query with the ML.TRAINING_INFO statement.
      Giải thích: Tương tự phương án 3, nhưng ML.TRANSFORM (cập nhật BigQuery ML 2023+) hỗ trợ feature engineering tốt hơn (tokenize, normalize). Tuy nhiên:
    • Vẫn bị giới hạn ở SQL-based pipeline, không scalable cho custom XGBoost.
    • Split tỷ lệ 65/35 có thể chỉ định nhưng không "randomly split" linh hoạt như Vertex AI.
    • So sánh qua ML.TRAINING_INFO vẫn thủ công, không hỗ trợ "pipeline executions" đa runs. Không khớp yêu cầu đầy đủ. 🔧

Kết luận 🎯: Vertex AI Pipelines + Experiments là lựa chọn best practice cho ML pipeline end-to-end trên Google Cloud (2026), vượt trội BigQuery ML về tùy chỉnh và tracking. Nếu cần code sample, tham khảo Vertex AI XGBoost Pipeline Tutorial.

Câu 246
You work for a company that sells corporate electronic products to thousands of businesses worldwide. Your company stores historical customer data in BigQuery. You need to build a model that predicts customer lifetime value over the next three years. You want to use the simplest approach to build the model and you want to have access to visualization tools. What should you do?
  1. A Create a Vertex AI Workbench notebook to perform exploratory data analysis. Use IPython magics to create a new BigQuery table with input features. Use the BigQuery console to run the CREATE MODEL statement. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
  2. B Run the CREATE MODEL statement from the BigQuery console to create an AutoML model. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
  3. C Create a Vertex AI Workbench notebook to perform exploratory data analysis and create input features. Save the features as a CSV file in Cloud Storage. Import the CSV file as a new BigQuery table. Use the BigQuery console to run the CREATE MODEL statement. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
  4. D Create a Vertex AI Workbench notebook to perform exploratory data analysis. Use IPython magics to create a new BigQuery table with input features, create the model, and validate the results by using the CREATE MODEL, ML.EVALUATE, and ML.PREDICT statements.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả một công ty bán sản phẩm điện tử doanh nghiệp cho hàng nghìn doanh nghiệp toàn cầu, lưu trữ dữ liệu khách hàng lịch sử trong BigQuery. Nhiệm vụ là xây dựng mô hình dự đoán giá trị vòng đời khách hàng (customer lifetime value) trong 3 năm tới. Yêu cầu chính:

  • Sử dụng cách tiếp cận đơn giản nhất (simplest approach) để xây dựng mô hình.
  • Có quyền truy cập vào công cụ trực quan hóa (visualization tools).

📘 Bối cảnh kiến thức GCP mới nhất (đến 2026): BigQuery ML cho phép xây dựng và huấn luyện mô hình ML trực tiếp trong BigQuery mà không cần di chuyển dữ liệu, hỗ trợ các lệnh SQL như CREATE MODEL, ML.EVALUATE, ML.PREDICT. Vertex AI Workbench (trước đây là AI Platform Notebooks) cung cấp Jupyter notebook với IPython magics (%%bigquery) để chạy SQL trực tiếp từ notebook, kết hợp EDA (Exploratory Data Analysis) với viz tools như Matplotlib/Seaborn. Đây là cách đơn giản nhất vì tích hợp EDA, feature engineering, training và evaluation trong một môi trường duy nhất, không export data. (Nguồn: BigQuery ML Documentation, Vertex AI Workbench, cập nhật Q1 2026).

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Create a Vertex AI Workbench notebook to perform exploratory data analysis. Use IPython magics to create a new BigQuery table with input features, create the model, and validate the results by using the CREATE MODEL, ML.EVALUATE, and ML.PREDICT statements.

Lý do 🛠️:

  • Đây là cách đơn giản nhất vì toàn bộ quy trình (EDA với viz tools, tạo features, training model bằng BigQuery ML, evaluate/predict) diễn ra trong một Vertex AI Workbench notebook duy nhất.
  • IPython magics (%%bigquery) cho phép chạy SQL BigQuery trực tiếp từ notebook, tạo table features, CREATE MODEL mà không cần rời notebook hoặc export data.
  • Đáp ứng viz tools qua thư viện Python (Matplotlib, etc.) trong notebook.
  • Tiết kiệm thời gian, không phức tạp hóa bằng console hay GCS. Hoàn hảo cho regression task như customer lifetime value (dùng algo như BOOSTED_TREE_REGRESSOR hoặc ARIMA_PLUS trong BigQuery ML).

📋 Giải thích tất cả các phương án (đúng/sai)

  • ❌ Phương án SAI: Create a Vertex AI Workbench notebook to perform exploratory data analysis. Use IPython magics to create a new BigQuery table with input features. Use the BigQuery console to run the CREATE MODEL statement. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
    Lý do sai: Mặc dù dùng notebook cho EDA và magics tạo features (tốt), nhưng tách rời quy trình bằng cách chuyển sang BigQuery console để CREATE MODEL, evaluate/predict. Không đơn giản nhất vì phải switch tool, mất viz liền mạch.

  • ❌ Phương án SAI: Run the CREATE MODEL statement from the BigQuery console to create an AutoML model. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
    Lý do sai: Chỉ dùng console, thiếu EDA và viz tools (console chỉ SQL cơ bản, không viz Python). BigQuery ML hỗ trợ AutoML Tables qua CREATE MODEL với MODEL_TYPE='AUTO', nhưng bỏ qua bước khám phá dữ liệu từ BigQuery gốc, không simplest cho task phức tạp như lifetime value cần feature engineering.

  • ❌ Phương án SAI: Create a Vertex AI Workbench notebook to perform exploratory data analysis and create input features. Save the features as a CSV file in Cloud Storage. Import the CSV file as a new BigQuery table. Use the BigQuery console to run the CREATE MODEL statement. Validate the results by using the ML.EVALUATE and ML.PREDICT statements.
    Lý do sai: Quá phức tạp và không cần thiết (export CSV sang GCS, import lại BigQuery). Dùng magics có thể tạo table trực tiếp mà không export. Lại tách sang console cho model, vi phạm simplest approach và viz liền mạch.

  • ✅ Phương án ĐÚNG (như đã giải thích ở trên): Tích hợp toàn bộ trong notebook với magics, đảm bảo đơn giản, viz đầy đủ và hiệu quả cao nhất theo best practices GCP 2026.

🔗 Tài liệu tham khảo chính:

Câu 247
You work for a delivery company. You need to design a system that stores and manages features such as parcels delivered and truck locations over time. The system must retrieve the features with low latency and feed those features into a model for online prediction. The data science team will retrieve historical data at a specific point in time for model training. You want to store the features with minimal effort. What should you do?
  1. A Store features in Bigtable as key/value data.
  2. B Store features in Vertex AI Feature Store.
  3. C Store features as a Vertex AI dataset, and use those features to train the models hosted in Vertex AI endpoints.
  4. D Store features in BigQuery timestamp partitioned tables, and use the BigQuery Storage Read API to serve the features.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả một tình huống thực tế trong công ty giao hàng 🚚: Bạn cần thiết kế hệ thống lưu trữ và quản lý các đặc trưng (features) như vị trí xe tải, số lượng hàng hóa đã giao theo thời gian. Yêu cầu chính bao gồm:

  • Truy xuất features với độ trễ thấp (low latency) để đưa vào mô hình dự đoán online (thời gian thực).
  • Đội ngũ data science cần lấy dữ liệu lịch sử tại một thời điểm cụ thể (point-in-time) để huấn luyện mô hình.
  • Mục tiêu: Lưu trữ với nỗ lực tối thiểu (minimal effort).

Đây là bài toán điển hình về Feature Store trong ML pipeline trên Google Cloud (GCP), nơi cần hỗ trợ cả online serving (thấp latency) và offline retrieval (historical data). 📈 Vertex AI là nền tảng ML chính thức của Google Cloud (cập nhật đến 2026), tối ưu hóa cho các yêu cầu này.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Store features in Vertex AI Feature Store.
🛠️ Lý do: Vertex AI Feature Store (phiên bản mới nhất 2026) được thiết kế chuyên biệt cho việc lưu trữ features ML với:

  • Online serving: Độ trễ mili-giây (<100ms), hỗ trợ serving vectorized features cho prediction real-time.
  • Offline serving: Truy xuất historical features tại point-in-time chính xác, tích hợp trực tiếp với Vertex AI Training/Pipelines.
  • Minimal effort: Tự động hóa versioning, consistency giữa online/offline, không cần quản lý infrastructure thủ công. Điều này khớp hoàn hảo với yêu cầu low-latency online prediction và historical training.
    📘 Nguồn tham khảo: Vertex AI Feature Store Documentation (Google Cloud, cập nhật 2026).

📋 Giải thích tất cả các phương án

Dưới đây là phân tích từng lựa chọn, giữ nguyên nội dung gốc tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do chi tiết:

  • Store features in Bigtable as key/value data.
    ❌ Sai: Bigtable là NoSQL database mạnh về throughput cao và scalability, nhưng không được tối ưu cho ML features. Nó thiếu hỗ trợ point-in-time retrieval tự động, versioning features, và online serving low-latency chuyên biệt cho prediction. Bạn phải tự build logic phức tạp (ví dụ: row key với timestamp), dẫn đến effort cao, dễ lỗi consistency giữa online/offline. Không phù hợp minimal effort.
    📘 Nguồn: Bigtable Docs.

  • Store features in Vertex AI Feature Store.
    ✅ Đúng: Như đã giải thích ở trên, đây là giải pháp best practice của Google Cloud cho feature management. Hỗ trợ Feature Online Store (Redis-based, low latency) và Feature Offline Store (BigQuery-based, point-in-time queries). Tích hợp seamless với Vertex AI endpoints cho prediction và training. Minimal effort nhờ managed service.
    📘 Nguồn: Vertex AI Feature Store Best Practices.

  • Store features as a Vertex AI dataset, and use those features to train the models hosted in Vertex AI endpoints.
    ❌ Sai: Vertex AI Dataset dùng để chuẩn bị dữ liệu huấn luyện (như Tabular/Image/Video datasets), không phải cho online serving low-latency. Nó chỉ hỗ trợ batch training/offline, thiếu real-time retrieval và point-in-time cho serving. Không đáp ứng "feed features into a model for online prediction" và effort vẫn cao vì phải quản lý riêng serving layer.
    📘 Nguồn: Vertex AI Datasets Docs.

  • Store features in BigQuery timestamp partitioned tables, and use the BigQuery Storage Read API to serve the features.
    ❌ Sai: BigQuery tuyệt vời cho analytics và historical queries (partitioned tables hỗ trợ point-in-time), Storage Read API tăng tốc read throughput. Tuy nhiên, latency cao (giây thay vì mili-giây) cho online prediction – không phù hợp real-time serving. Phải tự build serving infrastructure, vi phạm minimal effort. Vertex AI Feature Store dùng BigQuery làm offline store nhưng thêm layer online riêng.
    📘 Nguồn: BigQuery Storage Read API.

Câu 248
You are working on a prototype of a text classification model in a managed Vertex AI Workbench notebook. You want to quickly experiment with tokenizing text by using a Natural Language Toolkit (NLTK) library. How should you add the library to your Jupyter kernel?
  1. A Install the NLTK library from a terminal by using the pip install nltk command.
  2. B Write a custom Dataflow job that uses NLTK to tokenize your text and saves the output to Cloud Storage.
  3. C Create a new Vertex AI Workbench notebook with a custom image that includes the NLTK library.
  4. D Install the NLTK library from a Jupyter cell by using the !pip install nltk --user command.
Xem giải thích

🧩 Giải thích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào việc thêm thư viện NLTK (Natural Language Toolkit) vào Jupyter kernel trong một Vertex AI Workbench notebook được quản lý (managed) trên Google Cloud, nhằm thử nghiệm nhanh (quickly experiment) với việc tokenize văn bản cho mô hình phân loại văn bản (text classification model prototype).

  • Bối cảnh chính: Bạn đang làm việc trong môi trường notebook Vertex AI Workbench (trước đây gọi là AI Platform Notebooks, nay là Vertex AI Workbench user-managed notebooks). Đây là môi trường Jupyter Notebook được host trên GCP, hỗ trợ ML workflows.
  • Yêu cầu cốt lõi: Cần thêm thư viện NLTK một cách nhanh chóng mà không làm gián đoạn workflow thử nghiệm. NLTK là thư viện Python phổ biến cho xử lý ngôn ngữ tự nhiên (NLP), dùng để tokenize text.
  • Phiên bản cập nhật: Theo tài liệu GCP Vertex AI Workbench mới nhất (tính đến 2026, Vertex AI v1.50+), môi trường notebook mặc định dựa trên Debian/Ubuntu với Python pre-installed, và hỗ trợ install packages qua pip từ cell notebook để tránh vấn đề quyền hạn (permissions) trong container managed.

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Install the NLTK library from a Jupyter cell by using the !pip install nltk --user command.

Lý do:

  • Đây là cách nhanh nhất và phù hợp nhất cho thử nghiệm prototype trong Vertex AI Workbench notebook. Lệnh !pip install nltk --user chạy trực tiếp từ Jupyter cell (sử dụng magic command ! để chạy shell command), install NLTK vào user space (--user flag tránh vấn đề quyền hệ thống trong container managed).
  • Không cần restart kernel, thư viện sẵn dùng ngay sau install. Phù hợp với nguyên tắc "quick experiment" 🛠️.
  • Vertex AI Workbench hỗ trợ đầy đủ pip từ cell, và --user đảm bảo install persistent cho user mà không ảnh hưởng shared environment.

❌ Giải thích tất cả các phương án (đúng/sai)

  • [SAI] Install the NLTK library from a terminal by using the pip install nltk command.
    ❌ Sai vì: Trong Vertex AI Workbench managed notebook, terminal (truy cập qua JupyterLauncher) thường không có quyền sudo, dẫn đến lỗi permission khi chạy pip install trực tiếp. Không dùng --user nên install thất bại. Cách này chậm hơn so với chạy từ cell và không "quick". (Tài liệu GCP khuyên dùng cell install thay vì terminal cho user-managed notebooks).

  • [SAI] Write a custom Dataflow job that uses NLTK to tokenize your text and saves the output to Cloud Storage.
    ❌ Sai vì: Dataflow (Apache Beam trên GCP) dùng cho batch processing lớn-scale, không phải để install library hay experiment nhanh trong notebook. Phải viết code job riêng, submit qua SDK, lưu output ra Cloud Storage – quá phức tạp, tốn thời gian và chi phí cho prototype đơn giản như tokenize text. 🛠️ Không liên quan trực tiếp đến việc thêm library vào kernel.

  • [SAI] Create a new Vertex AI Workbench notebook with a custom image that includes the NLTK library.
    ❌ Sai vì: Tạo notebook mới với custom container image (qua Docker, push lên Artifact Registry) yêu cầu build image từ đầu, test, deploy – mất hàng giờ/ngày, không "quickly experiment". Chỉ phù hợp production, không phải prototype. Vertex AI hỗ trợ custom runtime nhưng khuyến nghị install runtime cho dev workflows.

Tóm lại, lựa chọn đúng tận dụng tính năng built-in của Jupyter + Vertex AI để tối ưu tốc độ và đơn giản! 🚀

Câu 249
You have recently used TensorFlow to train a classification model on tabular data. You have created a Dataflow pipeline that can transform several terabytes of data into training or prediction datasets consisting of TFRecords. You now need to productionize the model, and you want the predictions to be automatically uploaded to a BigQuery table on a weekly schedule. What should you do?
  1. A Import the model into Vertex AI and deploy it to a Vertex AI endpoint. On Vertex AI Pipelines, create a pipeline that uses the DataflowPythonJobOp and the ModelBacthPredictOp components.
  2. B Import the model into Vertex AI and deploy it to a Vertex AI endpoint. Create a Dataflow pipeline that reuses the data processing logic sends requests to the endpoint, and then uploads predictions to a BigQuery table.
  3. C Import the model into Vertex AI. On Vertex AI Pipelines, create a pipeline that uses the
    DataflowPvthonJobOp and the ModelBatchPredictOp components.
  4. D Import the model into BigQuery. Implement the data processing logic in a SQL query. On Vertex AI Pipelines create a pipeline that uses the BigquervQueryJobOp and the BigqueryPredictModelJobOp components.
Xem giải thích

✅ Giải thích nội dung câu hỏi

🧩 Tình huống vấn đề: Bạn đã sử dụng TensorFlow để huấn luyện một mô hình phân loại (classification model) trên dữ liệu bảng (tabular data). Bạn đã xây dựng một pipeline Dataflow có khả năng biến đổi hàng terabyte dữ liệu thô thành các tập dữ liệu huấn luyện hoặc dự đoán dưới định dạng TFRecords. Bây giờ, bạn cần sản xuất hóa (productionize) mô hình này, nghĩa là triển khai để tự động tạo dự đoán (predictions) và tải lên bảng BigQuery theo lịch hàng tuần (weekly schedule).

🛠️ Yêu cầu chính:

  • Xử lý dữ liệu lớn (TB scale) qua Dataflow để tạo TFRecords.
  • Tạo batch predictions (dự đoán hàng loạt, không phải real-time).
  • Tích hợp tự động với BigQuery mà không cần can thiệp thủ công.
  • Sử dụng các công cụ Vertex AI hiện đại (cập nhật đến 2026, Vertex AI Pipelines hỗ trợ các components như DataflowPythonJobOp và ModelBatchPredictOp cho batch prediction hiệu quả, với output trực tiếp đến BigQuery).

📘 Bối cảnh kiến thức: Đây là câu hỏi về Google Cloud Vertex AI (không phải AWS như đề cập nhầm), tập trung vào quy trình MLOps cho batch prediction trên dữ liệu lớn. Vertex AI Pipelines cho phép orchestrate (điều phối) toàn bộ workflow từ data processing đến prediction và storage.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng:
Import the model into Vertex AI. On Vertex AI Pipelines, create a pipeline that uses the
DataflowPvthonJobOp and the ModelBatchPredictOp components.

🧩 Lý do chi tiết:

  • Import model vào Vertex AI: Đây là bước đầu tiên chuẩn để quản lý mô hình TensorFlow trong Vertex AI Model Registry, hỗ trợ TFRecords input/output.
  • Vertex AI Pipelines: Sử dụng để tạo pipeline orchestrated, chạy theo lịch (schedule) hàng tuần qua Cloud Scheduler hoặc pipeline trigger.
  • DataflowPythonJobOp: Component tái sử dụng logic Dataflow hiện có để transform dữ liệu lớn thành TFRecords (Apache Beam Python job trên Dataflow).
  • ModelBatchPredictOp: Component chuyên dụng cho batch prediction (không cần endpoint online), input TFRecords từ Dataflow, output predictions tự động lưu vào BigQuery (hỗ trợ BigQuery destination từ Vertex AI v1.5+ đến 2026).
  • Ưu điểm: Hiệu quả chi phí (batch mode), scalable cho TB data, fully managed, không cần custom code gọi API endpoint. Phù hợp productionize tự động.

📋 Phân tích tất cả các phương án

  • Phương án A:
    Import the model into Vertex AI and deploy it to a Vertex AI endpoint. On Vertex AI Pipelines, create a pipeline that uses the DataflowPythonJobOp and the ModelBacthPredictOp components.
    ❌ Sai vì: Deploy model lên Vertex AI endpoint là cho online prediction (real-time inference), không phù hợp với batch weekly và lãng phí tài nguyên. Component ModelBatchPredictOp (lỗi chính tả "Bacth") dùng cho batch, không cần endpoint. Kết hợp này dư thừa và không tối ưu.

  • Phương án B:
    Import the model into Vertex AI and deploy it to a Vertex AI endpoint. Create a Dataflow pipeline that reuses the data processing logic sends requests to the endpoint, and then uploads predictions to a BigQuery table.
    ❌ Sai vì: Yêu cầu deploy endpoint (online), rồi dùng Dataflow custom để gọi REST API endpoint – phức tạp, tốn kém (endpoint luôn chạy), dễ lỗi network/scale cho TB data. Không tận dụng native batch predict của Vertex AI, phải code thủ công upload BigQuery (dùng BigQueryInsertJob).

  • Phương án C (Đúng):
    Import the model into Vertex AI. On Vertex AI Pipelines, create a pipeline that uses the
    DataflowPvthonJobOp and the ModelBatchPredictOp components.

    ✅ Đúng vì: Như giải thích ở trên – pipeline đầy đủ, native support TFRecords → batch predict → BigQuery auto-upload, schedule dễ dàng. Không cần endpoint, tối ưu cho batch weekly (cập nhật Vertex AI Pipelines 2026 hỗ trợ parameterized scheduling).

  • Phương án D:
    Import the model into BigQuery. Implement the data processing logic in a SQL query. On Vertex AI Pipelines create a pipeline that uses the BigquervQueryJobOp and the BigqueryPredictModelJobOp components.
    ❌ Sai vì: BigQuery ML chỉ hỗ trợ import model đơn giản (như AutoML hoặc native SQL models), không hỗ trợ đầy đủ TensorFlow classification trên TFRecords phức tạp. Data processing TB scale không thể dùng SQL query thuần (cần Dataflow). Components BigQueryQueryJobOp (lỗi "Bigquerv") và BigQueryPredictModelJobOp không tồn tại hoặc không phù hợp (BigQuery ML dùng CREATE MODEL + ML.PREDICT, không integrate trực tiếp Vertex AI Pipelines như vậy).

📘 Tài liệu tham khảo (cập nhật 2026)

Hy vọng phân tích này giúp bạn ôn thi Google Cloud Professional ML Engineer hiệu quả! 🚀

Câu 250
You work for an online grocery store. You recently developed a custom ML model that recommends a recipe when a user arrives at the website. You chose the machine type on the Vertex AI endpoint to optimize costs by using the queries per second (QPS) that the model can serve, and you deployed it on a single machine with 8 vCPUs and no accelerators.

A holiday season is approaching and you anticipate four times more traffic during this time than the typical daily traffic. You need to ensure that the model can scale efficiently to the increased demand. What should you do?
  1. A 1. Maintain the same machine type on the endpoint.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, add a compute node to the endpoint.
  2. B 1. Change the machine type on the endpoint to have 32 vCPUs.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, scale the vCPUs further as needed.
  3. C 1. Maintain the same machine type on the endpoint Configure the endpoint to enable autoscaling based on vCPU usage.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, investigate the cause.
  4. D 1. Change the machine type on the endpoint to have a GPU. Configure the endpoint to enable autoscaling based on the GPU usage.
    2. Set up a monitoring job and an alert for GPU usage.
    3. If you receive an alert, investigate the cause.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi mô tả tình huống thực tế trong Google Cloud Vertex AI (không phải AWS như đề cập ban đầu, có thể là nhầm lẫn chủ đề):
Bạn đang làm việc cho một cửa hàng tạp hóa trực tuyến, đã phát triển mô hình ML tùy chỉnh để gợi ý công thức nấu ăn khi người dùng truy cập website. Bạn đã chọn loại máy (machine type) trên Vertex AI endpoint dựa trên queries per second (QPS) để tối ưu chi phí, triển khai trên một máy duy nhất với 8 vCPUs và không có accelerator.

Bây giờ, mùa lễ hội sắp đến, lưu lượng truy cập dự kiến tăng gấp 4 lần so với bình thường. Nhiệm vụ là đảm bảo mô hình scale hiệu quả để xử lý nhu cầu tăng cao mà không lãng phí tài nguyên.

🛠️ Yêu cầu chính: Cần một giải pháp tự động scale (autoscaling), giám sát (monitoring), và xử lý sự cố (troubleshooting) phù hợp với Vertex AI, tận dụng tính năng autoscaling dựa trên vCPU để linh hoạt và tiết kiệm chi phí.

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng là phương án thứ 3:

  1. Maintain the same machine type on the endpoint Configure the endpoint to enable autoscaling based on vCPU usage.
  2. Set up a monitoring job and an alert for CPU usage.
  3. If you receive an alert, investigate the cause.

Lý do:

  • Vertex AI hỗ trợ autoscaling cho endpoints (từ phiên bản 2021 và cập nhật đến 2026), cho phép scale tự động dựa trên vCPU utilization (mặc định 60% target, min/max instances tùy chỉnh). Giữ nguyên machine type (8 vCPUs) giúp tối ưu chi phí, chỉ scale số lượng instances khi traffic tăng x4.
  • Bước 2: Sử dụng Vertex AI Monitoring hoặc Cloud Monitoring để theo dõi CPU và alert.
  • Bước 3: Investigate là cách xử lý đúng vì autoscaling đã tự động, alert chỉ để kiểm tra nguyên nhân (như bottleneck khác).
    ✅ Phù hợp best practice: Scale horizontal (thêm instances) thay vì vertical (thay machine), tiết kiệm và hiệu quả cho traffic spike.

📘 Tài liệu tham khảo:

📝 Giải thích tất cả các phương án

Dưới đây là phân tích từng phương án một cách chi tiết, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án gồm 3 bước logic, tôi đánh giá dựa trên tính khả thi, hiệu quả scale và best practice Vertex AI (cập nhật 2026).

  • Phương án 1:

    1. Maintain the same machine type on the endpoint.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, add a compute node to the endpoint.
      ❌ Sai: Không enable autoscaling, chỉ monitor và thêm node thủ công (manual scaling). Với traffic x4 đột ngột, manual không kịp thời, dẫn đến latency cao hoặc downtime. Vertex AI ưu tiên autoscaling tự động hơn manual.
  • Phương án 2:

    1. Change the machine type on the endpoint to have 32 vCPUs.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, scale the vCPUs further as needed.
      ❌ Sai: Vertical scaling (tăng vCPUs lên 32) lãng phí chi phí vì phải redeploy endpoint, và model chỉ cần 8 vCPUs ban đầu (dựa QPS). Scale vCPUs further vẫn manual, không linh hoạt cho spike traffic. Vertex AI khuyến nghị horizontal scaling (thêm instances) thay vì vertical.
  • Phương án 3 (Đúng - đã giải thích ở trên):

    1. Maintain the same machine type on the endpoint Configure the endpoint to enable autoscaling based on vCPU usage.
    2. Set up a monitoring job and an alert for CPU usage.
    3. If you receive an alert, investigate the cause.
      ✅ Đúng: Kết hợp autoscaling vCPU-based (tự động scale instances), monitoring, và investigate – hoàn hảo cho traffic tăng x4 mà giữ chi phí thấp.
  • Phương án 4:

    1. Change the machine type on the endpoint to have a GPU. Configure the endpoint to enable autoscaling based on the GPU usage.
    2. Set up a monitoring job and an alert for GPU usage.
    3. If you receive an alert, investigate the cause.
      ❌ Sai: Model không cần GPU (chỉ CPU-based recipe recommendation, no accelerators ban đầu). Thêm GPU tăng chi phí cao (GPU đắt hơn vCPU 5-10x), autoscaling GPU không phù hợp metric (model inference nhẹ). Redeploy với GPU gây gián đoạn không cần thiết.

🧩 Kết luận: Giải pháp đúng tận dụng autoscaling của Vertex AI để scale horizontal, kết hợp monitoring – lý tưởng cho production ML serving với traffic biến động! 🚀