Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Adaptive Telemetry Poll Scheduling

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Adaptive Telemetry Poll Scheduling. Start with the requirements on the right.

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.

Problem

Given a list of telemetry urgency scores urgency, an integer max_polls, and an integer cooldown, compute a polling schedule that minimizes battery usage while still polling the most important moments. Return the selected poll indices in increasing order. After polling at index i, the next cooldown indices cannot be polled.

Constraints

  • 1 <= len(urgency) <= 10^5
  • 0 <= urgency[i] <= 10^9
  • 1 <= max_polls <= len(urgency)
  • 0 <= cooldown < len(urgency)

Function Signature

def schedule_polls(urgency, max_polls, cooldown):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output