回复: 16
跳转到指定楼层
上一主题 下一主题
收起左侧

Amazon new OA1

全局:

2016(1-3月) 码农类General 硕士 全职@amazon - 网上海投 - 在线笔试  | | Other | 其他

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
Amazon 新OA 题
一个用户,有很多朋友,朋友还有朋友。把直接好友的直接好友都算是自己的好友。
给定一个user
以及两个函
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
题。还好可以用python,但不知道做的方法对不对

阿弥陀佛

上一篇:[亚麻]2/5电面面筋
下一篇:Amazon全套(video,已拿到offer)
推荐
laonong15 2016-2-18 23:55:19 | 只看该作者
全局:
Here is the possible solution :

1. Use a HashSet<String> courseSet and store all the courses made by the user
2. Keep one more HashMap<Course, Integer> recommendation
2. Get the list of Friends for the user
3. Iterate through the friends list and in that find the courses selected by the friend
4. If the course present in courseSet, omit else, put it in recommendation and increment it's count by 1.
5. After all the friends are evaluated. Sort the recommendation by it's value,  

it's O(n) Space  because n is the number of courses selected in total by all your friends.
  it would be O(k*p) where k is the number of friends and p is the number of courses a friend selects

The only thing  confuse me is   
do we  need get  all the friends' friends  and add to friends list,  It will depend on  giving  function " getFirendsListForuser"
回复

使用道具 举报

推荐
daykills 2016-2-24 09:39:07 | 只看该作者
全局:
你这应该是HackerRange的题吧,和他们说的OA不是一类。我也是刚面了这个,题目好类似。
回复

使用道具 举报

🔗
donnice 2016-2-8 23:33:01 | 只看该作者
全局:
果然换新题了……LZ是几号的due?
回复

使用道具 举报

🔗
chachacha 2016-2-9 04:26:17 | 只看该作者
全局:
请问楼主是什么岗位呢?我这个规定只能用c++或java
回复

使用道具 举报

🔗
dianalh1212 2016-2-9 05:16:41 | 只看该作者
全局:
请问楼主能再详细点吗?这是一道coding 题还是什么的?
回复

使用道具 举报

🔗
 楼主| edward_yang 2016-2-9 09:41:06 | 只看该作者
全局:
没说几号due,反正上周日做的。是coding 题。
回复

使用道具 举报

🔗
myangelasuka 2016-2-9 14:38:59 | 只看该作者
全局:
请问楼主是OA1还是OA2呢?

补充内容 (2016-2-9 14:45):
我是说 OA1 的part 1 还是 part2, 是否还有改错的part?
回复

使用道具 举报

全局:
请问楼主这道题是OA1 还是OA2呢?
回复

使用道具 举报

🔗
dukedk 2016-2-13 11:06:28 | 只看该作者
全局:
马上要做OA了,楼主能否详细说明下这个题,多谢
回复

使用道具 举报

🔗
t10 2016-2-13 12:34:57 | 只看该作者
全局:
楼主是hackerrank的链接吧?
回复

使用道具 举报

🔗
lunatic 2016-2-13 14:49:28 | 只看该作者
全局:
楼主去onsite了么?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表