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

LiveRamp电面面经以及一些电面题目的解答

全局:

2015(4-6月) 码农类General 硕士 全职@ - 内推 - 技术电面  | | Fail | 应届毕业生

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

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

x
楼主,刚刚结束liveramp的一电面试,怀着很忐忑的心情奉献上热辣面筋。一共三道题目

第一个是what‘s your most Challenging project?这个题目我答得不好,估计跪在这里了

第二道题目:纸牌问题,我答得比较好!
第三道题目:given 1 terabyte key-value data, how do you store them so that insert, find, delete operations can be very fast?
这个问题我的回答是把这个大的file分成10,000份,then to the remainder that hashcode of each element modulo 10.000, we decide which element is in which small file。

如果有十台机器的话,先把这个big file 划分到10 台机器上,然后再载每台机器上划分成10,000份, 每一份再hash。

30份分钟的电面20分钟就结束了,我也感受到面试官Soerian的不耐烦。不管怎么样吧,这个公司我都好好的准备了,希望接下来其他公司的面试一切顺利吧。
下面是我自己总结的地里面一些liveramp题目的答案,希望造福后来者吧。

下面是six degree的题目答案:

We can treat the problem as a graph. Each person represents a node. and if two people are friends, there is a edge between the two nodes that represent them. The problem becomes that find the shortest path between two node: start node and end node.

We can adopt BFS, Dijkstra algorithm,  Bidirectional BFS.
|E| is the number of edges, and |V| is the number of vertex.
1   BFS runs in time O(|V| + |E|)
2   Dijkstra Algorithm with a priority queue runs in time O(|E| + |V|log|V| )
Since the weight of each edge in the search grap is same, Dijkstra algorithm  will degenerate into BFS. Besides, it needs more data structre than BFS to implement it. For example, Dijkstra algorithm needs priority queue to keep track of every vertex and distance array to keep track of the distance from source vertex to other vertex.
3   Bidirectional BFS is better than BFS.
I will talk about why Bidirectional BFS is better than BFS below.
assume the distance between source to target is k, and the branch factor is B [every vertex has B edges].
BFS will open: 1 + B + B^2 + ... + B^k vertices.
bi-directional BFS will open: 2 + 2B + 2B^2 + 2B^3 + .. + 2B^(k/2) vertices.
for large B and k, the second is obviously much better the the first.

I will choose bidirectional BFS.

Algorithm idea: do a BFS search simultaneously from the source and the target level by level. (level 0 from source and target respectively , level 1 from source and target respectively....)    The algorithm will end when the level from source meets the level from the target.

