This is a verified interview question from Uidai. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Sensor Pings, Cooldown Buckets" covers key patterns like DP.
"A monitoring room watches N sensors over T time slots. At each slot you can listen to at most M sensors in parallel (think of M radio buckets). If you listen to a sensor at slot t, that sensor must rest for the next D slots and cannot be listened to again until slot t - D + 1. For each slot and sensor i, you are given a non-negative score S[t][i] which is the value if you listen to sensor i at time t. For every fixed sensor i, its scores are non-increasing over time: S[1][i] ≥ S[2][i] ≥ ... ≥ S[T][i]. Choose which sensors to listen to in each slot (up to M per slot) to maximize the total score. Implement the function maxPingScore which takes the parameters below and returns the maximum total score as a 64-bit integer. Function Parameters - N: An int representing the number of sensors. - M: An int representing the number of simultaneous buckets per time slot. - D: An int representing the cooldown length after a sensor is used. - T: An int representing the number of time slots. - S: An array of arrays representing the scores, where S[t][i] is the score of sensor i at slot t (1-based; implementations can use 0-based). Return - A long representing the maximum total score achievable under the rules."
Join thousands of developers practicing for Uidai.