Skip to content
RED SAGSkills
hardMachine Learning Engineer interview question

A deep learning model meets accuracy targets but is too slow and expensive to serve. What options do you consider?

What the interviewer wants to hear

  • Profile end to end: model, features, network, preprocessing
  • Quantisation, pruning, distillation to a smaller model
  • Compile and optimise with runtimes such as ONNX Runtime or TensorRT
  • Batching, caching, and right hardware
  • Measure accuracy loss for each change

Model answer

First I profile the full request path, because often the slow part is feature lookups or preprocessing, not the model. For the model itself, I try quantisation to int8 or lower precision, which can give large speedups with small accuracy loss. Knowledge distillation trains a smaller student model to copy the large one, often keeping most of the quality. Pruning can help on supported hardware. I export to an optimised runtime like ONNX Runtime or TensorRT, which fuses operations. On the serving side, dynamic batching improves GPU use, caching handles repeated inputs, and choosing the right instance type or moving small models to CPU can cut cost. Sometimes a cheaper model handles most requests and only hard cases go to the large one. For every change I measure accuracy on the validation set and latency at p95 and p99, not just average.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Machine Learning Engineer questions