FastPrepThrottled Updates with a Trailing Run
Problems/Throttled Updates with a Trailing Run

Throttled Updates with a Trailing Run

Rippling logoRippling● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: We turned the task into a timing exercise, and every rule is our choice. A call runs at once when the waiting time since the latest run is over, and that run starts a new wait. A call that comes too early is held, and a newer early call replaces it. The held call runs when the wait ends, and that run starts the next wait. A held run at time T comes before a call at T, same-time calls go in the given order, and a call still held at the end runs when its wait ends. The trailing run, the names, the limits and the examples are ours too.

The report places this task in a screening round for an SDE2 role. It names a throttle polyfill, and for throttle it gives no code, rules, signature or tests.

This version checks when runs happen. It cannot check the JavaScript wrapper that keeps a timer and the last arguments in a closure. The editorial covers that.

Our version is about 45% the same as the reported question.

A throttled function runs at most once in any wait time units, however often it is called. This version does not lose the newest value: when calls come too soon, it holds back the latest one and runs it as soon as the waiting time is over.

Call i happens at time times[i] with value values[i]. Keep track of openAt, the earliest time the next run may start. Before the first run, a run may start at any time.

  • A call at time t with t >= openAt runs right away, at time t, with its own value. Then openAt becomes t + wait.
  • A call at time t with t < openAt cannot run yet. It becomes the held call and replaces any call held before it.
  • When the time reaches openAt and a call is held, the held call runs at time openAt with its value. Then openAt grows by wait.

A held run at time T happens before any call at time T. Calls at the same time are handled in the order they are given. After the last call, a call that is still held runs at openAt.

Return every run as a pair [time, value], in the order they happen.

Function

throttledUpdates(times: int[], values: int[], wait: int) → int[][]

Examples

Example 1

times = [0,1,2,5,6,14]values = [1,2,3,4,5,6]wait = 4return = [[0,1],[4,3],[8,5],[14,6]]

The call at 0 runs at once, and the next run may start at 4. The calls at 1 and 2 are too early. The call at 2 replaces the call at 1 as the held call. At time 4 the held value 3 runs, and the next run may start at 8. The calls at 5 and 6 are held, and 6 replaces 5. At time 8 the held value 5 runs, and the next start is 12. The call at 14 is after 12, so it runs at once.

Example 2

times = [0,1,3]values = [7,8,9]wait = 3return = [[0,7],[3,8],[6,9]]

The call at 0 runs, and the next start is 3. The call at 1 is held. At time 3 the held value 8 runs first, so the next start moves to 6. That makes the call at 3 too early, so it is held and runs at 6.

Example 3

times = [5,5,5]values = [1,2,3]wait = 10return = [[5,1],[15,3]]

Three calls at the same time. The first one runs at 5. The other two are too early, and the last one, value 3, is the one held. It runs at 5 + 10 = 15.

Constraints

  • 1 <= times.length <= 1000 and values.length == times.length
  • 0 <= times[i] <= 10^6, and times is sorted in non-decreasing order
  • 0 <= values[i] <= 10^4
  • 1 <= wait <= 10^6

More Rippling Phone Screen questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • In-Memory Priority Task SchedulerPHONE SCREEN · Seen Oct 2026
  • Limit an Organization Tree's HeightPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Median Across N Sorted ArraysPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Customer Bootstrap APIDoorDash · PHONE SCREEN · ONSITE INTERVIEWDoorDash interview questions
  • Determine the Winner of Three-Card HandsOpenAI · PHONE SCREENOpenAI interview questions
  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • Propagating Fraud DetectorAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Asteroid CollisionSiemens · PHONE SCREEN
  • Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
  • Order and Batch Open-Close LifecycleHudson River Trading · PHONE SCREENHudson River Trading interview questions
  • Pins Violation Log QueriesPinterest · PHONE SCREENPinterest interview questions
  • Billing Log with Undo and RedoReddit · PHONE SCREENReddit interview questions
  • Resource Reconciler: Plan and Apply CreatesPerplexity AI · PHONE SCREENPerplexity AI interview questions

Interview reports that mention this question

  • Rippling Frontend, Mobile, Data: 18 Experiences (Part 12 of 12)

Rippling interview experiences

  • Rippling No-Level Older Reports: 31 Experiences (Part 6 of 6)
  • Rippling No-Level Onsite Loops: 24 Experiences (Part 5 of 6)
  • Rippling No-Level Screens and Loops: 18 Experiences (Part 4 of 6)
  • Rippling No-Level Coding Screens: 37 Experiences (Part 3 of 6)
  • Rippling No-Level Design, Screens: 30 Experiences (Part 2 of 6)
All Rippling interview questionsSee Rippling hiring insights
Saved
class Solution {
    public int[][] throttledUpdates(int[] times, int[] values, int wait) {
        // Write your code here.
    }
}
Checking account…