FastPrepCumulative Flight-Distance Alerts
Problems/Cumulative Flight-Distance Alerts

Cumulative Flight-Distance Alerts

Skydio logoSkydio● MediumFULLTIMEPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A first-hand Skydio phone screen asks for alerts after a drone travels one meter. Zero-based output indices and reset-after-alert behavior are explicit practice assumptions that make the sample repeatable; the source-backed running-distance core matches at about 90%.

A drone reports planar coordinates in travel order. Starting with the first report, accumulate the Euclidean length of every traveled segment. Whenever the accumulated distance is at least threshold, emit the current zero-based coordinate index and reset the accumulator to zero.

Return all emitted indices in increasing order. Distance left after the final report does not emit an alert.

Function

distanceAlerts(coordinates: double[][], threshold: double) → int[]

Examples

Example 1

coordinates = [[0.0,0.0],[0.5,0.0],[1.0,0.0],[1.1,0.3],[2.0,1.0]]threshold = 1.0return = [2,4]

The first two segments total one meter. After reset, the final two segments exceed one meter.

Example 2

coordinates = [[0.0,0.0],[0.3,0.4]]threshold = 1.0return = []

The path length is only 0.5 meters.

Constraints

  • 1 <= coordinates.length <= 100000.
  • Every coordinate has exactly two finite values.
  • 0 < threshold <= 1000000000.

More Skydio interview questions

  • Drone API Sliding-Window Rate LimiterPHONE SCREEN · Seen Jul 2024
  • Rolling Five-Second Flight-Distance AlertsPHONE SCREEN · Seen Apr 2024
  • Overlap-Safe Memory CopyPHONE SCREEN · Seen Aug 2022
  • Maximum Area of IslandPHONE SCREEN · Seen Oct 2021
  • Merge K Sorted ListsONSITE INTERVIEW · Seen Sep 2024

Similar questions at other companies

  • Logistic Regression with Gradient DescentYahoo · PHONE SCREENYahoo interview questions
  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Adaptive Calibration ErrorOpenAI · PHONE SCREENOpenAI interview questions
  • Random Pick with Weight Using Recorded DrawsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Reachable Transfer PositionsCitadel · PHONE SCREENCitadel interview questions
  • Find All Pythagorean TripletsDell Technologies · PHONE SCREENDell Technologies interview questions
  • Sort a Quadratic-Transformed ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
  • Filter Paginated Medical RecordsNVIDIA · PHONE SCREENNVIDIA interview questions
  • Minimum Operations to Make Every Array Element OneOtter.ai · PHONE SCREENOtter.ai interview questions
  • Evenly Schedule Vehicle InspectionsAmazon · PHONE SCREEN
All Skydio interview questionsSee Skydio hiring insights
Saved
class Solution {
    public int[] distanceAlerts(double[][] coordinates, double threshold) {
        // write your code here
    }
}
Checking account…