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

Airbnb电面Skype面

全局:

() @ - -   | | |

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

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

x
简介: 9月网申,隔天HR 就来找了,然后电面, 然后Skype面,不知道为什么现在onsite之前还要skype。

电面一轮: floor and ceiling那道题,有轻微变化。

Skype 两轮: 1. Boggle Game, 就是给一个char board(n*m), 给一个dictionary, 求出在不重复使用board里头的character的情况下最多可以在board里头找到多少dictionary里头的词。当时准备面经的时候就没好好准
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
能拿到offer的,能够过了电面已经很开心了!(来自**发自内心的喜悦,啊哈哈哈,然后当时也没想到还有Skype面,地里小伙伴有知道为什么要加面skype的吗?因为电面不够满意?)现在已经毕业两月了,有些紧张了,不过紧张也没啥卵用,反正刷刷刷,投投投,与大家共勉!!!!!!!!!

评分

参与人数 4大米 +8 收起 理由
Doudinger + 1 给你点个赞!yd*****6@gmail.com
EvenYoung + 1 给你点个赞!
nagato + 3 给你点个赞!
Saber + 3 很有用的信息!

查看全部评分


上一篇:Yahoo电面 10/12/2016
下一篇:Godaddy OA补充
推荐
twfx1123 2016-11-4 05:32:51 | 只看该作者
全局:
机票题目DP思想解,欢迎指正~~~
  1. public int minCost(String[] input, char source, char dest, int k){
  2.                 HashSet<Character> set = new HashSet<>();
  3.                 //get how many cities in the input
  4.                 for(String s : input){
  5.                         String[] arr = s.split(",");
  6.                         set.add(arr[0].charAt(0));
  7.                         set.add(arr[0].charAt(3));
  8.                 }
  9.                 int[][] dp = new int[set.size()][set.size()];
  10.                
  11.                 for(int[] arr : dp){
  12.                         Arrays.fill(arr, 999999);
  13.                 }
  14.                
  15.                 //build a graph
  16.                 for(String s : input){
  17.                         String[] arr = s.split(",");
  18.                         Character from = arr[0].charAt(0);
  19.                         Character to = arr[0].charAt(3);
  20.                         //cycle exists
  21.                         if(from == to){
  22.                                 dp[from-'A'][to-'A'] = 0;
  23.                         }
  24.                         dp[from-'A'][to-'A'] = Integer.parseInt(arr[1]);
  25.                 }
  26.                 List<Character> path = new ArrayList<>();
  27.                
  28.                 for(int k1=0; k1<dp.length; k1++){
  29.                         for(int i=0; i<dp.length; i++){
  30.                                 for(int j=0; j<dp.length; j++){
  31.                                         if(k1 <= k){
  32.                                                 if(dp[i][j] > dp[i][k1] + dp[k1][j]){
  33.                                                         dp[i][j] = dp[i][k1] + dp[k1][j];
  34.                                                 }
  35.                                         }
  36.                                 }
  37.                         }
  38.                 }
  39.                
  40.                
  41.                 for(int i=0; i<dp.length; i++){
  42.                         for(int j=0; j<dp.length; j++){
  43.                                 System.out.print(dp[i][j] + " ");
  44.                         }
  45.                         System.out.println();
  46.                 }
  47.                 return dp[source-'A'][dest-'A'];
  48.         }
  49.        
  50.         public static void main(String[] args) {
  51.                  String [] input = {
  52.                                         "A->B,8",
  53.                                         "B->C,4",
  54.                                         "A->D,1",
  55.                                         "D->E,2",
  56.                                         "E->B,3"
  57.                          };
  58.                  Floyd f = new Floyd();
  59.                  
  60.                  System.out.println(f.minCost(input, 'A', 'E', 2));
  61.         }
复制代码
回复

使用道具 举报

