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

yelp phone 面经整合

全局:

2015(4-6月) 码农类General 硕士 全职@yelp - 网上海投 - 技术电面  | | Fail | 应届毕业生

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

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

x
Longest Common Prefix + 2
word ladder II + 1
Add Two Numbers + Add Binary +1
1. Write a function to add the two binary number strings.
add('100', '10') -> '110'

2. Follow up, add two number strings with specific base
add('100', '10', 2) -> '110'
add('100', '9', 10) -> '109'. From 1point 3acres bbs

3. Follow up, sum list number strings with specific base
add_strs(['9', '3', '2'], 10) -> ’14'

merge interval
Top 10 query keyword
假设你拿到Yelp昨天的log, 里边每一行都保存的是用户的搜索记录, 找出Top 10 query keyword.
我写了两个方法:
1. 直接用Unix command(他说有bonus): cat -> xargs -> grep -> sort -> uniq -> sort -> head
2. 写了Java code. 扫描每一行, 放进HashMap<String, Integer>. 然后扔进Heap排序, 之后pop出Top 10.
一个是判断是否是palindrome
Anagrams + 3
刚开始是用排序,hashmap<string, arraylist>写,后来改成了数组计数,又经提示,用了hashmap<hashmap<character, integer>, arraylist>这种写法。
Follow up: 怎么用map reduce做?
常规做法不是用一个HashMap<String, List<String>>去存储anagrams, 这个HashMap里的key是输入word按照字符排序得来的。
所以在mapper 里面,yield(key, word), 就这么简单。
input:
man car kile arc none like
output:
man
car arc
kile like
none.
我是用 HashTable 做的,先 sort,key 為 sort 好的,value 是一個 ArrayList<String>
如果key和value都要求有序
只排序一次,compatator中如果两个词的变位词不同,则按变位词排序,如果相同,按原词排序。
再打印的时候判断当前单词和前一个单词的变位词是否相同,如果不同则换行
如果key要求有序输出
hashmap,然后对key进行排序。
random hash map
Implement一个data structure,insert/delete/return a random element的time complexity都是O(1)
Return k most frequent words given a search history,答scan之后建hash map,然后丢进heap裡面一个一个pop。接着要我分析time/space complexity,每一步都分析了,最后一步建heap是n,然后pop_heap答是klogn,他说very good.
设计一个数据结构,要求支持插入,删除和random返回一个元素这三种操作,每种操作的复杂度都要是O(1).
删除元素后,要使用数组最后一元素交换到被删除的当前位置。并更新hashmap中的最后一元素的位置信息
followup是如果要支持duplicate数据怎么办(这个想复杂了没写完),求bless
metrics
如果给一个hash map (or any other data structure),裡面存的是工人名字,和他们做的工作list, i.e., key是每一个worker的名字,values是他们take的project名字 (P1, P3, P5 etc) as follows:
DICT[WORKER_1] = ["P1", "P3", "P10"]-google 1point3acres
DICT[WORKER_2] = ["P2", "P4", "P5"]
每次worker take project之后的时间,也会被记录下来
请想出一个metrics来evaluate which worker is more efficient in finishing projects
这题目一开始面试官说的相当ambiguous,但应该是考察面试者会不会跟面试官沟通交流
这题我光问清楚题意和assumption就花了十几分钟,后面implement了两个metrics (不过忘记了)
pascal triangle + 1
简简单单一个pascal triangle的implement,之后followup了一下fo
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
tSpot compiler in conjunction with Just In Time compilation may do so if needed. The running code is constantly being profiled by the JVM and recompiled to native code if certain rules are met. Most commonly the hot code is the first to compile natively.

How to print "Hello World" in Java, 就大概问下Java基本操作吧。
Java: pass by reference or pass by value? what does pass by value mean?
像C++ vector list等等数据结构查找删除 size()的时间复杂度.
比如interface vs abstract class. 为什么用interface. 为什么用abstract class.

Data structure
hashtable的原理
HashMap的操作 复杂度
Android
比如MVC是什么,大概说说MVC三个东西都是干什么的
The MVC pattern is essentially this:
Model: What to display
View: How it’s displayed
Controller: Formatting the model for display and handling events like user input,such as activity
测试
unit test和integrity test的区别
单元测试(unit testing),是指对软件中的最小可测试单元进行检查和验证。对于单元测试中单元的含义,一般来说,要根据实际情况去判定其具体含义,如C语言中单元指一个函数,Java里单元指一个类,图形化的软件中可以指一个窗口或一个菜单等。总的来说,单元就是人为规定的最小的被测功能模块
整合测试又称组装测试,即对程序模块采用一次性或增殖方式组装起来,对系统的接口进行正确性检验的测试工作。整合测试一般在单元测试之后、系统测试之前进行。实践表明,有时模块虽然可以单独工作,但是并不能保证组装起来也可以同时工作。
individual software modules are combined and tested as a group。It occurs after unit testing and before validation testing. Integration testing takes as its input modules that have been unit tested, groups them in larger aggregates, applies tests defined in an integration test plan to those aggregates, and delivers as its output the integrated system ready for system testing.[1]
Behaviroal questions
1. 介绍你自己.
2. 为什么选我们公司?
3. 公司网站需要什么改进的?

评分

参与人数 6大米 +167 收起 理由
shinnyhu + 5 给你点个赞!
Hmoon + 3 感谢分享!
elizabethxiazhi + 3 感谢分享!
neomiracle + 3 感谢分享!
wcongying + 3 感谢分享!

查看全部评分


上一篇:福特+mobis面经
下一篇:zenefit 电面面经整合
🔗
 楼主| mm豆 2015-6-2 09:41:05 | 只看该作者
全局:
面经链接合集~~~~~

本帖子中包含更多资源

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

x
回复

使用道具 举报

🔗
poioper 2015-6-2 10:38:21 | 只看该作者
全局:
太详细了,一万个赞!
回复

使用道具 举报

🔗
粗面丸子 2015-6-2 10:56:33 | 只看该作者
全局:
太详细了!顶!
回复

使用道具 举报

🔗
jiebour 2015-11-22 08:14:21 | 只看该作者
全局:
Implement一个data structure,insert/delete/return a random element的time complexity都是O(1).   这个题为什么不是hash map?
回复

使用道具 举报

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

本版积分规则

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