Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Find Overlapping Anomalous Coordinates
00:00
5 left

Find Overlapping Anomalous Coordinates

MediumSQL · PostgreSQL

Problem

Zoox engineers want to identify locations where anomalous path-planning adjustments affected multiple autonomous vehicles. Because GPS readings can differ slightly, treat coordinates rounded to four decimal places as the same location.

Write a PostgreSQL query to identify overlapping anomalous coordinates from the provided tables.

Requirements

  1. Include only path-planning events marked as anomalous with non-null latitude and longitude.
  2. Join events to known Zoox autonomous vehicles and group coordinates after rounding latitude and longitude to four decimal places.
  3. Return locations associated with at least two distinct vehicles, along with the number of distinct vehicles, anomalous adjustments, and a comma-separated list of vehicle IDs.
  4. Order results by rounded latitude and longitude.

Schema

autonomous_vehicles
ColumnTypeDescription
vehicle_idPKINTUnique identifier for an autonomous vehicle
vehicle_nameVARCHAR(80)Internal Zoox vehicle name
fleet_statusVARCHAR(30)Current operating status of the vehicle
path_planning_events
ColumnTypeDescription
event_idPKINTUnique path-planning event identifier
vehicle_idINTVehicle associated with the event
event_timeTIMESTAMPTime when the planning adjustment occurred
latitudeNUMERIC(9,6)Recorded latitude
longitudeNUMERIC(9,6)Recorded longitude
anomaly_flagBOOLEANWhether the event was classified as anomalous
adjustment_typeVARCHAR(40)Type of path-planning adjustment
adjustment_metersNUMERIC(6,2)Magnitude of the path adjustment in meters
Tablesautonomous_vehiclespath_planning_events
Interviewer

Your question is Find Overlapping Anomalous Coordinates. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.