Design proximity-based request routing. Explain what information a request and a destination must provide, how proximity is measured, and how the routing decision should account for unavailable or unsuitable destinations.
### Constraints
Only the proximity-routing objective is supplied. The distance metric, destination eligibility, capacity, tie rule, and output format are unresolved. Do not infer a particular external routing problem. Any concrete selection algorithm must be tied to explicitly stated assumptions.
### Clarifying Questions
- Does proximity mean geographic distance, network latency, topology distance, or another score?
- Which destinations are eligible, and are health and capacity constraints part of selection?
- How are ties and the absence of an eligible destination handled?
- Are inputs a fixed snapshot or changing while requests are routed?
```hint Filter before optimizing the score
The nearest destination is useful only if it is allowed and able to serve the request under the declared policy.
```
### What a Strong Answer Covers
- A complete routing contract with proximity and eligibility distinguished.
- A conditional baseline algorithm and data structures appropriate to the metric.
- Deterministic ties, stale-state behavior, validation, and resource tradeoffs.
### Follow-up Questions
- When would a spatial index help, and when would it be irrelevant?
- How would you avoid routing every request to one nearby destination?
Overview: Clarify proximity metrics, destination eligibility, tie rules, and capacity before designing a request-routing algorithm.
Design proximity-based request routing. Explain what information a request and a destination must provide, how proximity is measured, and how the routing decision should account for unavailable or unsuitable destinations.
Constraints
Only the proximity-routing objective is supplied. The distance metric, destination eligibility, capacity, tie rule, and output format are unresolved. Do not infer a particular external routing problem. Any concrete selection algorithm must be tied to explicitly stated assumptions.
Clarifying Questions Guidance
Does proximity mean geographic distance, network latency, topology distance, or another score?
Which destinations are eligible, and are health and capacity constraints part of selection?
How are ties and the absence of an eligible destination handled?
Are inputs a fixed snapshot or changing while requests are routed?
What a Strong Answer Covers Guidance
A complete routing contract with proximity and eligibility distinguished.
A conditional baseline algorithm and data structures appropriate to the metric.
Deterministic ties, stale-state behavior, validation, and resource tradeoffs.
Follow-up Questions Guidance
When would a spatial index help, and when would it be irrelevant?
How would you avoid routing every request to one nearby destination?