[北美] a家線上面試題

看板Oversea_Job作者 (2-4)時間10年前 (2014/01/22 01:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
大家看看悲 Suppose you are an engineer on the Amazon Media team. Your team needs to launch a new recommendation feature called "stuff Your Friends are Buying". The recommendation logic is based on the following rules: 1. customer should only be recommended product that their friends bought but they haven't bought. 2. the recommendations priority is driven by how many friends have purchased the same item; if multiple friends purchased the same item, it should be higher in the recommendations than a product that only one friend owns. You are provided two library functions to help you 锠 getFriendsListForUser():returns a list of customer IDs (strings that uniquely identify an Amazon user) representing the friends of an Amazon user 锠 getPurchasesForUser():returns a list of product IDs (strings that uniquely identify an item in the Amazon catalog) for an Amazon user ordered by purchase time with newest purchase first in list and oldest purchase last in list For this evaluation, please: 1) Write a function that provides a ranked (high to low) list of recommendations (product IDs) for a provided user. You may use any IDE and framework that you are comfortable with. 2) Write code for a few key unit tests for your code. 3) Enumerate other unit test scenarios (code not required). 4) Provide the space and time complexity of your solution. RECOMMENDATION: Cut and paste this question into a word document to have for reference. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 71.13.182.7
文章代碼(AID): #1ItgeKiq (Oversea_Job)