蒙古青年论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 296|回复: 0

Nancy公司的一个员工去微软的面世题(zz)

[复制链接]
发表于 2006-8-1 09:07:07 | 显示全部楼层 |阅读模式
There was first an email test which had to be completed in one hour. If you
failed this there was a second online test (I don't know the details of that :)  
). Then there was a face-to-face interview with 4 different people for 4 more  
tests, where you are expected to solve the problem on the spot (ie oral test,  
not a paper test) and write code on the whiteboard.

  

Here's the email test:

  

1. Write a function in C/C++ that takes in an array of values and returns a
list of all character sequences with more than 2 letters that appear in more
than one array value.  Ex. input of ("a_williams", "will_01", "will_01_iam")
would return ("wil", "will", "ill", "iam").

  

For extra credit:

  

1a. Order the results in descending order based on the number of input values  
each sequence matched.

  

1b. Prune the results by removing all results that are a substring of another  
result that matched the same number of input values.  In the above example
"wil" and "ill" would both be discarded because they are both a substring of
"will" and all 3 values match 3 input strings

  


Here's the interview tests:

  

* you have a scale and 5 marbles, one of which is slightly heavier than the
others. Using the scale, how many comparisons do you need to make to identify
the heavier one? How about if you have 7 marbles? How about 10? What is the
maximum number of marbles that you can deal with in three measurements?
  
* Sort a vector of integers which only contains 0s and 1s (you can give more  
answers but they expect an in-place sorting of O(n) complexity). Code on the
whiteboard.
  
* At a party there are some regular people and a celebrity. Some people know  
each other, others don't. Everybody knows the celebrity, the celebrity doesn't
know anybody. You have a vector of all the persons at the party and a
function knows(A, B) which returns true if person A knows person B. Write a function  
to find the celebrity. Code on the whiteboard. (it's ok to mention O(n*n), I
also found a O(n*log) but they expect a O(n) algorithm)
  
* Make the design diagram for a Tetris game (identify the entities involved
and the responsibilities of each one) Name the design patterns used, if any.
Draw it on the whiteboard.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|蒙古青年论坛

GMT+8, 2026-7-16 13:53 , Processed in 0.010147 second(s), 14 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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