⚡ Free Classes and Scholarships Available for Underprivileged Students -

Serving models

Serving and Scaling Models

Set 1
10 Questions
No time limit
Practice Mode
0%
Score
0
Correct
0
Incorrect
10
Total Questions
Back to Topics
Question 1 of 10
You need to deploy a fraud detection model that processes credit card transactions in real-time with response times under 100ms. The model receives approximately 5,000 requests per second with unpredictable traffic spikes. Which Vertex AI deployment option should you use?
Explanation
Option B (Vertex AI Prediction with autoscaling enabled and machine type optimized for latency) is correct because online prediction endpoints support real-time inference with sub-second latency, and autoscaling handles traffic spikes automatically while meeting the 100ms requirement. Option C is incorrect because batch prediction runs asynchronously and cannot meet real-time latency requirements, even with minute-level scheduling. Option D is incorrect because Vertex AI Pipelines is designed for orchestrating ML workflows, not serving real-time predictions. Option A is incorrect because batch prediction is designed for processing large volumes asynchronously, not for real-time responses with strict latency requirements.
Question 2 of 10
Your team trained a PyTorch model for image classification and saved it in TorchScript format. You need to deploy it to Vertex AI for online predictions. What is the most appropriate approach?
Explanation
Option C (Create a custom container with PyTorch runtime and deploy as a custom prediction endpoint) is correct because Vertex AI supports custom containers that allow you to package PyTorch models with their required dependencies and serve predictions. Option A is incorrect because converting between frameworks is unnecessary, complex, and may result in accuracy loss or compatibility issues. Option D is incorrect because TensorFlow containers cannot run PyTorch models, as they require different runtime environments. Option B is incorrect because BigQuery ML has limited framework support and is primarily designed for SQL-based model training and batch predictions within BigQuery.
Question 3 of 10
You have a recommendation model that needs to generate personalized product suggestions for 10 million users daily. The predictions can be generated overnight and stored for next-day use. Which deployment approach minimizes cost?
Explanation
Option D (Use Vertex AI Batch Prediction to process all users in a single nightly job) is correct because batch prediction is optimized for large-scale, non-real-time inference workloads, and you only pay for compute resources during job execution. Option A is incorrect because maintaining online prediction endpoints incurs continuous costs for running replicas, even when idle, which is wasteful for scheduled workloads. Option C is incorrect because Cloud Run with hourly triggers still requires more frequent deployments than necessary and doesn't optimize for batch processing at scale. Option B is incorrect because streaming pipelines run continuously and incur ongoing costs, which is unnecessary when predictions can be pre-computed overnight.
Question 4 of 10
You deployed two versions of a sentiment analysis model to production and want to route 90% of traffic to the stable version and 10% to a new experimental version. Which Vertex AI feature should you use?
Explanation
Option A (Use traffic splitting on a single endpoint with multiple deployed model versions) is correct because Vertex AI Prediction endpoints natively support deploying multiple model versions and configuring traffic split percentages between them for A/B testing. Option B is incorrect because using external load balancers adds unnecessary complexity and cost when Vertex AI provides built-in traffic splitting capabilities. Option C is incorrect because implementing traffic routing in application code requires additional development effort, error handling, and doesn't leverage platform features designed for this purpose. Option D is incorrect because Vertex AI Pipelines is for workflow orchestration, not for traffic management between model versions.
Question 5 of 10
Your XGBoost model needs to serve predictions for a web application with variable traffic ranging from 10 to 1,000 requests per minute. You want to minimize operational overhead while controlling costs. What deployment strategy should you use?
Explanation
Option A (Package the model in a container and deploy to Cloud Run with autoscaling) is correct because Cloud Run provides automatic scaling including scale-to-zero, minimal operational overhead, and cost-effective pay-per-use pricing ideal for variable traffic patterns. Option D is incorrect because Vertex AI Prediction with minimum 0 nodes is not supported; endpoints require at least one node, resulting in continuous costs even during idle periods. Option B is incorrect because Compute Engine requires significant operational overhead for managing instances, configuring autoscaling, and implementing health checks manually. Option C is incorrect because Cloud Functions has execution time limits and cold start latency that may impact performance for model inference workloads.
Question 6 of 10
You need to perform batch inference on 500GB of data stored in BigQuery using a TensorFlow model. The results must be stored back in BigQuery for downstream analytics. Which approach is most efficient?
Explanation
Option B (Use BigQuery ML to import and deploy the TensorFlow model for predictions) is correct because BigQuery ML supports importing TensorFlow models and running predictions directly on BigQuery tables without data movement, optimizing both performance and simplicity. Option C is incorrect because exporting data to Cloud Storage and importing results back involves unnecessary data movement, increased latency, and additional storage costs. Option A is incorrect because streaming through Dataflow to online prediction endpoints is designed for real-time inference, not efficient batch processing of large datasets already in BigQuery. Option D is incorrect because exporting to CSV and using Cloud Functions introduces significant overhead, data movement costs, and Cloud Functions has limitations for processing large datasets.
Question 7 of 10
You have a model registry containing 15 versions of a text classification model. Version 12 is in production, version 13 failed validation, and version 15 is ready for deployment. How should you organize these versions in Vertex AI Model Registry?
Explanation
Option C (Use a single model with version aliases pointing to production and candidate versions) is correct because Vertex AI Model Registry supports versioning within a single model resource and allows aliases like 'production' and 'staging' to point to specific versions for easy management. Option B is incorrect because creating separate model resources for each version defeats the purpose of version management and makes tracking lineage and promoting versions more difficult. Option D is incorrect because using external metadata storage bypasses Vertex AI's built-in model registry features designed specifically for version control and lifecycle management. Option A is incorrect because managing version-to-endpoint mappings externally adds operational complexity and doesn't leverage the model registry's version management capabilities.
Question 8 of 10
You need to run predictions on streaming clickstream data from Pub/Sub with processing latency under 5 seconds. The model performs feature engineering before inference. Which architecture should you implement?
Explanation
Option D (Use Dataflow to process streams, perform feature engineering, and call Vertex AI endpoints) is correct because Dataflow is designed for streaming data processing with low latency, can perform complex feature transformations, and integrates well with Vertex AI for inference. Option C is incorrect because Vertex AI Batch Prediction is asynchronous and not designed for streaming workloads or meeting near-real-time latency requirements. Option B is incorrect because Cloud Functions has limitations on execution time, concurrent executions, and is not optimized for sustained streaming workloads requiring complex feature engineering. Option A is incorrect because Vertex AI Pipelines is designed for orchestrating training and batch workflows, not for low-latency streaming inference.
Question 9 of 10
Your model requires GPU acceleration for inference to meet latency requirements, but traffic is sporadic with long idle periods. You need to optimize costs while maintaining performance during active periods. What should you do?
Explanation
Option B (Deploy to GKE with GPU node pools and cluster autoscaling enabled) is correct because GKE supports GPU workloads and can scale GPU node pools down to zero during idle periods, optimizing costs while providing GPU acceleration when needed. Option C is incorrect because Vertex AI Prediction endpoints with minimum 1 replica means GPU instances run continuously, incurring high costs even during idle periods when no predictions are being served. Option D is incorrect because Cloud Run does not currently support GPU-accelerated containers, making it unsuitable for workloads requiring GPU inference. Option A is incorrect because using CPU instances with increased replicas may not meet latency requirements that specifically need GPU acceleration for model inference.
Question 10 of 10
You need to perform A/B testing of three model versions serving production traffic, with the ability to quickly roll back to any version if issues arise. Which deployment strategy provides the most control and flexibility?
Explanation
Option A (Deploy all versions to a single endpoint with configurable traffic percentages per version) is correct because Vertex AI supports multiple deployed models on one endpoint with adjustable traffic splits, enabling quick traffic reallocation for rollbacks without code changes. Option D is incorrect because managing three separate endpoints and implementing application-layer routing adds complexity, requires code deployments to change traffic distribution, and increases operational overhead. Option B is incorrect because Vertex AI Pipelines is not designed for serving predictions or managing traffic distribution; it orchestrates ML workflows, not runtime inference routing. Option C is incorrect because sequential deployment with version replacement prevents A/B testing since only one version serves traffic at a time, and rollback requires redeployment rather than traffic shifting.