m**********4 发帖数: 774 | 1 【 以下文字转载自 Quant 讨论区 】
发信人: mitchell1984 (呜呜呜), 信区: Quant
标 题: An impossible interview for me
发信站: BBS 未名空间站 (Tue Oct 12 16:03:08 2010, 美东)
Today I had my third-round interview with this company. Got some pretty
tough questions (from my standard). I won't regret that I failed this one,
because some questions are really beyond my ability.
1. n boxes, k balls, expected number of empty boxes.
2. an array with 0's and 1's, find in O(n) time and O(1) space the longest
sequence with equal number of 1's and 0's.
can do it with O(n) time and O(n) space. How to do O(1) space.
3. Suppose you have a four digit code. each one takes 0~9.
Now suppose that you have a very stupid code machine. you can enter any
length of coed into it:
if you enter 123456
it considers you entered three code:
1234
2345
3456
What is the smallest length of string I need to enter to guarantee that I
find out your code? How would you write such a string? | t*****j 发帖数: 1105 | 2 第一题有人答了,第二题之前本版有讨论,第三题看不懂。 |
|