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

Two sigma 电面附solution

全局:

2016(10-12月) 码农类General 硕士 全职@twosigma - 猎头 - 技术电面  | | Pass | 在职跳槽

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

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

x
他们家问问题的次序都跟一模一样
我都打印了出来,不用翻页,就顺序读出来

求大米求大米

Q1 What     is a hash table? What do you do to handle hash table collision?
Q2
Medianin a     stream of integers
Q3
Whatis merge     sort? What is quick sort? What are theirrelative advantages and     disadvantages?
Q4 examples of  pattern
Q5 Differences    between threads and processes and how to communicate? IPC ITC
Q6
What     is throughput? What is     latency? What are their     relationships?


solution
  • What     is a hash table? What do you do to handle hash table collision? 我答了最基本的hash     function, hash into a slot, linear probing, chaining method, etc.
2 parts:array and hash function; a data structure that can map  to .
  
           Average
  
  
                 Worst case
  
  
Space
  
  
O(n)
  
  
O(n)
  
  
Search
  
  
O(1)
  
  
O(n)
  
  
Insert
  
  
O(1)
  
  
O(n)
  
  
Delete
  
  
O(1)
  
  
O(n)
  
[b]A hash function is any that can be used to map of arbitrary size to data of fixed size.
Separate chaining with linked lists
[/b][b]open addressing,all entry records are stored in the bucket array itself. When a new entry hasto be inserted, the buckets are examined, starting with the hashed-to slot andproceeding in some probe sequence, until an unoccupied slot is found.[/b][b]Quadratic:H+1,H+4,H+9,H+16,H+25,…[/b]linear probing searches the table for the closest following free locationand inserts the new key there.
  • Median     in a     stream of integers - 我答了two     heap的solution,然后补充说如果内存不够存stream可以用reservoir     sampling     sample一个subset来估算。
For thefirst two elements add smaller one to the maxHeap on the left, and bigger oneto the minHeap on the right. Then process stream data one by one,
Step1: Add next item to one of the heaps
   if next item is smaller than maxH
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
">IPC:
  
  
  
A record stored on disk, or a record synthesized on demand  by a file server, which can be accessed by multiple processes.
  
  
  
  
A data stream sent over a network interface, either to a  different process on the same computer or to another computer on the network.
  
  
  
  
A unidirectional data channel. Data written to the write  end of the pipe is buffered by the operating system until it is read from the  read end of the pipe.
  
ITC: · Shared memory, like a variable or some other data structure
· Synchronization primitives, like locks and sempahores
·  Events: wait, notify
  • What     is throughput? What is     latency? What are their     relationships?
Latencyis the time involved to complete any sort of process. Throughput is the amountof information a sy canprocess within a given time period (actual rate that the information istransferred). Latency and throughput are not necessarily correlated, because ofdata density. A system that has high latency but can transfer a huge amount ofdata can still have higher throughput than a low-latency system.
Throughtput is affected by latencyif protocol requires synchronous acknowledges of received data.


评分

参与人数 8大米 +239 收起 理由
vincent_shiwei + 3 很有用的信息!
菜元培kiwicai + 5 感谢分享!
dc_726 + 10 感谢分享!
wadephz + 3 感谢分享!
ginues109 + 3 很有用的信息!

查看全部评分


上一篇:<Coursera>发贴召集拿到Coursera下一步通知的同学,一起过面试拿offer
下一篇:Bloomberg 17 Summer Intern 电面
全局:
LZ店面完多久通知onsite的啊
回复

使用道具 举报

🔗
syjohnson 2016-11-7 04:41:09 | 只看该作者
全局:
lz太给力了!预祝onsite好运
回复

使用道具 举报

🔗
 楼主| cytmike 2016-11-13 11:50:24 | 只看该作者
全局:
elizabethxiazhi 发表于 2016-11-1 10:30
LZ店面完多久通知onsite的啊

about 10 days
回复

使用道具 举报

🔗
xyao01 2016-11-15 05:22:37 | 只看该作者
全局:
感谢楼主的分享!请问median of the data stream需要写code吗 还是口述就行了?
回复

使用道具 举报

🔗
tqi222 2016-11-15 05:32:25 | 只看该作者
全局:
太棒了 楼主有之前online code challange的信息吗?
回复

使用道具 举报

全局:
好顶赞 强烈看好楼主
回复

使用道具 举报

🔗
kamibear 2016-12-11 15:03:52 | 只看该作者
全局:
这个好详细啊!
回复

使用道具 举报

🔗
myangelasuka 2016-12-11 15:10:56 | 只看该作者
全局:
亲爱的楼主祝早日offer!
回复

使用道具 举报

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

本版积分规则

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