📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 81
跳转到指定楼层
上一主题 下一主题
收起左侧

Amazon OA2 面经

 
全局:

2016(7-9月) 码农类General 硕士 全职@amazon - 网上海投 - 在线笔试  | | Pass | 应届毕业生
OA2 由 Work simulation 和 3道 coding题组成

1. Work simulation
我的一个同学给了我一个cheat-sheet-oa2.pdf, 里面对work simulation介绍得很详细。我就只看了这个,觉得帮助很大。
虽然我不知道这个pdf的作者,但是为帮助大家,我把它上传到这个帖子的附件里面。不过我不知道这样子合不合适,如果不合适的话请跟我说。

2. 3道 coding
cheat-sheet-oa2.pdf 里面还有 coding部分的面经,可是我的 OA2 居!然!一!道!也!没!考! 我花了一天来看这十多道题目啊。
而且我发现这个PDF里面的解法里的一些code不够简洁,大家别太当做标准答案就好。
PDF里面的一些题目不算简单的,但是我遇到的3道题都太简单……

好了,说说这3道题:
第一道: 不记得了……
第二道:
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies


第三道:
(题目背景) 要给几十个城市供电。 在不同城市之间架设电网的花费不同。给你一个图,表示不同城市之间连接的花费。要你挑一些边,把所有城市连接起来并且总花费最小。
(实质) 最小生成树。 太直白了……
我用Kruskal + Union-Find敲的,原因是我忘记Prim算法了。。。我都有点惊讶,因为我有快四年没写过MST了,我居然还写出来了……
输出答案是你挑选的那些边。如果要过所有test case,记得输出的边需要按城市名字母顺序排序,现在大家可能不明白这是什么意思,大家可以先记着,到时看到题目就知道我在说啥了。
题目的描述并没有说要求你这样做,可是如果你不做,就过不了所有test case。真是坑 - _ -


问个问题: 我收到了video,video是招聘流程的最后一步么?也就是我没有机会去西雅图onsite了?

本帖子中包含更多资源

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

x

评分

参与人数 2大米 +10 收起 理由
elainewu5 + 5 很有用的信息!
mmbp123 + 5 给你点个赞!

查看全部评分


