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

Liveramp Intern OA + 店面1面 + 店面2面 (已跪)

全局:

2016(10-12月) 码农类General 硕士 实习@ - 网上海投 - 技术电面  | | Fail | 应届毕业生
OA: 没什么好说的,大家的题都一样,地里有很多面经,就不写了。

店面1: 还是老题,shortest path in undirected graph。面试官叫 亚历山大 什么的,和他讨论了3种方法,BFS, DFS, bidirectional search。
BFS 是最标准的做法嘛,但是空间复杂度太大了。
然后就说用DFS,比如说先search完depth = 5, 再search depth = 6, 7, ....一直这样search下去
bidirectional search 大家找找以前别人发的帖子,好几个人都分享了一个一篇文章的链接,讲的特别好,一定要看,我就是面试上午看的

店面2:

面试官开始安排的是个A开头的印度人,后面reschedule为tzing了(好像是这么拼的)
问了些传统的behavioral questions过后就开始问技术问题了

1. 投篮问题,3中2算赢好,还是6中4算赢好?要是是8中5呢?
我就是按照地里面大家的回答,还有人这样回答也过了的


次数越多,果越接近数学期望,所以如果命中率是90%应该尽量多投,这样避免意外。如果命中率只有10%,那应该选择32,因次数越少,果越离散,只投3次因运气意外的可能性比大。

It depends on whether the person is good at shooting.
According to the law of large numbers (LLN), the  of the results obtained from a large number of trials should be close to the , and will tend to become closer as more trials are performed.
If your shooting probility is greater than 0.6 , I will choose ⅝.  if you are not gooding at playing basketball, I will choose ⅔, and you got that result  by chance. 鏉
然后他就问了这个threshold, 我蒙的是2/3 = 0.667, 5/8 = 0.625, 所以就0.7.....�-涓夊垎鍦�
然后仨小时后收到了onsite邀请. 太震惊了,估计是他家真的缺人了吧. 发面经攒攒人品. ”

但是他问我具体的概率呢?他一直在那里纠结,估计就是这里没有答好,跪了吧。后面我和同学讨论,他说这个概率问题明明可以算出来呀。。。。。。哎,不知道为什么之前地里没有人提到。。。。郁闷的是,我后面才想起其实面试之前和他讨论过,他告诉我可以用概率算出来,大概怎么算。然而我面试的时候就像得了失忆症,什么都没有想起。。。。

单独投一次中的概率为p,那么
3投2中算赢的概率: p1 = C(3, 2) * p^2 * (1 - p) + p^3
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
e.g. enforcing that the smallest element in S1 must always be smaller than the smallest element in S2. (This asymmetry enforcement has the nice side-effect of halving the execution time :))

follow up用的是mapreduce。

3. 在要把一群人分成两,告你一些pair,每个pair中第一个人和第二个人不和,然后你如何分使得同一中不存在不和的组员,当然,也有可能分

首先不在pair里的人随便分。然后你剩下的就只有pair里的人了,然后贪心就好了,从任意一个人开始,把他放在第一组,把和他不和的人放在第二组。把这些人记录下来。然后检查带有这些人的pair,如果pair的另一半在第一组,不用理他,如果pair的另一半在第二组,返回分组失败。如果pair的另一半现在还没有组。把他放到第一组,并记录下来。在check新记录的人,以此类推。如果没有人要check了,就找一个没有组的人随便放入一组。知道所有人都有组为止。.







本帖子中包含更多资源

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

x

评分

参与人数 5大米 +15 收起 理由
紫檀木444 + 3 感谢分享!
ICong + 3 感谢分享!
松松的鞋带儿 + 3 谢谢你的介绍!
monster_gump + 3 感谢分享!
adslwy446 + 3 感谢分享!

查看全部评分


上一篇:Facebook 11月2016 面经 - 已跪 - 真心无语
下一篇:A9电面
🔗
 楼主| jigsaw_Becky 2016-12-9 12:02:01 | 只看该作者