推荐
twfx1123 2016-11-2 07:56:28 | 只看该作者
全局:
个人感觉DP做不了那个飞机票的题目。面试官是不是期待dp做记录中间结果呢?不知道。。。掐表写了个graph DFS的,找到所有路径-》计算cost-》找到最小 写完了已经43分钟了。。。

  1. import java.util.*;

  2. public class flightMinCost {
  3.        
  4.         public int minCost(String[] input, char source, char dest, int k){
  5.                 HashMap<Character, HashMap<Character, Integer>> graph = new HashMap<>();
  6.                
  7.                 //build a graph
  8.                 for(String s : input){
  9.                         String [] arr = s.split(",");
  10.                         char start = arr[0].charAt(0);
  11.                         char end = arr[0].charAt(3);
  12.                         int cost = Integer.parseInt(arr[1]);
  13.                        
  14.                         if(!graph.containsKey(start)){
  15.                                 HashMap<Character, Integer> map = new HashMap<Character, Integer>();
  16.                                 map.put(end, cost);
  17.                                 graph.put(start, map);
  18.                         }
  19.                         else{
  20.                                
  21.                                 HashMap<Character, Integer> m = graph.get(start);
  22.                                 m.put(end, cost);
  23.                         }
  24.                 }
  25.                 List<Character> path = new ArrayList<>();
  26.                 List<List<Character>> allPath = new ArrayList<>();
  27.                 HashSet<Character> visited = new HashSet<>();
  28.                
  29.                 helper(source, dest, path, allPath, graph, visited);
  30.                
  31.                 for(char c : graph.keySet()){
  32.                         HashMap<Character, Integer> m = graph.get(c);
  33.                         for(Character nei : m.keySet()){
  34.                                 System.out.println("source is: " + c +" dest is:" + nei + " cost is: " + m.get(nei));
  35.                         }
  36.                 }
  37.                
  38.                 int minCost = Integer.MAX_VALUE;
  39.                
  40.                 for(List<Character> p : allPath){
  41.                         if(p.size() < k){
  42.                                 int cost = getCost(graph, p);
  43.                                 minCost = Math.min(cost, minCost);
  44.                         }
  45.                 }
  46.                
  47.                 return minCost;
  48.         }
  49.        
  50.         int getCost(HashMap<Character, HashMap<Character, Integer>> graph, List<Character> p){
  51.                 int sum = 0;
  52.                
  53.                 for(int i=0; i<p.size()-1; i++){
  54.                         char start = p.get(i);
  55.                         char dest = p.get(i+1);
  56.                         sum += graph.get(start).get(dest);
  57.                 }
  58.                 return sum;
  59.         }
  60.        
  61.         void helper(Character source, Character dest,List<Character> path,List<List<Character>> allPath,
  62.                         HashMap<Character, HashMap<Character, Integer>> graph, HashSet<Character> visited ){
  63.                
  64.                 visited.add(source);
  65.                 path.add(source);
  66.                
  67.                 if(source == dest){
  68.                         allPath.add(new ArrayList<>(path));
  69.                 }
  70.                 else{
  71.                         Set<Character> neis = graph.get(source).keySet();
  72.                          
  73.                         for(char n : neis){
  74.                                 if(!visited.contains(n)){
  75.                                         helper(n, dest, path, allPath, graph, visited);
  76.                                 }
  77.                         }
  78.                 }
  79.                
  80.                 path.remove(path.size()-1);
  81.                 visited.remove(source);
  82.         }
  83.        
  84.        
  85.        

  86.         public static void main(String[] args) {
  87.                  flightMinCost fmc = new flightMinCost();
  88.                  String [] input = {
  89.                                 "A->B,8",
  90.                                 "B->C,4",
  91.                                 "A->D,1",
  92.                                 "D->E,2",
  93.                                 "E->B,3"
  94.                  };
  95.                  
  96.                  System.out.println(fmc.minCost(input, 'A', 'C', 12));
  97.                  

  98.         }

  99. }
复制代码
回复

使用道具 举报

🔗
seekingJob320 2016-10-15 00:55:58 | 只看该作者
本楼:
全局:
谢谢楼主
回复

使用道具 举报

🔗
seekingJob320 2016-10-15 01:05:34 | 只看该作者
全局:
请问楼主第二题结果是a 到d, d到c, 可是要求是a到b, 能进一步解释一下吗
回复

使用道具 举报

🔗
william_gong 2016-10-15 01:09:56 | 只看该作者
全局:
dp[start][end][connection]
想了一个三维dp的,不知道能不能work。。

补充内容 (2016-10-15 01:19):
想错了。。忽略我
回复

使用道具 举报

🔗
 楼主| xiubiubong 2016-10-15 01:30:43 | 只看该作者
全局:
seekingJob320 发表于 2016-10-15 01:05
请问楼主第二题结果是a 到d, d到c, 可是要求是a到b, 能进一步解释一下吗

是打错了真是不好意思哈,第三个输入应该是[d,b,5], 结果也应该是a ->d, d->b, 7

评分

参与人数 1大米 +3 收起 理由
nagato + 3 欢迎分享你知道的情况,会给更多积分奖励!

查看全部评分

回复

使用道具 举报

🔗
seekingJob320 2016-10-15 01:51:51 | 只看该作者
全局:
xiubiubong 发表于 2016-10-15 01:30
是打错了真是不好意思哈,第三个输入应该是[d,b,5], 结果也应该是a ->d, d->b, 7

楼主您好 还有一个问题, 请问每张飞机票的价格,是不是还需要给出?谢谢
回复

使用道具 举报

🔗
 楼主| xiubiubong 2016-10-15 02:14:45 | 只看该作者
全局:
seekingJob320 发表于 2016-10-15 01:51
楼主您好 还有一个问题, 请问每张飞机票的价格,是不是还需要给出?谢谢

你是说结果里面吗,结果里要求给出的最后总的机票价格

评分

参与人数 1大米 +3 收起 理由
nagato + 3 欢迎分享你知道的情况,会给更多积分奖励!

查看全部评分

回复

使用道具 举报

🔗
cocaptainco 2016-10-15 06:41:15 | 只看该作者
全局:
楼主能分享一下第一轮的思路吗
回复

使用道具 举报

🔗
cocaptainco 2016-10-15 06:41:47 | 只看该作者
全局:
不好意思,我指的是skype第一轮找最多词的思路
回复

使用道具 举报

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

评分

参与人数 1大米 +3 收起 理由
nagato + 3 欢迎分享你知道的情况,会给更多积分奖励!

查看全部评分

回复

使用道具 举报

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

本版积分规则

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