上一篇:dealer.com求面经
下一篇:亚麻OA开摄像头面试会因为长得丑据掉么?(T . T)
推荐
HuaZhe 2016-9-21 03:34:42 | 只看该作者
全局:
第三题大概这样可以吗???谢谢楼主了!
  1. public class solution {
  2.         public static void main (String[] args) {
  3.                 Connection[] citys = new Connection[10];
  4.                 citys[0] = new Connection("A","B",6);
  5.                 citys[1] = new Connection("A","D",1);
  6.                 citys[2] = new Connection("A","E",5);
  7.                 citys[3] = new Connection("B","C",3);
  8.                 citys[4] = new Connection("B","D",5);
  9.                 citys[5] = new Connection("C","D",6);
  10.                 citys[6] = new Connection("C","F",6);
  11.                 citys[7] = new Connection("D","F",4);
  12.                 citys[8] = new Connection("D","E",5);
  13.                 citys[9] = new Connection("E","F",2);
  14.                 ArrayList<Connection> list = new ArrayList<Connection> ();
  15.                 for (Connection temp : citys) {
  16.                         list.add(temp);
  17.                 }
  18.                
  19.                 for (Connection temp : findPath(list)){
  20.                         temp.printConnection();
  21.                 }
  22.                
  23.         }
  24.        
  25.         public static List<Connection> findPath (List<Connection> list) {
  26.                 ArrayList<Connection> result = new ArrayList<Connection> ();
  27.                 ArrayList<String> cityTree = new ArrayList<String> ();        //to Maintain the cities have been traversed.

  28.                 while (!list.isEmpty()) {
  29.                         //find the minimum cost to the city from cityTree among the result.
  30.                         Connection temp = findMin(list, cityTree);
  31.                         if (temp == null) {// we finished
  32.                                 break;
  33.                         }
  34.                         list.remove(temp);        //remove the current minimum cost from grand set
  35.                         cityTree.add(temp.city1);
  36.                         cityTree.add(temp.city2);
  37.                         result.add(temp);
  38.                 }
  39.                 //override compare make it alphabet order
  40.                 Comparator<Connection> cmp = new Comparator<Connection>(){
  41.                         public int compare(Connection c1, Connection c2) {
  42.                                 if (c1.city1.equals(c2.city1)) {
  43.                                         return c1.city2.compareTo(c2.city2);
  44.                                 }
  45.                                 return c1.city1.compareTo(c2.city1);
  46.                         }};
  47.                 result.sort(cmp);
  48.                
  49.                 return result;
  50.         }
  51.        
  52.         //find the minimum cost between the city we traversed and we did not traverse.
  53.         public static Connection findMin(List<Connection> list, ArrayList<String> cityTree) {
  54.                 Connection result = null;
  55.                 int minCost = Integer.MAX_VALUE;        //minimum cost
  56.                
  57.                 for (Connection con : list) {
  58.                         if (con.cost <= minCost) {
  59.                                 //if none of the city we traversed
  60.                                 //or the connection is connected to either city from cityTree.
  61.                                 if ((cityTree.contains(con.city1) && !cityTree.contains(con.city2)) ||
  62.                                                 cityTree.contains(con.city2) && !cityTree.contains(con.city1)) {
  63.                                         minCost = con.cost;
  64.                                         result = con;
  65.                                 }
  66.                                 if (cityTree.isEmpty()) {
  67.                                         minCost = con.cost;
  68.                                         result = con;
  69.                                 }
  70.                         }
  71.                 }
  72.                
  73.                 return result;
  74.         }
  75.        

  76. }
复制代码

  1. public class Connection {
  2.         String city1;
  3.         String city2;
  4.         int cost;
  5.         Connection (String city1, String city2, int cost) {
  6.                 this.city1 = city1;
  7.                 this.city2 = city2;
  8.                 this.cost = cost;
  9.         }
  10.        
  11.         public void printConnection () {
  12.                 System.out.println("{ " + this.city1 + " , " + this.city2 + "} " + this.cost);
  13.         }
  14. }
复制代码
回复

使用道具 举报

推荐
hitman047 2016-9-20 03:10:29 | 只看该作者
全局:
如果你没有完成30分钟的问题,你自动拒绝?
回复

使用道具 举报

推荐
xwjjjw 2016-10-3 11:14:56 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
tianrenz 2016-9-16 08:32:51 | 只看该作者
全局:
请问楼主oa2交了多久后拿到的video?
回复

使用道具 举报

🔗
 楼主| subzero2 2016-9-16 08:47:09 | 只看该作者
全局:
tianrenz 发表于 2016-9-16 08:32
请问楼主oa2交了多久后拿到的video?

一个星期
回复

使用道具 举报

🔗
tianrenz 2016-9-16 08:49:39 | 只看该作者
全局:

喔喔 cool 楼主加油 从去年来看拿到video的一般都是比较厉害的 祝offer
回复

使用道具 举报

本楼:
全局:
感谢分享!
回复

使用道具 举报

🔗
hitman047 2016-9-16 11:12:56 | 只看该作者
全局:
什么是第3问题的输入和输出?
回复

使用道具 举报

🔗
sadfcbasy 2016-9-16 11:14:09 | 只看该作者
全局:
求交流!私楼主消息了
回复

使用道具 举报

🔗
 楼主| subzero2 2016-9-16 11:14:31 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
gaoh 2016-9-16 12:02:59 | 只看该作者
本楼:
全局:
恭喜楼主!
回复

使用道具 举报

🔗
hitman047 2016-9-16 12:05:56 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

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

本版积分规则

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