We will use the following data structures:
1   two queues to do BSF respectively from source and target node
2   we need class Node to represent every node in the graph.
Class Node {
        public String name;
        public ArrayList<Node> neighbors; //
        public ArrayList<Node> predecessors; // to keep track of predecessors of every node in order to construct the shortest path after Bi-                         BFS
        public boolean visited; // label the visited node
        public boolean visitedFromStart; //label the node that are visited from start node
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
出unique words 的数目?如果是1GB?   hashset    1TB? 分布式系统design
下面是这道题目的我和朋友们讨论的答案:


思路1:把数据分块,对每块unique再把这些结果收集起来一起uniqiue
思路2: 根据STRING产生HASHCODE,再和总机器数量去余数,根据余数可以把一样的STRING都分配到一个小机器上,每台机器分组HASHSET 先把小集合里面重复的都去掉 汇总应该就可以了
assume we have n computers, then we scan the big file, and compute the hashcode of each string, then  hashcode modulo n (the number of computers) , we get a remainder. according to the remainder, we assign the string to respective computer. after scan the whole file,  each mechine will use a hashtable to count the number of unique string on that mechine. Then we add up the number from all mechines. and we get the total number of unique string.
If there are a lot of strings on one mechine, we can divide the strings into M chunks, for each chunk, we use a hashtable to find out the unique strings and put them into a file.  then merge these small files into a big file.  Then we do the same operation on the big file recursively until there are no duplicates and we count the number.
思路3: 1. 采样1% string,数据大的话实际上0.1%也成,排序。2.把这个排序的文件分成n份,记录下分点上的string。3.处理源数据,分成m块,每块uniq,然后对每个结果string,在2的结果上二分查找决定分到哪份,写下去

step 1 we take some sample strings from the big file. for example ,one percent or  zero point one percent (0.1 %) if the file is too big. Then we sort the sample strings.
step 2 we divide the sample strings into N intervals
step 3 we divdie the big file into M chunks, for each chunk we use a hashset to find out the unique strings. then for each unique string we use binary search to find its position in the smaple strings, put it into relitive interval.
step 4 we deal with the N intervals respectively.  for each intervals we use a hashmap to  find out the unique strings . Then  we add up the number of unique strings in each interval  and we get the total number of unique string.


翻纸牌问题的答案:


cards on the table, X, Y, 1, 2. . WEach card has letter on one side and number on the other side. . Given the statement "The number side of X is even", at least how many cards need to flip to prove/disprove it?

answer: we need to filp two cards, one is X card, the ohter is 1 card. if the other side of X card is odd, the statement is false. OR if the other side of 1 card is X, the statement is false. Otherwise, the statement is true;


投篮问题的答案:
投篮3个进2个,或者8个进5个算赢,问你选哪个
solutions:


according to the law of large numbers (LLN), the  of the results obtained from a large number of trials should be close to the , and will tend to become closer as more trials are performed.
if your shooting probility is greater than 0.6 , I will choose ⅝.  if you are not gooding at playing basketball, I will choose ⅔, and you got that result  by chance.




以上这些题目的答案是我自己总结的,可能有不足的地方,仅供参考,也希望大家提出改进的意见。


anyway,我感觉自己很认真准备这家公司,最后还是fail了,希望其他公司的面试一切顺利吧。。。。PS,大家看在我这么认真和用心总结的份上,赏点大米吧。谢谢啦







评分

参与人数 15大米 +150 收起 理由
Ssst + 10 很有用的信息!
tinialiu + 3 感谢分享!
一亩三分地再见 + 10 感谢分享!
jigsaw_Becky + 10 感谢分享!
yogurtland123 + 80

查看全部评分


上一篇:IXL LEARNING一面面筋,顺便求点大米搜索:)
下一篇:Google电面面经
🔗
summerlight 2015-4-16 11:45:15 | 只看该作者
全局:
看来不同人面的题不一样 我今天是Tenzi面的 还有新题==
回复

使用道具 举报

🔗
 楼主| chenwoo 2015-4-16 11:50:53 | 只看该作者
全局:
stevenlordiam 发表于 2015-4-16 11:45
看来不同人面的题不一样 我今天是Tenzi面的 还有新题==

嗨,我跪在旧题上了,太遗憾了,祝福你move on and get the offer
回复

使用道具 举报

🔗
summerlight 2015-4-16 12:19:08 | 只看该作者
全局:
chenwoo 发表于 2015-4-16 11:50
嗨,我跪在旧题上了,太遗憾了,祝福你move on and get the offer

我也没回复。。。看了几个今天的都没回复 看来真的是在练习面试官
回复

使用道具 举报

🔗
 楼主| chenwoo 2015-4-16 21:56:32 | 只看该作者
全局:
stevenlordiam 发表于 2015-4-16 12:19
我也没回复。。。看了几个今天的都没回复 看来真的是在练习面试官

是啊,anyway,还有很多好公司那
回复

使用道具 举报

🔗
 楼主| chenwoo 2015-4-16 21:56:38 | 只看该作者
全局:
stevenlordiam 发表于 2015-4-16 12:19
我也没回复。。。看了几个今天的都没回复 看来真的是在练习面试官

是啊,anyway,还有很多好公司那
回复

使用道具 举报

🔗
chenwenzhejob 2015-4-17 14:15:00 | 只看该作者
全局:
楼主不要灰心,我第二面被拒。 其实不管你答得多好都是没用的。 一开始我不相信,后来我给出很好的答案还悲剧就相信了。 加油!
回复

使用道具 举报

🔗
 楼主| chenwoo 2015-4-17 21:57:58 | 只看该作者
全局:
chenwenzhejob 发表于 2015-4-17 14:15
楼主不要灰心,我第二面被拒。 其实不管你答得多好都是没用的。 一开始我不相信,后来我给出很好的答案还悲 ...

Thx, 同加油啦
回复

使用道具 举报

🔗
面假空虚 2015-10-22 17:14:54 | 只看该作者
全局:
Dijkstra的复杂度写错了吧?是O(|V|+|E|*lg|V|), 前面是初始化所有点,后面是最多做总边树次min heap的reduce key操作。
回复

使用道具 举报

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

本版积分规则

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