由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - amazon phone interview questions
相关主题
amazon 一道题Amazon 2nd Phone Interview
问一道online test的database题。。。数组里面找数个出现了奇数次的整数,怎么找?
Given an array of N integers from range [0, N] and one is missing. Find the missing number.大家看看这几道亚麻面试题怎么做?
这题怎么做?数组找唯一的出现偶数次元素用 xor怎么做
一道面试题Google的这一道题的最优解?继续求助@!
问一个关于xor的题probably XOR problem
Amazon 电面经历Find shortest substring that is only occurring once. in Given String(Medallia面试题)
请教一个面试题贡献一次电面题
相关话题的讨论汇总
话题: abcd话题: amazon话题: movie话题: interview话题: cat
进入JobHunting版参与讨论
1 (共1页)
w******l
发帖数: 58
1
一共50min,interview是个印度人, 不太习惯口音, 老让他重复.... 大概记得下面这些
题目
1. introduce yourself, talk about research, why amazon?
2. an array contain integers, all but one integer occurs even times, how to
find the one that occurs odd times?
3. IMDB database, given two random actors, how to find the shortest degree o
f seperation between them? (if A and B are in the same movie, then deg(A,B)=
0,
if A and B are in the same movie, B and C are in the same movie, then deg(A,
C)=1)
4. a stream of numbers with unknown si
b******v
发帖数: 1493
2
多谢共享
50分钟答了这么多题,每道题只要说大致思想就行了吗?
c**********n
发帖数: 516
3
bless , thank you for sharing

to
o
uni
local

【在 w******l 的大作中提到】
: 一共50min,interview是个印度人, 不太习惯口音, 老让他重复.... 大概记得下面这些
: 题目
: 1. introduce yourself, talk about research, why amazon?
: 2. an array contain integers, all but one integer occurs even times, how to
: find the one that occurs odd times?
: 3. IMDB database, given two random actors, how to find the shortest degree o
: f seperation between them? (if A and B are in the same movie, then deg(A,B)=
: 0,
: if A and B are in the same movie, B and C are in the same movie, then deg(A,
: C)=1)

s*****l
发帖数: 45
4
多谢分享,我听Amazon的朋友说take home的 coding question是好迹象,
不用担心,他们也不是一定要求你一定要在一个小时内做完,make it correct and
work是最重要的。
第八个感觉是该用grep返回所有result,然后在trim,保留Top 4.
不太明白这题什么意思,大侠能再补充说说么?
3. IMDB database, given two random actors, how to find the shortest degree
of seperation between them?
b******v
发帖数: 1493
5
第8题我想到的方法是
grep '[0-9]*' test.htm | head -4
不过这样把数字所在行的所有内容都打印出来了
得想办法只打出数字
w******l
发帖数: 58
6
差不多, 说说用的数据结构, 算法. 因为没有让当场写code,所以比较快

【在 b******v 的大作中提到】
: 多谢共享
: 50分钟答了这么多题,每道题只要说大致思想就行了吗?

b******v
发帖数: 1493
7
这样改进一下可以只得到数字:
grep '[0-9*]' test.htm | head -4 | sed 's/[^0-9]/ /g'
不过会得到超过4个数字,但是头4个数字肯定在里面

【在 b******v 的大作中提到】
: 第8题我想到的方法是
: grep '[0-9]*' test.htm | head -4
: 不过这样把数字所在行的所有内容都打印出来了
: 得想办法只打出数字

w******p
发帖数: 166
8
With this input file:
$ cat abcd
asdf asd i6f 121 asd
45 6a asv
a7 12 8 7
First 4 numbers:
$ cat abcd | tr "[[:space:]]" "\n" | grep "\<[[:digit:]]*\>" | head -4
121
45
12
8
First 4 digits:
$ cat abcd | sed -e :a -e '$!N;{s/[^0-9]//g;s/\n//;ta}' | sed -e '{s/^\(.\{4
\}\).*/\1/}'
6121
b******v
发帖数: 1493
9
学习了,多谢!

{4

【在 w******p 的大作中提到】
: With this input file:
: $ cat abcd
: asdf asd i6f 121 asd
: 45 6a asv
: a7 12 8 7
: First 4 numbers:
: $ cat abcd | tr "[[:space:]]" "\n" | grep "\<[[:digit:]]*\>" | head -4
: 121
: 45
: 12

g*****t
发帖数: 42
10
请教第4题怎么答?
a stream of numbers with unknown size, how to choose each number each uni
form probability
相关主题
问一个关于xor的题Amazon 2nd Phone Interview
Amazon 电面经历数组里面找数个出现了奇数次的整数,怎么找?
请教一个面试题大家看看这几道亚麻面试题怎么做?
进入JobHunting版参与讨论
h****r
发帖数: 2056
11
For the first 4 numbers, there is a simple way,
$cat abcd | tr -s " " "\n" | egrep '^[0-9 ]*$' | head -4

【在 w******p 的大作中提到】
: With this input file:
: $ cat abcd
: asdf asd i6f 121 asd
: 45 6a asv
: a7 12 8 7
: First 4 numbers:
: $ cat abcd | tr "[[:space:]]" "\n" | grep "\<[[:digit:]]*\>" | head -4
: 121
: 45
: 12

w******1
发帖数: 520
12
2
3 题目我都没看懂,。。。。
h****r
发帖数: 2056
13
2考的是XOR。

【在 w******1 的大作中提到】
: 2
: 3 题目我都没看懂,。。。。

o***e
发帖数: 497
14
这个好像有问题哦

【在 h****r 的大作中提到】
: For the first 4 numbers, there is a simple way,
: $cat abcd | tr -s " " "\n" | egrep '^[0-9 ]*$' | head -4

h****r
发帖数: 2056
15
What problem?

【在 o***e 的大作中提到】
: 这个好像有问题哦
o***e
发帖数: 497
16
你把你的test文件开头加上些空格再试试

【在 h****r 的大作中提到】
: What problem?
h****r
发帖数: 2056
17
cat abcd | sed -e 's/^ *//' | tr -s ' ' '\n' | egrep '^[0-9]*$'

【在 o***e 的大作中提到】
: 你把你的test文件开头加上些空格再试试
t**n
发帖数: 272
18
reservoir sampling
第一个数1/1几率留下来,第二个数1/2几率替换留下来的数,第三个1/3几率替换...

【在 g*****t 的大作中提到】
: 请教第4题怎么答?
: a stream of numbers with unknown size, how to choose each number each uni
: form probability

1 (共1页)
进入JobHunting版参与讨论
相关主题
贡献一次电面题一道面试题
近来比较重复的问题, 求解问一个关于xor的题
怎么找一个数组里面,出现次数是偶数的数?Amazon 电面经历
面试题求解请教一个面试题
amazon 一道题Amazon 2nd Phone Interview
问一道online test的database题。。。数组里面找数个出现了奇数次的整数,怎么找?
Given an array of N integers from range [0, N] and one is missing. Find the missing number.大家看看这几道亚麻面试题怎么做?
这题怎么做?数组找唯一的出现偶数次元素用 xor怎么做
相关话题的讨论汇总
话题: abcd话题: amazon话题: movie话题: interview话题: cat