近期论坛无法登录的解决方案


一亩三分地论坛

 找回密码
 获取更多干活,快来注册

一亩三分地官方iOS手机应用下载
查看: 2462|回复: 4
收起左侧

pure storage onsite

[复制链接] |试试Instant~ |关注本帖
lea82 发表于 2016-6-8 06:17:16 | 显示全部楼层 |阅读模式

2016(4-6月) 码农类 硕士 全职@pure storage - 内推 - Onsite |Fail在职跳槽

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

您需要 登录 才可以下载或查看,没有帐号?获取更多干活,快来注册

x
2 old questions:
implement a set, so that add, remove, lookup, clear operations would have O(1) time complexity, iteration would have O(size) complexity.
they don't like to jump to the right answer, kind of feel that they want you start using one array, and then another modification, and then combine both methods
Solution is 2 arrays, map[n], list[n] where for map, the index is the data x, the value is its index in list: map[2] = 0 if you first add a 2 to list.
list[n] stores the real value of the data -google 1point3acres
remove is from map[x] you find the index in list, you swap the list[--size] with list[map[x]]-google 1point3acres
for clear, you just set size to be 0
to lookup an item x, map[x]<size && list[map[x]] == true, return true.

2nd question is event dispatch system,
at time line, there are coming listeners for event fire, before event fire happens, queue these listeners (void register(CallBack cb)). when event fire happens(void fire()), process these events. 1point 3acres 璁哄潧
single thread, multithread situation.

Again I feel that they don't want you to jump directly to the right answer.

Single thread in Java:
boolean isFired = false;
Queue<Callback> q = new Queue<Callback>();
. 鐗涗汉浜戦泦,

评分

2

查看全部评分

firemusume 发表于 2016-6-14 08:52:46 | 显示全部楼层
关注一亩三分地公众号:
Warald_一亩三分地
你好,最近也在准备这家。请问您是在哪里onsite的啊,只有两道题吗?
回复 支持 反对

使用道具 举报

 楼主| lea82 发表于 2016-6-15 04:33:44 | 显示全部楼层
关注一亩三分地微博:
Warald
firemusume 发表于 2016-6-14 08:52
你好,最近也在准备这家。请问您是在哪里onsite的啊,只有两道题吗?
鏉ユ簮涓浜.涓夊垎鍦拌鍧.
mountain view.. visit 1point3acres.com for more.

I got 2 rounds, 1st round only 2 questions..鏈枃鍘熷垱鑷1point3acres璁哄潧
. visit 1point3acres.com for more.
2nd round onsite for 3 questions.
回复 支持 反对

使用道具 举报

firemusume 发表于 2016-6-15 06:00:52 | 显示全部楼层
lea82 发表于 2016-6-15 04:33
mountain view.

I got 2 rounds, 1st round only 2 questions.
. more info on 1point3acres.com
谢谢回复。不知能分享下round2的题目吗,或者楼主还没有去round2?
回复 支持 反对

使用道具 举报

Urumic 发表于 2016-6-16 07:49:36 | 显示全部楼层
请问楼主两轮onsite是同一线还是不同的日子呢?请问楼主方便的话能私信我后面的三道题吗?谢谢楼主。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明

custom counter

GMT+8, 2017-6-24 17:08

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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