← 返回 bytedance 的题目列表Medium recommendation system coding problem
类型:online_judge
Design and implement a recommendation system function to recommend items to users that they might be interested in. Requirements:
Input: user behavior history and item features.
Output: a list of recommended items.
Ensure bug-free code within the time limit and handle various edge cases.
Sample Input
user_behaviors = [(1, 2), (1, 3), (2, 1)]
item_features = {1: [0.3, 0.6], 2: [0.1, 0.9], 3: [0.5, 0.4]}
Sample Output
recommended_items = [3, 2]
Data Size
Up to 1000 users and items each.
Each item feature has up to 10 dimensions.
Example
Input
{'user_behaviors': [(1, 2), (1, 3), (2, 1)], 'item_features': {1: [0.3, 0.6], 2: [0.1, 0.9], 3: [0.5, 0.4]}}