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.

HardTechnical
90 practiced

You need a schema and SQL query patterns for storing time-series metrics at high write throughput (millions of writes per minute) with efficient downsampling and retention. Consider OLTP vs OLAP characteristics, partitioning, compression, and whether to use a native TSDB or a SQL warehouse. Provide DDL examples and sample queries to compute per-minute max and one-hour aggregates.

HardTechnical
93 practiced

A ride-hailing analytics team needs one geospatial data model to power city-wide demand heatmaps, neighborhood-level rollups, and route-level analysis, all refreshed continuously as new trips complete. Design that model: how would you represent and index the space so it serves all three zoom levels efficiently, and what would you pre-compute versus compute on the fly?

EasyTechnical
78 practiced

Write PostgreSQL/TimescaleDB SQL to:

  1. Create a hypertable for host metrics with schema: metric_id serial PK, host text, metric_name text, metric_value double precision, ts timestamptz NOT NULL.
  2. Create a 5-minute continuous aggregate (rollup) for CPU metric per host.
  3. Show a query that returns the 5-minute avg CPU per host for the last 24 hours, sorted by highest spike.
  4. Add a retention policy to drop raw chunks older than 7 days.
    Provide correct TimescaleDB functions and explain any assumptions about chunk interval.
MediumTechnical
98 practiced

Compare range-based sharding vs hash-based sharding for a time-series logging database that stores billions of rows. Discuss which approach better supports time-range queries, compaction/TTL, rebalancing costs, and how TTL/archival interacts with each approach.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.