Google early career L3 VO 面经

Viewed 77

两轮b2b的technical round,面试官人都很nice,非常注重交流.

第一轮:给一些stock transactions,里面有【date,ticket symbol,type,price,quantity】 比如这样【2020-1-2, goog,buy,5, 100】,【2020-1-5, goog,sell,7, 80】设计一个function,input是很多transaction,output需要是总的的profit/loss after all transactions。
follow up 是不用FIFO的数据结构,并且需要算出pooled and average cost,比如 【2020-1-2, goog,buy,5, 100】,【2020-1-2, goog,buy,6, 100】,需要merge变成【goog,buy,11, 200】然后cost是5.5 / shares 买了200 shares。

第二轮:给一个logfiles,logfile里面每一行是这样的形式“ presamble usertext”, 需要输出top N username list with the largest usertext count。询问怎么定义usertext count。follow up是input会有什么edge case需要处理吗,应该怎么改code。

0 Answers