First the interviewer have called me on time, he introduced himself and his project which takes about 10 minutes, then he asked me why do you want to join facebook..
Then he started in the technical questions, the first questions was:
he described to me a game called othelo (http://en.wikipedia.org/wiki/Reversi) which is a 2 player board game using for example X and O, if player X placed X in an empty space
_OOOX
the O's between the two X's will be converted to X
XOOOX ==> XXXXX
this will happen on the current row, column, and the two diagonals in every directions
and if the following case happened
__OOX
and the X player placed X in the first space
X_OOX
nothing occured for the two Os
given a certain state of the board, location on the board, a certain piece
to place on the given location
update the board, and make the required validations
Then I started to code the required method, then have revised it and fixed small bugs, then he told me that it seems to be working.
then we turned to the second question:
which is given a Collection<String> words, return a Collection<String> of anagrams found in the given collection for example "The rat fell in the tar" => returned [rat tar]
Then I have discussed him in an algorithm with O(n k lg k) where n is the number of words and k is the average length of the word, then I started to code it and then he said that it seems to be working.
then the interview is finished.
Notes:
* Try to practice a lot before the interview, by solving such problems and try to mimic the interview environment by coding in the collabedit.com text editor
* Don't use Ctrl + S while coding in collabedit as it may lead to some problems.
* Don't be afraid before the interview, just calm down as the interviewers are very friendly.
Good Luck :)
I cannot finish the question, you can check(remove the '/' among 'w')
- Anonymous January 05, 2011/w/w/w.careertea.com/techforum/post.aspx?PostID=37