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

11月Google和BLOOMBERG实习电面

全局:

2016(4-6月) 码农类General 博士 实习@google - 网上海投 - 技术电面  | | Pass | 应届毕业生

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

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

x
发帖求人品
11.9 GOOGLE:
第1轮:中国大哥,data stream of integer 0-999, write add() and median() function, makes them both run in O(1) tim
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies


16号当天收到b家onsite
18号收到GOOGLE HOST MATCH通知


另外跪求G家TEAM收留,跪求G家内推   我不想淹死在POOL里啊~

评分

参与人数 2大米 +55 收起 理由
kennethinsnow + 5 感谢分享!
whdawn + 50

查看全部评分


上一篇:bloomberg 10月面经 电面+onsite
下一篇:GoDaddy, 11月24日的OA
推荐
yingbich 2015-12-4 03:32:00 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
回复

使用道具 举报

全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies

评分

参与人数 1大米 +5 收起 理由
reality + 5 感谢分享!

查看全部评分

回复

使用道具 举报

全局:
写了下max island perimeter的代码,电面考这个代码量真多啊。楼主代码中得输出应该是12? 欢迎指教。
  1. public class IslandPerimeter {
  2.         public static void main(String[] args) {
  3.                 int[][] matrix =   {{0, 0, 1, 0},
  4.                                                         {0, 1, 0, 1},
  5.                                                         {0, 1, 1, 1},
  6.                                                         {1, 0, 1, 0},};
  7.                 int res = getMaxIslandPerimeter(matrix);
  8.                 System.out.println("res " + res);
  9.         }
  10.        
  11.         static class Direction {
  12.                 int left;
  13.                 int right;
  14.                 int up;
  15.                 int down;
  16.                 public Direction(int left, int right, int up, int down) {
  17.                         this.left = left;
  18.                         this.right = right;
  19.                         this.up = up;
  20.                         this.down = down;
  21.                 }
  22.         }
  23.        
  24.         public static int getMaxIslandPerimeter(int[][] matrix) {
  25.                 if (matrix == null || matrix.length == 0 || matrix[0].length == 0) {
  26.                         return 0;
  27.                 }
  28.                 int max = 0;
  29.                 int x = -1;
  30.                 int y = -1;
  31.                 for (int i = 0; i < matrix.length; i++) {
  32.                         for (int j = 0; j < matrix[0].length; j++) {
  33.                                 if (matrix[i][j] == 1) {
  34.                                         int size = helper(matrix, i, j);
  35.                                         if (size > max) {
  36.                                                 max = size;
  37.                                                 x = i;
  38.                                                 y = j;
  39.                                         }
  40.                                 }
  41.                         }
  42.                 }
  43.                 Direction direction = new Direction(y, y, x, x);
  44.                 if (x != -1 && y != -1) {
  45.                         getPerimeter(matrix, x, y, direction);
  46.                         return ((direction.down - direction.up + 1) + (direction.right - direction.left + 1)) * 2;
  47.                 } else {
  48.                         return 0;
  49.                 }
  50.         }
  51.        
  52.        
  53.         private static void getPerimeter(int[][] matrix, int x, int y, Direction direction) {
  54.                 if (x < 0 || x >= matrix.length || y < 0 || y >= matrix[0].length || matrix[x][y] != 2) {
  55.                         return;
  56.                 }
  57.                 matrix[x][y] = 1;
  58.                 direction.down = Math.max(direction.down, x);
  59.                 direction.up = Math.min(direction.up, x);
  60.                 direction.left = Math.min(direction.left, y);
  61.                 direction.right = Math.max(direction.right, y);
  62.                 getPerimeter(matrix, x + 1, y, direction);
  63.                 getPerimeter(matrix, x - 1, y, direction);
  64.                 getPerimeter(matrix, x, y + 1, direction);
  65.                 getPerimeter(matrix, x, y - 1, direction);
  66.         }
  67.        
  68.        
  69.         private static int helper(int[][] matrix, int i, int j) {
  70.                 if (i < 0 || i >= matrix.length || j < 0 || j >= matrix[0].length || matrix[i][j] != 1) {
  71.                         return 0;
  72.                 }
  73.                 matrix[i][j] = 2;
  74.                 int size = 1;
  75.                 int[] dx = {1, -1, 0, 0};
  76.                 int[] dy = {0, 0, 1, -1};
  77.                 for (int k = 0; k < dx.length; k++) {
  78.                         int x = i + dx[k];
  79.                         int y = j + dy[k];
  80.                         size += helper(matrix, x, y);
  81.                 }
  82.                
  83.                 return size;
  84.         }
  85. }
复制代码
回复

使用道具 举报

🔗
corn 2015-11-25 14:02:28 | 只看该作者
全局:
主动要求加面是什么情况?楼主主动向recruiter要的第三面?
回复

使用道具 举报

🔗
 楼主| wjf1990 2015-11-25 22:48:49 | 只看该作者
全局:
corn 发表于 2015-11-25 14:02
主动要求加面是什么情况?楼主主动向recruiter要的第三面?

是的,当时面的不好
回复

使用道具 举报

🔗
fireisborn 2015-11-25 23:13:40 | 只看该作者
全局:
原來可以這樣...早知道就要求加面了,受教...
回复

使用道具 举报

🔗
 楼主| wjf1990 2015-11-25 23:21:33 | 只看该作者
全局:
fireisborn 发表于 2015-11-25 23:13
原來可以這樣...早知道就要求加面了,受教...

也看HR的吧  我不知道其他人怎么样
回复

使用道具 举报

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

使用道具 举报

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

使用道具 举报

🔗
千骨娜娜 2015-11-27 01:37:21 | 只看该作者
全局:
wjf1990 发表于 2015-11-26 11:35
对的   面试官提醒了我好多都没做出来  求代码  哪里有原题吗

木有原题。。再请问楼主下,求island的周长是怎么算的呢?
回复

使用道具 举报

🔗
 楼主| wjf1990 2015-11-27 02:03:02 | 只看该作者
全局:
千骨娜娜 发表于 2015-11-27 01:37
木有原题。。再请问楼主下,求island的周长是怎么算的呢?

DFS啊  提到了对方就满意了
回复

使用道具 举报

🔗
bobzhang2004 2015-11-27 02:14:23 | 只看该作者
全局:
那个data steam的应该是bucket计数吧,请问楼主那个island周长的是怎么做的?
回复

使用道具 举报

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

本版积分规则

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