gravatar

Blog # 36 : Facebook Interview Questions

Following are the interview questions asked by Facebook to one of the successful candidates Mr. Saket Jalan, CSE, IT-BHU as told by him :

Complete process was of 5 technical rounds and then 1 HR round:

Online Round Question

Given a dictionary consisting of n 3 letter words, with n<100. We need to compute all possible 3*3 grids such that 3 letter words lying on each row, each column and each diagonal is in dictionary. 

Interview Round 1:

write a code that prints the tree level wise. Then he asked to reduce space in cost of time.

Interview Round 2:

Given n distinct numbers from 1 to n. Write a code that prints all the k-element subsets. for eg: for n=4, k=2: (1,2), (1,3), (1,4), (2,3), (2,4), (3,4). Then I was asked to write the equation of its complexity. 

Interview Round 3:

It was elimination round, everyone was given below Q and had to write code within 45 minutes along with test cases.
Given a structure, with data members as string and number. A list consists of structure data, sorted in dictionary order by strings. Now, write a function, that takes a prefix, and returns all the numbers corresponding to the string that have this prefix in dictionary. Also write the test cases.
They judged it based upon coding style, time and space complexity.

Interview Round 4:

Last round. In a game a player can score either 2,3 or 7 runs. A player has just entered the ground and he sees "score" on the board. Write a program that returns number of ways in which this score can be obtained. eg: 10 can be obtained by (3+7), (7+3), (2+2+2+2+2), (2+2+3+3), (2+3+2+3), (2+3+3+2), (3+2+2+3), (3+2+3+2), (3+3+2+2)
Then he asked to reduce space complexity. 

HR:Usual Questions like why Facebook? why not other companies? and many things from CV.

Almost every interviewer asked about some of my projects from the CV. and yes STL was allowed except in round 3.
 
Enhanced by Zemanta

gravatar

Your means of telling everything in this article is really nice, every one can
easily understand it, Thanks a lot.
hardwood floors installation

Also visit my web blog ... refinishing hardwood floors
My website :: installing hardwood floors