Junior interview questionAsked at eBay · interview write-up
A fine-tuned BERT encoder is too slow and expensive in production. How would you optimize its latency and throughput, and how would you check quality held?
Model answer
Profile first. Cut padding with dynamic padding and length bucketing, batch requests, and serve through an optimized runtime with fused kernels in FP16 or INT8. If that's not enough, distill into a smaller model.
Check quality on a held-out set: accuracy and F1 overall and per slice, plus agreement with the original. Then shadow traffic.
Practise the rest
17 Latency & throughput questions, 492 in all, each with a model answer. Free.
More from eBay interview questions.
More Latency & throughput interview questions
- A chat reply streams in token by token. What two waits does the user feel, and which one does streaming make matter most?
- How do you get TTFT, inter-token latency, TPOT and total latency from one streamed reply?
- Why report p50 and p99 latency rather than the mean?
- You time a GPU request by reading the clock right after calling the model and get 0.3 ms per token. What went wrong, and what else can silently skew a timing?
- Server logs show a TTFT of 80 ms, yet users of your reasoning assistant say it takes seconds to start answering. Explain the gap.
- Your team wants to raise the batch size to cut serving cost. What happens to users, and which number would you use to decide?