Geospatial and Time-Series Data Questions

Specialized data shapes and their stores: geospatial data types, spatial indexing, and location queries; and time-series data with high-ingest, retention, downsampling, and cardinality management. Covers storage-engine tuning such as compression, chunking, and indexing for range queries, and when purpose-built extensions or databases beat general-purpose stores for these workloads. A niche but recurring topic for location- and telemetry-heavy systems.

MediumTechnical
76 practiced

In Python (you may reference scikit-learn or scipy), implement or describe a function that returns the k nearest drivers to a rider location when n can be up to 100k drivers. Explain coordinate choices (use BallTree with haversine vs KDTree on projected coordinates), memory/time complexity, and how you would support dynamic updates when driver positions change.

HardSystem Design
76 practiced

A rideshare analytics warehouse needs to answer ad-hoc questions like 'find trips that started within 500 meters of these coordinates, during this one-hour window' at petabyte scale, with sub-minute response for analysts running exploratory queries. Design the schema and query strategy: how would you make a query like this fast without a full scan, and what would you trade off between query latency, storage overhead, and the extra work you do at write time to keep the index maintained?

MediumTechnical
100 practiced

Write an efficient PostGIS SQL query to find up to 5 nearest available listings within 5 km for each search coordinate in 'searches(lat, lon, search_time)'. Return listing_id, distance_km, price_usd, and compute the percentage of searches per city with at least 3 results. Assume 'listings(listing_id, lat, lon, is_active, price_usd)'. Use spatial indexes and lateral joins to keep the query performant.

EasyTechnical
105 practiced

Explain what downsampling and rollups are in TSDBs. Provide an example policy for converting 1-second resolution to 1-minute and 1-hour rollups and describe the query implications for dashboards and alerts.

HardSystem Design
123 practiced

Your table stores time-series events and needs to answer 'rolling metrics for this user over the last 7/30/90 days' at query time, without maintaining separate precomputed rollup tables. Design the schema, partitioning, clustering, and secondary indexes that would keep those queries fast as the table grows, and explain the query pattern you'd use to compute the rolling windows efficiently.

Unlock Full Question Bank

Get access to all 12 Geospatial and Time-Series Data interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.