一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

扫码关注一亩三分地公众号
查看: 499|回复: 0
收起左侧

Twitter OA

[复制链接] |试试Instant~ |关注本帖
tyang12 发表于 2016-4-29 02:06:02 | 显示全部楼层 |阅读模式

2016(1-3月) 码农类 硕士 全职@Twitter - 校园招聘会 - 在线笔试 |Otherfresh grad应届毕业生

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

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
突然发现上个月的作的twitter OA还没发,一样是60mins 两题,
第一题:
Input format:
N        // count of number in the input
d[0]        //1st number
d[1]        //2nd number.1point3acres缃
.... 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
d[n-1]        //last number. visit 1point3acres.com for more.
. 1point 3acres 璁哄潧

Output format:
The first line contains a string of n bits, where the i-th bit (as read from left to right) indicates if there is any number before b which is equal to b.
The second line contains a string of n bits, where the i-th bit (as read from left to right) indicates if there is any number after b which is equal to b.
. 1point3acres.com/bbs
Sample input:. visit 1point3acres.com for more.
6        //total 6 numbers given below
1
3
2. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴
3-google 1point3acres
4
1.鐣欏璁哄潧-涓浜-涓夊垎鍦
. 1point 3acres 璁哄潧
Sample output:-google 1point3acres
000101.1point3acres缃
110000


这题我在做之前看地里其他帖子分享过,我是用HashSet来做

第二題:
Return the count of numbers X in the range 1<=X<=N that satisfy the following property:
(X-1) !  % X = X-1

Input Parameter:
A single integer N
. visit 1point3acres.com for more.
Constraints:
1 <= N <= 10^5

Output Format:. 鍥磋鎴戜滑@1point 3 acres
A single integer which in the count of the numbers that satisfy the above property.

Sample Input:
2
Sample Output:
2
. more info on 1point3acres.com
Sample Input:
4
Sample Output:
3

这题我作之前没看过,所以一看到有点慌,我列了N= 1~7的结果后,猜测就是在找prime number (时间不够,没想到怎么证明...),幸运通过所有test cases,
------------------------------------------------------------------------

做完后跟地里大家一样填了pre-interview questions,直到4/14才收到信,说这周五前会有消息,等了好久,希望这两天能得到下一步面试啊!!! !.鐣欏璁哄潧-涓浜-涓夊垎鍦

评分

1

查看全部评分

本帖被以下淘专辑推荐:

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

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

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2016-12-11 18:41

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

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