The author describes a first-round Robinhood coding interview about handling customer trades when an exchange accepts only whole shares. The exercise tracked fractional inventory by symbol, covered purchases and sales, and included orders expressed either in shares or in money. Exchange transactions had to leave each inventory balance nonnegative and below one share after an order. The supplied format represented amounts with two decimal places and required returning the final inventory in its original order.
A follow-up requested a chronological transaction record from the inventory’s perspective, distinguishing dealings with customers from dealings with the market. The author considered the task manageable through careful case handling, but says the interviewer emphasized making the implementation simpler and clearer. The account does not report an interview result.
Discussion
Loading comments…