---
title: Payment authorisation gives your model a 50 ms p99 budget including feature fetches. How do you design for it?
url: https://gurkanozkan.ai/learn/questions/mle-meeting-a-tight-latency-budget-62/
markdown: https://gurkanozkan.ai/learn/questions/mle-meeting-a-tight-latency-budget-62.md
kind: question
role: ML engineering
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/mle-meeting-a-tight-latency-budget-62.json
robots: noindex
---

# Payment authorisation gives your model a 50 ms p99 budget including feature fetches. How do you design for it?

ML engineering · Technical · Medium

## Answer

*Model answer, written in a candidate's voice*

### In short

- Break the 50 ms p99 into network, feature fetch, and inference; measure each with traces, not averages.
- Precompute aggregates offline and colocate a low-latency feature cache near the model.
- Fetch features in parallel with hard deadlines/timeouts; do not let one slow source consume the budget.
- Use a smaller or compiled model (e.g., ONNX/TensorRT); keep batching small or off for tail latency.
- Define timeout fallbacks, monitor p99, and load-test at peak and tail conditions.

### In full

I would treat 50 ms p99 as a hard end-to-end budget and first split it into network/serialisation, feature fetch, and model inference using traces, because the exact split is workload-specific rather than a fixed number. I would precompute aggregates offline, colocate a feature cache close to the model, and fetch remaining features in parallel with tight deadlines so one slow source cannot consume the budget. For inference I would use a smaller or compiled model such as ONNX/TensorRT, and be cautious with batching: it can improve throughput but adds queueing delay, so for p99 I would prefer small or dynamic batches or no batching. On timeout I would fall back to cached/default features or a degraded path according to risk, never block the payment decision on a slow dependency. Finally I would track p99 rather than mean, and load-test at peak and tail conditions to verify the budget holds under realistic latency spikes.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Latency breakdown (network, feature lookups, model).
- Precompute aggregates; colocate a feature cache; parallel fetches with timeouts.
- A smaller or compiled model (ONNX/TensorRT), batching trade-offs.
- Fallback rules on timeout; measure p99 not mean; load-test.

## Common mistakes

- optimising the model while feature fetches dominate
- no timeout fallback.

## Topic guides

- [LLM serving: latency, throughput and operations](https://gurkanozkan.ai/learn/topics/serving.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
