Epic Written Interview# JobHunting - 待字闺中
s*c
1 楼
在本地的考试中心预约的上机考试。考试有三个部分,1.数学题,2.给出一种新的编程
语言的语法,回答相应问题,3. Programming Test 要求速度和准确性both important
Programming test 答得不好,肯定不行了,把面试题发上来让大家做做。做了3个半小
时,快累死了。
数学题基本上就是脑筋急转弯,举几个例子
1. You have three kinds of magazines, all but two are Times, all but two are
Science, all but two are Nature. How many magazines in total do you have?
2. Only one of the answers is true
A. All of the below are true
B. All answers are true
C. One of the above is true
D. All of the above are true
E. None of the above are true
F. None of the above are true
3. You have two coins which sum up to 15 cents. One of them is not a dime.
What are the two coins (multiple choice)
A. Penny
B. Nickel
C. Dime
D. Quarter
E. Not possible
第二部分,是介绍一种高级语言,有点像lisp,没什么特别的,就按照它介绍的语法规
则来答
第三部分,编程题,一共四道题,实在没想到有这么多,鼓励自己坚持到最后,写完了
3道。没写上的那个题是最经典的电话按键排列组合题的变种,面之前没看,这个悔呀
1. You are given a telephone keyboard
0-0
1-1
2-ABC2
3-DEF3
4-GHI4
5-JKL5
6-MNO6
7-PQRS7
8-TUV8
9-WXYZ9
0-0
*-space
#-char separater
if you type "2", you will get 'A', that is
"2"-'A'
"22"-'B'
"222"-'C'
"2222"-'D'
However, the digits can repeated many times
"22222"-you get 'A' again
You can use "#" to separate characters, for example
"2#22", you get "AB"
However, you may also have consecutive different digits without separator: "
23"-'AD'
If you type "*", it means space.
You a given a sequence of digits, translate it into a text message
2. Basket ball hit rates
The hit rate of the basketball game is given by the number of hits divided
by the number of chances. For example, you have 73 chances but hit 15 times,
then your hit rate is 15/73=0.205 (keep the last 3 digits). On average, you
have 4.5 chances in each basketball game. Assume the total number of games
is 162. Write a function for a basketball player. He will input the number
of hits he has made, the number of chances he had, and the number of
remaining games. The function should return the number of future hits, so
that he can refresh his hit rate to 0.45
3. A Typist problem. 电话按键题的变种!一个打字员,10个手指,分别负责不同的
按键,
0-null
1-gftrvb
2-edc
3-wsx
4-qaz
5-null
6-yuhjnm
7-ik
8-ol
9-p
给你 9801,输出所有可能组合
pog
pof
pot
por
pov
pob
plg
plf
...
悔啊悔啊,面之前打算看电话按键题的,没看,没想到真考了……
4. String transpose
Transpose a string means re-sequencing a string
If you transpose string1 to string2, you can only swap the adjacent two
characters each time, until you get your target string.
For example, you want to transpose GUW to WUG, the steps are
GUW
GWU
WGU
WUG
Print all steps in string transpose
先把题放着看看,一会儿我再说我的答案
语言的语法,回答相应问题,3. Programming Test 要求速度和准确性both important
Programming test 答得不好,肯定不行了,把面试题发上来让大家做做。做了3个半小
时,快累死了。
数学题基本上就是脑筋急转弯,举几个例子
1. You have three kinds of magazines, all but two are Times, all but two are
Science, all but two are Nature. How many magazines in total do you have?
2. Only one of the answers is true
A. All of the below are true
B. All answers are true
C. One of the above is true
D. All of the above are true
E. None of the above are true
F. None of the above are true
3. You have two coins which sum up to 15 cents. One of them is not a dime.
What are the two coins (multiple choice)
A. Penny
B. Nickel
C. Dime
D. Quarter
E. Not possible
第二部分,是介绍一种高级语言,有点像lisp,没什么特别的,就按照它介绍的语法规
则来答
第三部分,编程题,一共四道题,实在没想到有这么多,鼓励自己坚持到最后,写完了
3道。没写上的那个题是最经典的电话按键排列组合题的变种,面之前没看,这个悔呀
1. You are given a telephone keyboard
0-0
1-1
2-ABC2
3-DEF3
4-GHI4
5-JKL5
6-MNO6
7-PQRS7
8-TUV8
9-WXYZ9
0-0
*-space
#-char separater
if you type "2", you will get 'A', that is
"2"-'A'
"22"-'B'
"222"-'C'
"2222"-'D'
However, the digits can repeated many times
"22222"-you get 'A' again
You can use "#" to separate characters, for example
"2#22", you get "AB"
However, you may also have consecutive different digits without separator: "
23"-'AD'
If you type "*", it means space.
You a given a sequence of digits, translate it into a text message
2. Basket ball hit rates
The hit rate of the basketball game is given by the number of hits divided
by the number of chances. For example, you have 73 chances but hit 15 times,
then your hit rate is 15/73=0.205 (keep the last 3 digits). On average, you
have 4.5 chances in each basketball game. Assume the total number of games
is 162. Write a function for a basketball player. He will input the number
of hits he has made, the number of chances he had, and the number of
remaining games. The function should return the number of future hits, so
that he can refresh his hit rate to 0.45
3. A Typist problem. 电话按键题的变种!一个打字员,10个手指,分别负责不同的
按键,
0-null
1-gftrvb
2-edc
3-wsx
4-qaz
5-null
6-yuhjnm
7-ik
8-ol
9-p
给你 9801,输出所有可能组合
pog
pof
pot
por
pov
pob
plg
plf
...
悔啊悔啊,面之前打算看电话按键题的,没看,没想到真考了……
4. String transpose
Transpose a string means re-sequencing a string
If you transpose string1 to string2, you can only swap the adjacent two
characters each time, until you get your target string.
For example, you want to transpose GUW to WUG, the steps are
GUW
GWU
WGU
WUG
Print all steps in string transpose
先把题放着看看,一会儿我再说我的答案