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
94 practiced

Describe common spatial indexing structures used for proximity queries in ride-matching: quadtree, KD-tree, R-tree, and geohash-based grids. For each: explain their query and update complexity, memory characteristics, and suitability for highly dynamic datasets where drivers update position frequently. Which structure(s) would you pick for city-scale real-time matching and why?

MediumTechnical
92 practiced

Design a retention and compaction policy for time-series sensor data with different SLAs: raw data retained for 30 days with high-resolution, summarized data kept for 3 years. Explain how to implement rollups, partition pruning, and how to support queries that need both raw and rolled-up data.

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.

HardTechnical
95 practiced

Write pseudocode (or Python) to expand a geohash cell into neighbor cells sufficient to cover an approximate radius R meters, and then filter candidate drivers by exact distance (Haversine). Input: driver list with lat/lon and their geohash, rider lat/lon and radius R. Show sample input/output for a small city block.

EasyTechnical
85 practiced

Implement a function in Python that computes the Haversine distance in meters between two points (latitude, longitude). Your function should: validate inputs, handle edge cases (antimeridian), and return a float distance. Provide sample input/out in the prompt.

Example:
input: (lat1=37.7749, lon1=-122.4194, lat2=37.8044, lon2=-122.2712)
expected: distance in meters (approx).

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.