K-th largest value over the last N seconds of a stream

0
Remix

Start with finding the k-th largest element of an array. Then values arrive with timestamps and queries ask for the k-th largest among values from the last N seconds; design a structure that handles inserts, expiry and queries efficiently.

xAICodingHardLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.