Oracle OCI | IC3 | Pre-screening round
Anonymous User
1303

In mid september I gave pre screening for OCI.

Q. You are given a stream of Stocks (Stock_Name,Price,Time).
You have to implement a function which will give the top K most expensive stock in last T minutes. K is not fixed, each call can have a different K.

Also If the same stock comes again in stream, the old stock price is invalidated.

I had given a Heap based solution for it, so (price,time,stock_name) is pushed to heap. Had to do some checks to make sure its the latest time. I dont remember exactly what I had implemented.

I haven't received any further communication yet and the status on portal is still at "Interview and Selection".

Comments (3)