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

Zenefits 三轮skype面

全局:

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

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

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

x
我也发个上周zenefits的面经吧 已经挂了
三轮skype技术面, 一轮和manager聊天, 说是相当于onsite

第一轮两个题目:
(1)You are given an array a of sizeN. The elements of the array area[0], a[1], ... a[N - 1], where each a is either 0 or 1. You can perform one transformation on the array: choose any two integers [i]L,and R, and flip all the elements between (and including) the Lth and Rth bits. In other words, L and R represent the left-most and the right-most index demarcating the boundaries of the segment whose bits you will decided to flip. ('Flipping' a bit means, that a 0 is transformed to a 1 and a 1 is transformed to a 0.)

What is the maximum number of '1'-bits (indicated by S) which you can obtain in the final bit-string?

Input Format:
The first line has a single integerN
The next N lines contains the Nelements in the array,a[0], a[1], ... a[N - 1], one per line.
Note: Feel free to re-use the input-output code stubs provided.

Output format:
Return a single integer that denotes the maximum number of 1-bits which can be obtained in the final bit string

Constraints:
1 ≤ N ≤ 100,000
d can be either [i]0 or 1. It cannot be any other integer.
0 ≤ L ≤ R < N

Sample Input:
810010010

Sample Output:
6

Explanation:
We can get a maximum of 6 ones in the given binary array by performing either of the following operations:
Flip [1, 5] ⇒ 1 1 1 0 1 1 1 0
or
Flip [1, 7] ⇒ 1 1 1 0 1 1 0 1

(2)Given N unique positive integers, we want to count the total pairs of numbers whose difference is K. The solution should minimize computational time complexity to the best of your ability

Input Format:
1st line contains N and K, which are integers separated
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
ne city (Bay Area) - 50K people, and one sparsely populated country (US) - 500K people.

[size=12.8000001907349px]Each person has on average 5K interest_ids, which is a random number between 1 and 10K (interest_ids are not necessarily numbered 1 to 10K). Number of people who have a specific interest_id tends to follow power law distribution, with 20% of interests having 80% of user_ids, recursively.


[size=12.8000001907349px]Scoring: It’s a function of:
[size=12.8000001907349px]- Time taken for the program to run.
[size=12.8000001907349px]- Number of words of code. Therefore obfuscation doesn’t help much, you can gladly give large variable names. The idea is to keep the logic extremely simple.
[size=12.8000001907349px]
[size=12.8000001907349px]
[size=12.8000001907349px]

评分

参与人数 4大米 +10 收起 理由
leanlee + 3 感谢分享!
note + 3 感谢分享!
cynthiazhxu + 3 Welcome
YY大帝 + 1 欢迎来一亩三分地论坛!

查看全部评分


上一篇:epic OA 4/7
下一篇:【求助】地里有没有面上过Pocket Gems的朋友?
推荐
 楼主| hotIce 2015-4-8 07:29:14 | 只看该作者
全局:
重贴一下第三题

Our app is about showing interesting people around a location. Interesting people are those who share a lot of friends and interests with you.

Input:
N -- number of commands. Followed by N lines, each of the format:
Op args

Op can either be ‘Q’ or ‘W’.
Q is a query operation which takes two args:
user_id miles

miles is always one of the 3 values: 1, 5 or 30.

W is the insertion operation, which takes args of the form:
user_id lat lng interest_id1 weight1 interest_id2 weight2 ...

interest_ids are the set of all interests that user cares about. This could be his facebook friends or interests, each of them having a specific weight.

Output:

For each query operation, output a single line containing the top 10 (or less) user_id’s who are within the ‘miles’ radius of the user and have the highest scalar product of common interest weights. These must be sorted in the order of the weights highest to lowest, tie broken by user_id lowest to highest.

Constraints:

This is more of a real-life problem, than a programming contest puzzle. So the test-case will reflect practically what happens in our software, and not hand-generated corner cases.

Test case will have one densely populated university (Stanford) - 500 people, one city (Bay Area) - 50K people, and one sparsely populated country (US) - 500K people.

Each person has on average 5K interest_ids, which is a random number between 1 and 10K (interest_ids are not necessarily numbered 1 to 10K). Number of people who have a specific interest_id tends to follow power law distribution, with 20% of interests having 80% of user_ids, recursively.


Scoring: It’s a function of:
- Time taken for the program to run.
- Number of words of code. Therefore obfuscation doesn’t help much, you can gladly give large variable names. The idea is to keep the logic extremely simple.
回复

使用道具 举报

推荐
 楼主| hotIce 2015-4-9 02:01:52 | 只看该作者
全局:
57656929bb 发表于 2015-4-9 01:55
第三题没弄明白,楼主当时怎么答得啊

这个题我回答的不好 最后折腾出来的答案用的数据结构如下:
unordered_map<pair<int, int>, unordered_set<int> > coordMap;
unordered_map<int, unordered_set<int> > intersetMap;

大致思路就是分别根据coordinate和interest vector 的范围对users分类, 来减少不必要的查询.
回复

使用道具 举报

推荐
huahuazhu 2015-5-17 01:35:13 | 只看该作者
全局:
hotIce 发表于 2015-4-9 02:01
这个题我回答的不好 最后折腾出来的答案用的数据结构如下:
unordered_map coordMap;
unordered_map int ...

楼主你遇到的题目都很难啊,第三轮这个题目也是要当成写完code跑那些test嘛? 他家skype面试的时候用的也是hackerrank的界面么?
回复

使用道具 举报

🔗
YY大帝 2015-4-8 07:33:45 | 只看该作者
全局:
感谢分享,请问lz之前是几轮店面
回复

使用道具 举报

🔗
 楼主| hotIce 2015-4-8 07:36:56 | 只看该作者
全局:
YY大帝 发表于 2015-4-8 07:33
感谢分享,请问lz之前是几轮店面

之前只有个Zen Test 3, 然后就店面了
回复

使用道具 举报

🔗
nibuxing 2015-4-8 07:53:17 | 只看该作者
全局:
为啥有的人是三轮有的人是一轮啊
回复

使用道具 举报

🔗
bobzhang2004 2015-4-8 07:54:54 | 只看该作者
全局:
这个公司不知道实习怎么样,感觉好多面试
回复

使用道具 举报

🔗
 楼主| hotIce 2015-4-8 10:31:53 | 只看该作者
全局:
nibuxing 发表于 2015-4-8 07:53
为啥有的人是三轮有的人是一轮啊

我也不清楚 三轮估计就相当于onsite了
回复

使用道具 举报

🔗
 楼主| hotIce 2015-4-8 10:32:14 | 只看该作者
全局:
bobzhang2004 发表于 2015-4-8 07:54
这个公司不知道实习怎么样,感觉好多面试

据说是2014最hot 的startup
回复

使用道具 举报

🔗
sijiyuren 2015-4-8 10:50:33 | 只看该作者
全局:
楼主是三轮一天内面完的?
回复

使用道具 举报

🔗
 楼主| hotIce 2015-4-8 10:51:57 | 只看该作者
全局:
sijiyuren 发表于 2015-4-8 10:50
楼主是三轮一天内面完的?

恩 三轮挨着 背靠背 面完三轮后funder打电话聊了10来分钟
回复

使用道具 举报

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

本版积分规则

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