Find nearby candidates before calculating precise distance#
Scanning every driver and calculating every distance does not scale. Partition the search space, inspect the user's cell and relevant neighbors, then calculate precise geographic distance for the reduced candidate set.
Expand from the user's cell
This schematic is not a real map. It shows candidate reduction before exact distance filtering.
Moving entities update cell membership; Manhattan-like density can create hot cells; rural searches may expand farther. The spatial index narrows candidates - it does not itself prove that a candidate is within five kilometers.
Use these prompts to extend the design. The useful answer is a reasoned change, not a memorized sentence.
- What happens near cell boundaries?
- How often do moving drivers publish location?
- How does the system handle dense hot cells?
- How does radius expansion stop?
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Clusters, nodes, and shardsElastic Documentation