⚡ Free Classes and Scholarships Available for Underprivileged Students -

Building models

Scaling Prototypes into ML 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 build a credit risk assessment model for a financial institution that must comply with regulations requiring clear explanations for all loan denials. The model should predict default probability with high accuracy. Which modeling approach best balances interpretability requirements with predictive performance?
Explanation
Option A (logistic regression with L2 regularization and feature engineering) is correct because it provides inherent interpretability through clear coefficient weights that directly show each feature's impact on predictions, meeting regulatory requirements for explainability while maintaining strong performance on tabular financial data. The model is transparent by design rather than requiring post-hoc explanation methods. Option D is incorrect because while SHAP provides explanations, deep neural networks are inherently complex black boxes, and post-hoc explanations may not satisfy strict regulatory requirements for transparency. The complexity adds unnecessary risk in regulated environments. Option B is incorrect because while gradient boosted trees offer high accuracy and feature importance, they lack the direct coefficient interpretability needed for regulatory compliance. Feature importance shows aggregate contribution but doesn't clearly explain individual predictions like linear models. Option C is incorrect because AutoML Tables abstracts away model details and may select complex ensemble methods. While it provides attribution reports, you have less control over the model's inherent interpretability, which may not meet strict regulatory standards.
Question 2 of 10
Your team is building a recommendation system for an e-commerce platform on Google Cloud. You need to train embeddings for 10 million products and 50 million users, then serve real-time recommendations. Which framework and deployment strategy provides the most efficient training and serving workflow?
Explanation
Option B (TensorFlow with TPU Pods and Vertex AI Prediction) is correct because TensorFlow has native TPU support optimized for large-scale embedding training, TPU Pods provide the distributed compute needed for millions of embeddings, and Vertex AI Prediction offers managed, auto-scaling infrastructure specifically designed for TensorFlow model serving with low latency. Option C is incorrect because while PyTorch supports GPU training, it lacks the mature TPU integration that TensorFlow offers. Cloud Run is designed for stateless HTTP services and isn't optimized for ML model serving at the scale and latency requirements of real-time recommendations. Option A is incorrect because Spark MLlib is not optimized for deep learning embeddings and lacks the neural network capabilities needed for modern recommendation systems. Additionally, Dataflow is for batch processing, which doesn't meet the real-time serving requirement stated in the question. Option D is incorrect because scikit-learn doesn't have efficient implementations for training large-scale neural embeddings used in modern recommendation systems. App Engine, while capable of serving predictions, isn't optimized for ML workloads compared to specialized ML serving infrastructure.
Question 3 of 10
You are prototyping a computer vision model for defect detection in manufacturing. The prototype uses a pre-trained ResNet50 model fine-tuned on 5,000 labeled images and achieves 92% accuracy. To scale to production with 500,000 images and deploy across multiple factories, what changes should you prioritize?
Explanation
Option D (switch to EfficientNet and use distributed training) is correct because EfficientNet provides better accuracy and efficiency than ResNet50 at scale through compound scaling, and Vertex AI's distributed training handles the 100x increase in data efficiently. This approach maintains the transfer learning benefits while optimizing for production scale and multi-site deployment. Option C is incorrect because adding layers to ResNet50 increases complexity without the systematic scaling benefits of modern architectures. Simply adding TPUs addresses compute but doesn't optimize the model architecture itself, and may lead to overfitting without the principled scaling approach. Option A is incorrect because while Vision API AutoML simplifies model building, it provides less control over architecture and optimization needed for specific manufacturing defects. Edge deployment is mentioned without justification, and AutoML may not achieve the performance gains needed from the larger dataset. Option B is incorrect because building a custom CNN from scratch discards the transfer learning benefits and requires significantly more data and expertise. For defect detection, leveraging pre-trained models with proven architectures is more efficient than custom architectures unless you have specialized requirements not met by existing models.
Question 4 of 10
Your medical diagnosis model must provide explanations that clinicians can understand and trust. The model processes patient lab results, vital signs, and medical history to predict disease risk. Regulatory requirements mandate that predictions be auditable and clinically interpretable. Which approach best addresses these requirements?
Explanation
Option C (generalized additive model with visualized univariate feature functions) is correct because GAMs provide inherent interpretability by modeling each feature's contribution independently with visualizable shape functions. Clinicians can see exactly how each lab value or vital sign affects the prediction, and the additive structure makes the model auditable and clinically meaningful while maintaining strong predictive performance. Option A is incorrect because while random forests provide feature importance, they don't show how features affect predictions in a clinically interpretable way. Permutation importance indicates which features matter but doesn't explain the relationship between feature values and outcomes in the transparent manner required. Option B is incorrect because rule-based expert systems, while transparent, are brittle and difficult to maintain as medical knowledge evolves. They lack the ability to learn from data and typically achieve lower accuracy than statistical models, making them suboptimal when both interpretability and performance are required. Option D is incorrect because LIME provides local approximations rather than inherent interpretability, and these post-hoc explanations may not be sufficiently reliable for clinical decisions. The underlying gradient boosted model remains a black box, and LIME explanations can be unstable, which undermines trust in regulated medical applications.
Question 5 of 10
You need to train a natural language processing model for sentiment analysis on customer reviews. Your prototype uses a pre-trained BERT model fine-tuned on 10,000 reviews. To scale to 50 million reviews and reduce training time from 48 hours to under 6 hours, what should you implement?
Explanation
Option A (DistilBERT with data parallelism across TPU pods) is correct because DistilBERT is 60% faster than BERT while retaining 97% of its performance, and data parallelism across TPU pods efficiently distributes the large dataset. This combination directly addresses both the scale requirement (50M reviews) and the time constraint (reducing from 48 to under 6 hours). Option B is incorrect because while multiple GPUs help, gradient accumulation is used to simulate larger batch sizes when memory is constrained, not primarily to reduce training time. This approach doesn't provide the 8x speedup needed, and GPUs are less efficient than TPUs for transformer models at this scale. Option D is incorrect because federated learning is designed for privacy-preserving training on decentralized data, not for reducing training time on centralized datasets. It typically increases training time due to coordination overhead and is unnecessary when you have centralized access to customer reviews. Option C is incorrect because model parallelism is used when models are too large to fit on a single device, which isn't the issue with BERT. The problem is data scale and training time, which data parallelism addresses more effectively. Model parallelism adds complexity and communication overhead without solving the primary bottleneck.
Question 6 of 10
Your prototype fraud detection model uses XGBoost with 50 features and achieves 95% precision but only 60% recall. Production requirements demand at least 85% recall to catch more fraud while maintaining explainability for fraud investigators. How should you modify your approach for production?
Explanation
Option D (tune XGBoost for recall with TreeSHAP) is correct because XGBoost hyperparameters like scale_pos_weight and max_depth can be adjusted to increase recall while maintaining the strong performance on tabular data. TreeSHAP provides exact, efficient explanations for tree-based models, satisfying the explainability requirement without changing to a less suitable architecture. Option B is incorrect because switching to neural networks for tabular fraud detection data typically doesn't improve performance over gradient boosting methods. Neural networks require more data and tuning, and while SHAP works, the architecture change introduces unnecessary complexity without addressing the recall issue, which is primarily a hyperparameter and threshold problem. Option C is incorrect because logistic regression with polynomial features will likely underperform XGBoost on complex fraud patterns. While it's interpretable, the significant drop in model capacity makes achieving both high recall and maintaining adequate precision difficult. The question indicates current performance is good except for recall. Option A is incorrect because implementing a two-stage model adds significant complexity to the pipeline without justification. The current XGBoost model can likely achieve the recall target through proper tuning and threshold adjustment. Two-stage models are beneficial when different objectives require fundamentally different model types, which isn't the case here.
Question 7 of 10
You are building a time-series forecasting model to predict cloud resource usage for the next 24 hours using historical metrics collected every minute. Your prototype uses LSTM networks but training is slow and results are difficult to validate. Which framework and technique combination improves training efficiency while maintaining forecast accuracy?
Explanation
Option B (Vertex AI Forecasting with Temporal Fusion Transformers) is correct because TFT is specifically designed for multi-horizon time-series forecasting with attention mechanisms that improve on LSTM performance and interpretability. Vertex AI Forecasting provides managed infrastructure for efficient training at scale, and TFT's attention layers help validate which historical periods influence predictions. Option A is incorrect because TensorFlow Decision Forests is designed for tabular data classification and regression, not time-series forecasting with temporal dependencies. It doesn't handle the sequential nature of minute-by-minute resource usage or provide the forecasting capabilities needed for 24-hour predictions. Option C is incorrect because while Prophet is efficient and handles seasonality well, it's designed for daily or coarser granularity data with strong seasonal patterns. For minute-level data with 1,440 points per day and complex patterns in cloud resource usage, Prophet lacks the capacity to capture intricate temporal dependencies. Option D is incorrect because ARIMA models, while suitable for time-series, are univariate by default and struggle with the scale of minute-level data (34,560 points for 24 days of training data). They also lack the ability to incorporate multiple related metrics as features, limiting forecast accuracy for cloud resource patterns.
Question 8 of 10
Your team built a prototype object detection model using TensorFlow Object Detection API with a MobileNet backbone for mobile deployment. To improve accuracy for production while maintaining real-time performance on mobile devices, which architectural change should you prioritize?
Explanation
Option C (EfficientDet with compound scaling) is correct because EfficientDet is specifically designed to balance accuracy and efficiency through compound scaling of resolution, depth, and width. It outperforms other models at similar computational budgets and is well-suited for mobile deployment with TFLite, directly addressing both the accuracy improvement and real-time mobile performance requirements. Option B is incorrect because ResNet50 is significantly heavier than MobileNet and not designed for mobile deployment. While knowledge distillation can compress models, starting with a desktop-class model and compressing it is less efficient than using architectures purpose-built for mobile devices, and may not maintain real-time performance. Option A is incorrect because YOLOv5 is primarily a PyTorch model, and the question specifies TensorFlow Object Detection API was used. While conversion is possible, it introduces complexity and potential compatibility issues. Additionally, YOLOv5 doesn't necessarily outperform EfficientDet for mobile deployment when properly optimized. Option D is incorrect because Faster R-CNN is a two-stage detector that's too computationally expensive for real-time mobile deployment, even with optimization. TensorRT is NVIDIA-specific and primarily for server GPUs, not mobile devices. This approach contradicts the mobile deployment and real-time performance requirements.
Question 9 of 10
You need to build a tabular data model predicting customer churn using 200 features from BigQuery. Your prototype uses scikit-learn random forest locally with 100K samples. To scale to 500 million records and leverage distributed training, which framework and training approach should you choose?
Explanation
Option C (BigQuery ML with BOOSTED_TREE_CLASSIFIER) is correct because it trains directly on data in BigQuery without data movement, leveraging BigQuery's distributed infrastructure to handle 500M records efficiently. For tabular churn prediction, boosted trees provide excellent performance, and the in-database approach minimizes data engineering overhead while automatically scaling to your data size. Option A is incorrect because while XGBoost performs well and Dask enables distributed computing, this approach requires extracting 500M records from BigQuery, managing distributed data loading, and coordinating between multiple systems. This adds significant complexity and data movement costs compared to in-database training without clear performance benefits. Option D is incorrect because while LightGBM with Ray provides distributed training, it requires setting up and managing a GKE cluster, handling data extraction from BigQuery, and coordinating distributed training. This operational complexity is unnecessary when BigQuery ML can train on the data in place with similar or better performance. Option B is incorrect because Spark MLlib's Random Forest implementation is less optimized than gradient boosting methods for tabular data, and typically achieves lower accuracy. Additionally, Dataproc requires data export from BigQuery and cluster management, adding unnecessary complexity when BigQuery ML provides equivalent distributed capabilities with less overhead.
Question 10 of 10
Your prototype uses a pre-trained CLIP model for image-text matching to categorize product images. To deploy this model for production serving 10,000 requests per second with 99th percentile latency under 100ms, which optimization strategy should you implement?
Explanation
Option B (pre-compute embeddings with Vertex AI Matching Engine) is correct because for product categorization, you can compute image and category text embeddings offline once, then use Matching Engine for fast vector similarity search at serving time. This approach transforms the expensive model inference into a lightweight similarity search, easily achieving sub-100ms latency at 10K QPS with lower cost than real-time inference. Option C is incorrect because running CLIP inference in real-time for every request, even with GPUs and batching, is expensive and may struggle to consistently meet the 100ms latency requirement at 10K QPS. Batching improves throughput but can increase individual request latency, working against the latency requirement. Option A is incorrect because TensorFlow Serving on GKE with autoscaling helps with scalability but doesn't address the fundamental challenge that CLIP inference is computationally expensive. Real-time model inference for 10K QPS would require substantial GPU resources and may not reliably achieve the strict latency requirement. Option D is incorrect because while quantization reduces model size and improves inference speed, CLIP models are still too large and complex for CPU-only inference to meet 100ms latency at scale. Cloud Run's CPU instances and cold start characteristics make it unsuitable for high-throughput, latency-sensitive ML serving compared to pre-computed embeddings.