Model Optimization, Debugging, and Performance Tuning Questions
Techniques for optimizing machine learning models in production, including hyperparameter tuning, architecture optimization (e.g., pruning, quantization, distillation), and hardware acceleration. Covers profiling and optimizing inference latency, throughput, memory usage, and energy consumption; debugging training instabilities and inference issues; diagnosing data-related problems; ensuring reproducibility and reliability in ML pipelines; and implementing serving optimizations (batching, caching, parallelization) within ML platforms and MLOps workflows.
EasyTechnical
60 practiced
Implement in Python a function analyze_mlp(layers: List[int]) that returns per-layer parameter counts and an estimated total number of multiply-accumulate operations (MACs) for a dense feedforward MLP described by layers (e.g., [784,256,128,10]). Assume each dense layer has a bias and count MACs as input_dim * output_dim (report total MACs). The implementation should be O(n) in number of layers and handle degenerate inputs.
HardSystem Design
53 practiced
Architect a scalable serving solution for a large language model (LLM) ~175B parameters requiring an average throughput of 10 tokens/sec per request and P95 tail latency constraints. Consider model sharding (tensor/model parallelism), KV-cache sharding for streaming generation, batching strategies, quantization, memory-tiering, multi-region failover, and cost/latency trade-offs. Describe monitoring and fallback mechanisms to smaller models in case of overload.
EasyTechnical
59 practiced
What is mixed-precision training? Explain its benefits for training speed and memory, common numerical issues such as overflow/underflow, and common mitigations (loss scaling, using BF16 vs FP16, ensuring deterministic ops). When would you choose BF16 over FP16 for a production training job on modern GPUs or TPUs?
MediumTechnical
59 practiced
Compare TensorRT optimization to ONNX Runtime optimization and XLA compilation. For inference acceleration across GPU, CPU, and edge devices, explain when you'd pick TensorRT, ONNX Runtime, or XLA, and what trade-offs regarding operator support, dynamic shapes, and maintenance each choice entails.
MediumTechnical
51 practiced
Explain causes of vanishing and exploding gradients in deep networks and list practical mitigations. Cover architecture-level solutions (residual connections, normalization), initialization schemes (Xavier/He), optimizer choices, gradient clipping, and when to change depth or width to stabilize training.
Unlock Full Question Bank
Get access to hundreds of Model Optimization, Debugging, and Performance Tuning interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.