注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Phone Screen: problem similar to leetcode 815.
Virtual onsite Interview 1 (DS):
Imagine each Pin on Pinterest has a “trending score” associated with it. You’re asked to build a feature which keeps track of all the Pins a user has seen in the last week and at any given time shows the top trending Pin that has been viewed by this user. (ie. Of all the Pins user123 has viewed in the last 24 hours, let them know which one is the most trending now).
Example
A Pin score tracker records scores of Pins that a user has seen and keeps track of the highest scored pin that was viewed in the lascoring_pin to get the top scoring pin in the data set. For simplicity let’s imagine it’s the most recent 10 pins. In the example data above, this should return pin_id "981292206280418758"
4) Can you discuss the runtime complexity of each of the above operations for this structure |