← Questions

Top-k clicked items over a rolling window

0
AmazonCodingLast asked Jul 2025

Click events arrive with timestamps. Keep the k most clicked items over the last fixed window of time, evicting old clicks as time moves on. Follow-ups asked about optimizing it and supporting concurrent writers.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding