← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a system that can return the top N most-played tracks both globally and on a per-country basis. You will receive a continuous stream of play events; each event contains a track ID, a country code, and a timestamp. The system must support two types of queries:
The same track may appear in many countries. Queries will be executed far more often than new events arrive, so you should pre-compute and cache the ranked lists rather than scan the entire data set on every query.