全局:
  1. import java.util.*;

  2. public class MinPath {
  3.         List<Integer> findMinPath(int source, int destination) {
  4.                 Queue<Integer> queue = new LinkedList<>();
  5.                 Map<Integer, Integer> parent = new HashMap<>();
  6.                
  7.                 queue.offer(source);
  8.                 parent.put(source, null);
  9.                
  10.                 boolean find = false;
  11.                
  12.                 while(!queue.isEmpty() && !find) {
  13.                         int size = queue.size();
  14.                         for (int i = 0; i < size; i++) {
  15.                                 int cur = queue.poll();
  16.                                 int next1 = cur * cur;
  17.                                 int next2 = cur - 1;
  18.                                 int[] nexts = new int[]{next1, next2};
  19.                                 for (int next : nexts) {
  20.                                         if (!parent.containsKey(next)) {
  21.                                                 queue.offer(next);
  22.                                                 parent.put(next, cur);
  23.                                                 if (next == destination) {
  24.                                                         find = true;
  25.                                                         break;
  26.                                                 }
  27.                                         }
  28.                                 }
  29.                                 if (find) {
  30.                                         break;
  31.                                 }
  32.                         }
  33.                 }
  34.                
  35.                 List<Integer> list = new LinkedList<>();
  36.                 for (Integer key : parent.keySet()) {
  37.                         System.out.print(key);
  38.                         System.out.print(" : ");
  39.                         System.out.print(parent.get(key));
  40.                         System.out.println();
  41.                 }
  42.                 buildPath(list, parent, source, destination);
  43.                 return list;
  44.         }
  45.        
  46.         static void buildPath(List<Integer> list, Map<Integer, Integer> parent, int source, int destination) {
  47.                 int cur = destination;
  48.                 while(cur != source) {
  49.                         list.add(0, cur);
  50.                         cur = parent.get(cur);
  51.                 }
  52.                 list.add(0, source);
  53.         }
  54.        
  55.         public static void main(String[] args) {
  56.                 MinPath ob = new MinPath();
  57.                 List<Integer> list = ob.findMinPath(2, 9);
  58.                 for(Integer x : list) {
  59.                         System.out.println(x);
  60.                 }
  61.         }
  62. }
复制代码
回复

使用道具 举报

无效楼层,该帖已经被删除
🔗
 楼主| jigsaw_Becky 2016-12-9 12:02:50 | 只看该作者
