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

Amazon intern OA2

🔗
dsbmcd1 2017-11-9 16:51:52 | 只看该作者
全局:
也对于subtree问题 : 是binary tree还是binary search tree?  
  
非常感谢你〜
回复

使用道具 举报

🔗
go7going 2017-11-10 00:05:28 | 只看该作者
全局:
请问lz LRU miss是土刀上面的哪道题?
回复

使用道具 举报

🔗
 楼主| birkee 2017-11-10 01:33:04 | 只看该作者
全局:
go7going 发表于 2017-11-10 00:05
请问lz LRU miss是土刀上面的哪道题?

LRU Cache count miss
回复

使用道具 举报

🔗
 楼主| birkee 2017-11-10 01:35:15 | 只看该作者
全局:
dsbmcd1 发表于 2017-11-9 16:51
也对于subtree问题 : 是binary tree还是binary search tree?  
  
非常感谢你〜

树就是二叉树  LRU count miss参考LC146, 输入不是vector, 是Int常数指针

亚麻所有OA的输入都不是STL, 字符串题给的Input都是char*
回复

使用道具 举报

🔗
 楼主| birkee 2017-11-10 01:36:48 | 只看该作者
全局:
dsbmcd1 发表于 2017-11-9 16:51
也对于subtree问题 : 是binary tree还是binary search tree?  
  
非常感谢你〜

这是我用c++做的时候的经验..java我不清楚 可以直接看小土刀就行了
回复

使用道具 举报

🔗
go7going 2017-11-10 01:37:33 | 只看该作者
全局:

感谢lz! 字数字数
回复

使用道具 举报

🔗
dsbmcd1 2017-11-10 03:38:53 | 只看该作者
全局:
Hi, my chinese is not very good so I was hoping maybe you could answer in english haha. For the LRU problem, what does "LRU miss" mean? What is the "miss"?
   
As long as I know how to implement a LRU for LC146, will I be fine for this problem? Is the problem literally just implementing an LRU?   
  
And thanks for answering my question about the subtree. I thought it would be a binary search tree until I saw the leetcode problem and my program was returning false instead of true, and I realized that the tree was not a search tree so I couldn't use a normal in-order traversal like I was trying to lol. The OA2 question is exactly like LC572?
  
Thanks so much! You've been so helpful. I appreciate it a lot
回复

使用道具 举报

🔗
 楼主| birkee 2017-11-10 03:50:22 | 只看该作者
全局:
dsbmcd1 发表于 2017-11-10 03:38
Hi, my chinese is not very good so I was hoping maybe you could answer in english haha. For the LRU  ...

https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU

Least Used Cache(LRU). LRU cache keeps track of the items used and when the cache is filled, the least used item in the cache will be discarded.

In Amazon OA, you need to calculate the frequency of cache miss during a sequence of request. Your input is an int array and the size of the cache.

An efficient way to solve the question is to use linklist and unordered map, you can learn it with LC146.
回复

使用道具 举报

🔗
dsbmcd1 2017-11-10 04:31:28 | 只看该作者
全局:
birkee 发表于 2017-11-10 03:50
https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU

Least Used Cache(LRU). LRU cache k ...

Ahhh so cache "miss" just means that a item is not in the cache? Essentially you're returning the number of items you store in cache?   
  
Thank you so much. I can't express my gratitude for your help. I wish you the absolute best of luck with your application, if we both do well maybe we will work together :)  
  
Are you applying for an internship in the US?
回复

使用道具 举报

全局:
我的天,我认识的人amazon都全军覆没了,我都以为amazon就是不招人了,地里不是也这么说吗,楼主很强啊!
回复

使用道具 举报

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

本版积分规则

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