Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Modeling Drone Lifecycle Data
00:00
5 left

Modeling Drone Lifecycle Data

HardSQL · PostgreSQL

Problem

How would you design a relational data model to track the lifecycle of an autonomous drone at Anduril from manufacturing, through testing, to active deployment?

Write a PostgreSQL query against the model below that identifies drones manufactured, fully tested with passing results, and currently active at their latest deployment. Ignore deployments with a NULL active_since value.

Output

  1. One row per qualifying drone with drone_id, serial_number, model, manufactured_at, latest_test_at, passed_tests, deployment_site, active_since, and days_to_active_deployment.
  2. Include only drones with manufacturing records, at least one test, all tests passing, and a valid active deployment.
  3. Order by active_since ascending, then drone_id ascending.

Schema

drones
ColumnTypeDescription
drone_idPKINTUnique drone identifier
serial_numberVARCHAR(30)Manufacturing serial number
modelVARCHAR(50)Drone model name
lifecycle_events
ColumnTypeDescription
event_idPKINTUnique lifecycle event identifier
drone_idINTReferenced drone
event_typeVARCHAR(30)Lifecycle event category
event_timestampTIMESTAMPTime the event occurred
test_runs
ColumnTypeDescription
test_run_idPKINTUnique test run identifier
drone_idINTTested drone
test_typeVARCHAR(40)Type of test performed
completed_atTIMESTAMPTest completion timestamp
resultVARCHAR(20)Test result
deployments
ColumnTypeDescription
deployment_idPKINTUnique deployment identifier
drone_idINTDeployed drone
deployment_statusVARCHAR(20)Deployment status
site_nameVARCHAR(60)Deployment site
active_sinceDATEDate the deployment became active
Tablesdroneslifecycle_eventstest_runsdeployments
Interviewer

Your question is Modeling Drone Lifecycle Data. Start with the requirements and the four 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.