Location tracking: Drivers send GPS coordinates every seconds. Store in geospatial database (PostGIS, Redis with geospatial indexes, or dedicated service).
Matching algorithm: When rider requests, query drivers within radius. Filter by availability, rating, car type. Rank by distance and ETA. Send request to best match.
Geospatial indexing: Divide world into cells (geohashing or S2 cells). Query adjacent cells for nearby drivers. time lookup (where k is nearby drivers) using space for the index, instead of time scanning all drivers.