MEESHO SDE1 LLD Round || MACHINE CODING

Anonymous User
979

90 minutes were given, two interviewrs joined.
Test was on hacckerrank.
There exist a stock/Trading System.
1.) Users can place/modify/cancel Orders.
2.) A trade can only be made when selling price is greater than or equal to buying price. If a there are multiple ways then choose the order with older rank.
3.) Maintain a OrderBook which will keep track of unexecuted Orders.
4.) Maintain state for a trade.

-->Maintain Concurrency & thread safety, deal with Exceptions as well.
-->Input/Output are not given, you can create urself.

example he gave me to understand (i dont remember correctly but similar to this)
user1 buys abc order.
user2 sells abc order.

Bonus Feature (It's optional only If you get time solve)
1.) Elimainate all the orders after their expiry date.

(I prefer Java for LLD, but I did lost touch so I asked the interviewer for syntax help from google, he allowed).

I could not do it in 90 minutes. I think it requires a rigourous practive of 10-20 days.

Variation of this problem
https://leetcode.com/discuss/post/1634256/lld-stock-exchange-by-ajaykrp-fee2/

Comments (3)