Verified interview challenge
Find the k-th value in a streaming time window
Move from a static order-statistic query to one that stays correct as old stream values expire.
Unlock with Full AccessThe challenge
Begin with a k-th-smallest selection problem, then extend the work to a stream of timestamped values. Queries concern only a recent window, and older values stop contributing as time advances.
The main challenge combines rank queries with changing membership. Use the supplied workload and bounded value range to choose a representation that remains correct as values arrive and expire.
What you'll practise
Window maintenance
Keep only the observations eligible for the current query time.
Order statistics
Answer rank queries correctly as frequencies change.
# Build on your implementation
# Run checks for the current part
# Full starter code includedRun your code to see results.