Friday, October 24, 2008

两道经典谷歌面试题

两道经典谷歌面试题 由 本来清静 于 2008-10-23 15:42:37
(1)
1
1 1
2 1
1 2 1 1
1 1 1 2 2 1

下一行是什么?

(2) 数列中下一个应该是: 10, 9, 60, 90, 70, 66, ?

A) 96
B) 1000000000000000000000000000000000
0000000000000000000000000000000000
000000000000000000000000000000000
C) Either of the above
D) None of the above



.
.
.
.
.

(1)
其实每一行都是对上一行的“统计”,而且去掉了汉字。
第一行:“1”统计为:1个1,去掉“个”字,就变成了“11”,也就是第二行。
同理,第二行可统计为:2个1,去掉“个”字,就变成了“21”,也就是第三行。
同理,第三行可统计为:1个2和1个1,去掉“个”字和“和”字,就变成了“1211”,也就是第四行。
同理,第四行可统计为:1个1和1个2和2个1,去掉“个”字和“和”字,就变成了“111221”,也就是第五行。
同理,第五行可统计为:3个1和2个2和1个1,去掉“个”字和“和”字,就变成了“312211”,也就是第六行。


(2)
This can be looked up and found to be sequence A052196 in the On-Line Encyclopedia of Integer Sequences, which gives the largest positive integer whose English name has n letters. For example, the first few terms are ten, nine, sixty, ninety, seventy, sixty-six, ninety-six, …. A more correct sequence might be ten, nine, sixty, googol, seventy, sixty-six, ninety-six, googolplex. And also note, incidentally, that the correct spelling of the mathematical term "google" differs from the name of the company that made up this aptitude test.

No comments:

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...