← 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 ingest a stream of stock price events (stock symbol, timestamp, price) and answer queries for the top K most expensive stocks in the last T minutes. Each query supplies its own K and T. For every query you must consider only the most recent price per stock that falls inside the window [currentTime - T, currentTime], then return the K symbols with the highest prices in descending order. If two stocks share the same price, break ties lexicographically by symbol. The system must handle events and queries in real time.