Whenever you're ready, walk me through how you'd approach this.
How do you optimize inference loops for latency-sensitive applications?
Discuss a practical approach for profiling and reducing end-to-end prediction latency in a traditional machine learning service. Cover preprocessing, model execution, batching, memory allocation, concurrency, and numerical equivalence. Explain how you would validate that an optimization improves p50 and p99 latency without changing model quality, and identify production risks such as queueing, warm-up effects, thread contention, and training-serving skew.