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

google电面面经

全局:

2015(7-9月) 码农类General 博士 全职@google - 内推 - 技术电面  | | Pass | 在职跳槽

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

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

x
打电话,就在google doc出题写码。题目不难但是都很长。

1. List ways you can use an int[] to keep track of a bunch of integers so that you can quickly answer the question if a particular integer is in that bunch.

To conceptualize:
class X {
  int[] storage;
  // other members if you like, but main storage should be int[]
  
  X(Collection<Integer> numbers) {
    // Setup
  }

   public boolean contains(int v) {
     // this needs to be fast
   }
}

Provide complexities (big-O notation) of lookup, storage required, and storage setup time.


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


Example:
toAnalyze = A.class, B.class

calling findDependencies for A.class returns C.class, D.class
calling findDependencies for B.class returns C.class, E.class
calling findDependencies for C.class returns D.class, F.class
calling findDependencies for D.class returns E.class, F.class
calling findDependencies for F.class returns E.class
calling findDependencies for E.class returns {empty collection}

You should return: A.class,B.class,C.class,D.class,E.class,F.class (in any order)

上一篇:Amazon Oa2+Video 感恩节前要感恩
下一篇:Facebook 2面已跪 分享面经 求安慰啊
🔗
brian1118 2015-11-27 22:57:45 | 只看该作者
全局:
第二題不是DFS topology sort嗎?
回复

使用道具 举报

🔗
 楼主| kennethinsnow 2015-11-28 02:44:13 | 只看该作者
全局:
brian1118 发表于 2015-11-27 22:57
第二題不是DFS topology sort嗎?

DFS也可以,不过BFS算法更容易写

补充内容 (2015-11-28 04:13):
不过不能理解成topologic sort, 因为可能会有环。
回复

使用道具 举报

🔗
bobzhang2004 2015-12-1 11:46:30 | 只看该作者
全局:
kennethinsnow 发表于 2015-11-28 02:44
DFS也可以,不过BFS算法更容易写

补充内容 (2015-11-28 04:13):

这完全不是topological sort啊,是weak component吧?
回复

使用道具 举报

🔗
bobzhang2004 2015-12-1 11:47:17 | 只看该作者
全局:
楼主第一题最后就是自己用array实现一个hashmap?
回复

使用道具 举报

🔗
 楼主| kennethinsnow 2015-12-1 12:20:28 | 只看该作者
全局:
bobzhang2004 发表于 2015-12-1 11:47
楼主第一题最后就是自己用array实现一个hashmap?

最好的叫bitmap/bit vector
就是比较几种结构的存储,查询,空间复杂度
回复

使用道具 举报

🔗
bobzhang2004 2015-12-1 13:08:59 | 只看该作者
全局:
kennethinsnow 发表于 2015-12-1 12:20
最好的叫bitmap/bit vector
就是比较几种结构的存储,查询,空间复杂度

好的,对bit vector不熟。。。
回复

使用道具 举报

🔗
 楼主| kennethinsnow 2015-12-1 13:44:31 | 只看该作者
全局:
bobzhang2004 发表于 2015-12-1 13:08
好的,对bit vector不熟。。。

我当时也不知道,不过他就是看一下你的分析能力。他告诉你这个结构之后你能分析出复杂度就行了
回复

使用道具 举报

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

本版积分规则

>
1Point3Acres.com does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by users.
Copyright ©2009-2026 1Point3Acres.com All rights reserved. See Terms of Service.
关注我们