Model Deployment and Inference Optimization Questions
Serving trained models efficiently in production. Covers deployment and containerization, real-time and batch serving, latency budgets, throughput and cost optimization, quantization and model compression, and online/real-time learning constraints. Emphasizes meeting production performance targets without sacrificing model quality.
Given a per-batch overhead t0 (scheduling, kernel launch, data copy) and per-example processing time te, derive expressions for per-request latency and throughput as functions of batch size B. Use these formulas to explain how to choose batch size under a strict latency SLO and how this modeling can inform autoscaling decisions.
What would you instrument to debug and optimize the LATENCY and PERFORMANCE of a production inference service (as opposed to monitoring for data/quality drift, which is a separate discipline)? Cover latency percentiles, throughput, queue depth, resource utilization, and per-request tracing, and explain how each signal helps you localize a specific class of performance problem.
Describe the difference between structured and unstructured pruning techniques for neural networks. For each approach, explain how pruning is applied, what sparsity patterns result, the implications for actual runtime speedups on CPU/GPU, and situations where you would prefer one over the other in production.
Describe how knowledge distillation could be adapted to distill across modalities (e.g., a vision teacher to a multimodal student) or across tasks (transfer learning). What loss terms and training signals would you include to preserve cross-modal knowledge during compression?
Explain the primary functional and resource differences between the training and inference phases of machine learning models. In your answer, cover compute patterns (forward vs backprop), memory usage (activations, gradients, optimizer state), latency vs throughput goals, data requirements, and typical optimization priorities for each phase. Give concrete examples (e.g., BERT fine-tuning vs BERT serving) and explain how these differences drive hardware and architecture choices.
Unlock Full Question Bank
Get access to all 24 Model Deployment and Inference Optimization interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.