a家線上面試題 - 面試
By Aaliyah
at 2014-01-22T01:10
at 2014-01-22T01:10
Table of Contents
大家看看悲
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.
--
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.
--
Tags:
面試
All Comments
Related Posts
美國工作 再拿美國EE碩士或僅台灣EE碩士
By Edward Lewis
at 2014-01-21T06:55
at 2014-01-21T06:55
英文履歷表Resume格式寫法
By Ivy
at 2014-01-17T15:43
at 2014-01-17T15:43
美國工作 再拿美國EE碩士或僅台灣EE碩士
By Delia
at 2014-01-16T09:35
at 2014-01-16T09:35
Toshiba面試問題
By Ula
at 2014-01-15T18:04
at 2014-01-15T18:04
死不講公司名稱的head hunter
By Cara
at 2014-01-15T08:24
at 2014-01-15T08:24