全局:
  1. import java.util.*;

  2. public class DivideGroup {
  3.         void divide(Set<Character> set, char[][] notMatch) {
  4.                 Set<Character> set1 = new HashSet<>();
  5.                 Set<Character> set2 = new HashSet<>();
  6.                 for (int i = 0; i < notMatch.length; i++) {
  7.                         if ((set1.contains(notMatch[i][0]) && set1.contains(notMatch[i][1])) ||
  8.                                         (set2.contains(notMatch[i][0]) && set2.contains(notMatch[i][1]))) {
  9.                                 System.out.println("Cannot devide");
  10.                                 return;
  11.                         }
  12.                         for (int j = 0; j < 2; j++) {
  13.                                 if (j == 0) {
  14.                                         if (set1.contains(notMatch[i][0])) {
  15.                                                 set1.add(notMatch[i][0]);
  16.                                         } else if (set2.contains(notMatch[i][0])) {
  17.                                                 set2.add(notMatch[i][0]);
  18.                                         } else if (set1.contains(notMatch[i][1]) && !set2.contains(notMatch[i][1])) {
  19.                                                 set2.add(notMatch[i][0]);
  20.                                         } else if (!set1.contains(notMatch[i][1]) && set2.contains(notMatch[i][1])) {
  21.                                                 set1.add(notMatch[i][0]);
  22.                                         } else if (!set1.contains(notMatch[i][1]) && !set2.contains(notMatch[i][1])) {
  23.                                                 if (set1.size() < set2.size()) {
  24.                                                         set1.add(notMatch[i][0]);
  25.                                                 } else {
  26.                                                         set2.add(notMatch[i][0]);
  27.                                                 }
  28.                                         }
  29.                                 }
  30.                                 if (j == 1) {
  31.                                         if (set1.contains(notMatch[i][1])) {
  32.                                                 set1.add(notMatch[i][1]);
  33.                                         } else if (set2.contains(notMatch[i][1])) {
  34.                                                 set2.add(notMatch[i][1]);
  35.                                         } else if (set1.contains(notMatch[i][0]) && !set2.contains(notMatch[i][0])) {
  36.                                                 set2.add(notMatch[i][1]);
  37.                                         } else if (!set1.contains(notMatch[i][0]) && set2.contains(notMatch[i][0])) {
  38.                                                 set1.add(notMatch[i][1]);
  39.                                         } else if (!set1.contains(notMatch[i][0]) && !set2.contains(notMatch[i][0])) {
  40.                                                 if (set1.size() < set2.size()) {
  41.                                                         set1.add(notMatch[i][1]);
  42.                                                 } else {
  43.                                                         set2.add(notMatch[i][1]);
  44.                                                 }
  45.                                         }
  46.                                 }
  47.                         }
  48.                        
  49.                 }
  50.                
  51.                 for (Character c : set) {
  52.                         if (!set1.contains(c) && !set2.contains(c)) {
  53.                                 if (set1.size() < set2.size()) {
  54.                                         set1.add(c);
  55.                                 } else {
  56.                                         set2.add(c);
  57.                                 }
  58.                         }
  59.                 }
  60.                
  61.                 System.out.print("set1: ");
  62.                 for (Character c : set1) {
  63.                         System.out.print(c);
  64.                 }
  65.                 System.out.println();
  66.                
  67.                 System.out.print("set2: ");
  68.                 for (Character c : set2) {
  69.                         System.out.print(c);
  70.                 }
  71.                 System.out.println();
  72.         }
  73.        
  74.         public static void main(String[] args) {
  75.                 DivideGroup ob = new DivideGroup();
  76.                 Set<Character> set = new HashSet<>(Arrays.asList('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'));
  77. //                char[][] notMatch = new char[][]{{'j', 'a'}, {'g', 'h'}, {'c', 'j'}, {'c', 'b'}, {'h', 'd'}};
  78.                 char[][] notMatch = new char[][]{{'j', 'a'}, {'g', 'h'}, {'c', 'j'}, {'c', 'b'}, {'k', 'd'}, {'a', 'c'}};
  79.                 ob.divide(set, notMatch);
  80.         }
  81. }
复制代码
回复

使用道具 举报

🔗
jsjtzyy 2016-12-9 12:13:41 | 只看该作者
全局:
我觉得楼主能面试到第二轮就已经很厉害了。我面第一轮就挂了。LiveRamp 招人很少,不妨尝试一下大公司,比如Amazon. 周围人拿到他家的实习,貌似挺容易的。
回复

使用道具 举报

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

使用道具 举报

无效楼层,该帖已经被删除
无效楼层,该帖已经被删除
🔗
cser017 2016-12-10 05:23:43 | 只看该作者
全局:
据说他家只面不招。。。LZ Move on 吧。
(也是知道他家不咋发offer 所以OA一直拖延了一个月后来直接放弃了)
回复

使用道具 举报

🔗
 楼主| jigsaw_Becky 2016-12-10 05:47:51 | 只看该作者
全局:
cser017 发表于 2016-12-10 05:23
据说他家只面不招。。。LZ Move on 吧。
(也是知道他家不咋发offer 所以OA一直拖延了一个月后来直接放弃 ...

嗯嗯~谢谢~对于面试经验不多的,可以用来练习一下面试。没时间就没必要做了
回复

使用道具 举报

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

本版积分规则

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