FastPrepDrone API Sliding-Window Rate Limiter
Problems/Drone API Sliding-Window Rate Limiter

Drone API Sliding-Window Rate Limiter

Skydio logoSkydio● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Skydio phone-screen report names drone API rate limiting and says it is a small change to a basic rate limiter. We chose a sliding window that counts only accepted requests, kept for each drone. Your function gets a finite list of calls and returns true or false for each. Our version is about 45% the same as the reported question.

Requests arrive in nondecreasing timestamp order. Request i comes from droneIds[i] at integer time timestamps[i].

Each drone may have at most maxRequests accepted requests in the inclusive interval [timestamps[i] - windowSeconds + 1, timestamps[i]]. A rejected request does not consume quota. Return one boolean per request indicating whether it is accepted.

Function

allowDroneRequests(droneIds: String[], timestamps: int[], windowSeconds: int, maxRequests: int) → boolean[]

Examples

Example 1

droneIds = ["d1","d1","d1","d1"]timestamps = [1,2,3,4]windowSeconds = 3maxRequests = 2return = [true,true,false,true]

The request at time 3 exceeds d1's quota; at time 4, the accepted request at time 1 has left the window.

Example 2

droneIds = ["d1","d2","d1"]timestamps = [5,5,5]windowSeconds = 10maxRequests = 1return = [true,true,false]

Each drone has independent quota state.

Constraints

  • The arrays have the same length from 0 through 100000.
  • Timestamps are nonnegative and nondecreasing.
  • 1 <= windowSeconds, maxRequests <= 100000.
  • Drone IDs are non-empty ASCII strings.

More Skydio interview questions

  • Cumulative Flight-Distance AlertsPHONE SCREEN · Seen Apr 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

  • Stateful Paginated Fetch NLyft · PHONE SCREENLyft interview questions
  • Sliding Window Rate LimiterMercury · PHONE SCREEN
  • Dynamic Longest-Waiting Unique Task QueriesAmazon · PHONE SCREEN
  • Machine Message RouterOpenAI · PHONE SCREENOpenAI interview questions
  • Transcript Window MetricsSesame · PHONE SCREEN
  • Select First or Last K Stream WordsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Sliding Window Rate LimiterZipRecruiter · OA · ONSITE INTERVIEWZipRecruiter interview questions
  • Capital Gains Tax from TradesArcesium · OAArcesium interview questions
  • Incident MonitorStripe · OAStripe interview questions
  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
All Skydio interview questionsSee Skydio hiring insights
Saved
class Solution {
    public boolean[] allowDroneRequests(String[] droneIds, int[] timestamps, int windowSeconds, int maxRequests) {
        // write your code here
    }
}
Checking account…