InterviewStack.io LogoInterviewStack.io

Model Deployment and Inference Optimization Questions

Comprehensive coverage of designing, deploying, and operating systems that serve machine learning models in production while optimizing inference for latency, throughput, reliability, cost, and resource constraints. Topics include serving architectures such as batch processing, streaming, real time online serving, and edge inference, trade offs between precomputation and on demand computation, and deployment topologies for cloud, on premise servers, and edge devices. Discuss model versioning and rollout patterns including canary rollouts, blue green deployments, gradual rollouts, A B testing, and rollback strategies, and the infrastructure to support them such as containerization, orchestration, routing, traffic management, load balancing, and autoscaling. Cover inference optimization techniques including quantization, pruning, knowledge distillation, model compression, efficient architecture choices for computer vision and large language models, model format export and compatibility such as Open Neural Network Exchange and saved model formats, runtime optimizations, batching, request coalescing, caching, pipelining, and handling heterogeneous models and large model inference. Include hardware and infrastructure considerations such as graphics processing units, tensor processing units and other accelerators, memory and latency budgets, distributed and accelerated inference strategies, cost and energy trade offs, and edge device constraints. Operational and observability concerns include logging, metrics, latency and error tracking, model drift and data drift detection, profiling and benchmarking, performance regression alerts, debugging predictions in production, integration with continuous integration and continuous delivery pipelines, automated retraining and rollback policies, and practices to enable reliable, observable, and rapid iteration at senior and staff levels. For vision specific deployment, address image preprocessing pipelines, model input and output formats, and edge constraints such as energy and memory limits.

HardTechnical
21 practiced
Outline a methodology to debug nondeterministic production inference errors (e.g., occasional NaNs or silent mispredictions). Address logging, input sampling, reproducible replay, deterministic seeding, hardware-related causes (e.g., mixed-precision, f16/bfloat issues), and rollout strategies to isolate offending model versions or runtime changes.
EasyTechnical
24 practiced
Compare inference on GPU, CPU, and TPUs/other accelerators for a mid-sized transformer (~200M parameters). Discuss differences in latency (single request vs batched), throughput, cost per inference, warm-up behavior, and how typical batch-size trade-offs and concurrency patterns differ across these hardware types.
MediumTechnical
19 practiced
Describe the steps to convert a PyTorch model to ONNX and optimize it for inference using ONNX Runtime: exporting, shape/dtype handling, applying graph optimizations, enabling operator fusions, and applying quantization. Include practical debugging tips when post-conversion outputs diverge from the original model.
MediumSystem Design
17 practiced
Design a real-time inference system for a conversational assistant that must handle 5,000 concurrent sessions with <200 ms end-to-end response time. Describe architecture components (edge vs cloud, model placement), model serving choices (microservices vs monolith), batching/async strategies, autoscaling, and mitigations for latency tail and cold starts.
MediumTechnical
30 practiced
Describe how you would design a runbook and escalation policies for inference-service outages. Include monitoring thresholds, automated mitigation steps (e.g., circuit breakers, traffic rerouting), human escalation levels, runbook playbooks for common failure modes, and the post-incident review process to prevent recurrence.

Unlock Full Question Bank

Get access to hundreds of Model Deployment and Inference Optimization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.