Index tens of millions of road segments for fast matching

HardSystem design30 minSWEREMLEPro outline

The question

You have a dataset of tens of millions of road segments, each a polyline with attributes. Design an index so that, given a GPS point or a short track, you can quickly find the matching segments.

What the interviewer is looking for

  • Picks a spatial index such as a grid, geohash, quadtree or R-tree
  • Explains candidate search then exact distance
  • Handles segments spanning cells
  • Estimates memory and query cost
  • Mentions map matching for tracks

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported Baidu ERNIE question type: index and match a dataset of tens of millions of road segments.

Reported in: mj.mianlingai.com

Practice question written by BlogLLM based on publicly reported interview formats. Not an official Baidu ERNIE question.