This question evaluates a candidate's ability to design efficient sliding-window and streaming algorithms for time-series event data, encompassing deduplication, handling bounded out-of-order arrivals and clock skew, distinct-device counting, and meeting specified time and space complexity constraints.
Implement an algorithm that, for each user, determines whether there exists a set of at least k ACH credit events from distinct device_ids within any sliding window of t minutes where each amount_cents ≥ X. If so, output the earliest such window [start_ts, end_ts] and the k device_ids; otherwise output none. Input