Find a User's Airport at a Given Time from Flight Records
Find a User's Location at a Specific Time from Flight Records
Implement a function that, given a dataset of flight records and a specific user ID and timestamp, determines the user's location. Each flight record includes departure airport, departure time, arrival airport, arrival time, and user ID. The function should account for whether the user is at an airport or currently in flight.
Constraints & Assumptions:
- Flight intervals for a user do not overlap.
- All times can be normalized to a single timezone for comparison.
- The input data may contain records for numerous users.
- The return value must clearly distinguish between being at an airport, being in flight, and an unknown state.
AI interview prep
Core dilemma
Efficiently querying temporal data for a specific entity (user) across a potentially large dataset, balancing lookup speed with data structure complexity.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Find a User's Airport at a Given Time from Flight Records
Find a User's Location at a Specific Time from Flight Records
Implement a function that, given a dataset of flight records and a specific user ID and timestamp, determines the user's location. Each flight record includes departure airport, departure time, arrival airport, arrival time, and user ID. The function should account for whether the user is at an airport or currently in flight.
Constraints & Assumptions:
- Flight intervals for a user do not overlap.
- All times can be normalized to a single timezone for comparison.
- The input data may contain records for numerous users.
- The return value must clearly distinguish between being at an airport, being in flight, and an unknown state.