← 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 limit-order matching engine that supports two operations:
Orders are matched under strict price-time priority:
You must implement the two functions efficiently; typical interview implementations use two heaps (a max-heap for buys and a min-heap for sells) plus an auxiliary queue or map to preserve time priority when prices are equal.