Thursday, September 27, 2007

Well, we all have recieved those email forwards about Google employees and the kind of freedom they enjoy at their office.

Wonder what it takes to work @ Google ???

A nerdy computer-aholic degree from Stanford is just not enough. Google actually expects its employs to be smart too.

Here is a sample set of questions that were asked in a Google interview. It is very probable that these questions were asked to a candidate applying for the post of a Software Engineer(in which case Smart-Ass replys may not work).




I make a humble attempt to answer these questions, which however does not imply that this is how I would have answered these questions in the interview. I tried to time limit myself to a around 2-3 mins per question.

---------------------------------------------------------------------------------------------
1. How many golf balls can fit in a school bus?

----------------------------------------------------------------------------------------------

1. The answer is not (Volume of bus)/(Volume of the ball.)Assuming the bus to be a hollow cuboid the answer is (l*b*h)/(d*d*d)l,b,h are the greatest integral multiple of d lesser than length, breadth and height resp.d is the diameter of the ball.

----------------------------------------------------------------------------------------------

2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?
----------------------------------------------------------------------------------------------


I'd hold the centre of the blade with all my might.


----------------------------------------------------------------------------------------------
3. How much should you charge to wash all the windows in Seattle?
----------------------------------------------------------------------------------------------

I dont know. Probably, one dollar per window. Or I d take a monthly salary for the task.


----------------------------------------------------------------------------------------------
4. How would you find out if a machine’s stack grows up or down in memory?
----------------------------------------------------------------------------------------------


Declare an array and compare the memory address of any 2 positions.

----------------------------------------------------------------------------------------------
5. Explain a database in three sentences to your eight-year-old nephew.
----------------------------------------------------------------------------------------------

It is a record of data.
Data could be any information.
Eg. School students record etc...


----------------------------------------------------------------------------------------------
6. How many times a day does a clock’s hands overlap?

----------------------------------------------------------------------------------------------

22


----------------------------------------------------------------------------------------------
7. You have to get from point A to point B. You don’t know if you can get there.

What would you do?
----------------------------------------------------------------------------------------------

Assuming no other extra factors. I would just move in any direction and incase I do not reach there I d trace back and look-in someother direction.

----------------------------------------------------------------------------------------------
8. Imagine you have a closet full of shirts. It’s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?

----------------------------------------------------------------------------------------------

Firstly, it is necessary to find out why is th retrival tough. Is it because they are not organised logically or rather because they are physically placed in an unreachable corner.Both the cases will have different solutions.


----------------------------------------------------------------------------------------------
9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?

----------------------------------------------------------------------------------------------

Ahh, this is one question any Comp engg can answer.

----------------------------------------------------------------------------------------------
10. In a country in which people only want boys, every family continues to have children until they have a boy. if they have a girl, they have another child. if they have a boy, they stop. what is the proportion of boys to girls in the country?

----------------------------------------------------------------------------------------------

1:1. Because, the probability of a boy being born to a girl being born is 1:1.


----------------------------------------------------------------------------------------------
11. If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)?


----------------------------------------------------------------------------------------------



----------------------------------------------------------------------------------------------
12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)


----------------------------------------------------------------------------------------------


7.5 degree




----------------------------------------------------------------------------------------------
13. Four people need to cross a rickety rope bridge to get back to their camp at
night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it's only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?
----------------------------------------------------------------------------------------------



- The underlined people cross over to the other side.

Side 1 Side 2 Time consumed

1,2,5,10 -- 2
5,10 1,2 1
1,5, 10 2 5
1 2,5,10 2
1,2 5,10 2
-- 1,2,5,10 ----

Total time consumed=12 min.

----------------------------------------------------------------------------------------------
14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

----------------------------------------------------------------------------------------------


No.

----------------------------------------------------------------------------------------------
15. How many piano tuners are there in the entire world?

----------------------------------------------------------------------------------------------

:-?



















:-?



dont know

----------------------------------------------------------------------------------------------
16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?

----------------------------------------------------------------------------------------------

Divide the balls into 3 groups of 3balls,3balls and 2 balls.

Compare the 2 set of 3 balls.

1. Their weights are not same.
Take the heavier set and then compare any 2 balls. If they dont weigh the same youve got they heavier ball else the remaining 3rd ball is the heavier one.

2. Their weights are same.
Weigh the remaining 2 balls and get the heavier one.



----------------------------------------------------------------------------------------------
17. You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.)

----------------------------------------------------------------------------------------------

This is a tough one. I took over 10 mins to solve this one. In all probablity I would not crack this in the interview.

5 comments:

Dr. Ramprekash Varma, M.D. said...

Hi,
My name is Dr. Ramprekash. I like your site and would like to make a link exchange, if you wish so, please visit my site http://my-acupressure.blogspot.com and at the left sidebar my site code paste in your site.Then please mail me to sree1280@yahoo.com i will put your site link in my site which helps us to get good page rank for our sites.my site has google rank 4. Thank You

Nithya N said...

that was a very useful post. by the way what happens when the queen announces?

zen babu said...

Aman,

Ans 1. wrong. The golf balls in bus is the classic question of sphere packing (remember solid state chemistry from 12th standard? ). The best space utilizatoin that you can get is the hexagonal arrangement, with a utilization of 0.64. Hence, its 0.64 * volume of bus/ volume of golf ball.

Ans 8. Good answer. totally cracked.

Ans 9. Principle of mathematical induction and all that jazz. ;)

Ans 10. one can adopt a longer method to solve this question, and it still comes out to be a 1:1. I'n wondering if this has any implications about the frequentist interpretation of probability.

And 11. The only true math challenge in the set. if p is the probability that we want to find, then the probablity that i dont see a car in 10 minutes is 1-p, and hence the probability that i dont see a car in 30 minutes is (1-p)^3. So, 1-(1-p)^3 = 0.95. Or, p = 1 - (1-0.95)^(1/3) = about 64%.

And 15. The famous guesstimate questions. Estiamte the number of pianos, assume a reasonable number of tuners and piano and find it out. How does one estimate the number of pianos - well reasonable assumptios again. x no. o music clubs with y no. of pianos each. upper income old money segment has z no of households and assuming they all have grand pians each, etc. Here, they dont want an answer. Only, how you think.

ans 17. How did you solve this one? I still dont even get the question properly. Isn't some random assumption about the nature of human beings required for this one?

Blogger Bhaiyya said...

@nithya:
When the queen announces some man cheated...

The lady who is not aware that some man has cheated would kill her husband.


It kind of a reverse logic..

@ Ritwik,

1: Right.

9: Love these type of ques. remember the colored horses?

15 : similar to Q2 random guess..

17: This is one of those: work the other way around questions.. like the Jailers paradox..


if there were just 2 people left then No 5 gets all the gold or No4 dies..

Incase No 3 has to decide who gets the coins.... blah blah..
(abhi to lazy to type..)

So No 1 gets 98 coins..

Blogger Bhaiyya said...

17 : This is how it works.

The pirate answer has to be worked backwards.
* If there is 1 pirate left, he will get all of the gold.
* If there are 2 pirates left, #2 will keep all of the gold and #1 will get none.
* If there are 3 left, #3 will give #1 a coin and keep 99 for himself. This is the best deal that #1 can get - if he votes against it then #2 will get all the money.
* If there are 4 left, #4 will give #2 1 coin. Since we know what will happen if there are 3 left, this is the best that #2 can get.
* If all 5 are left, #5 will give 1 coin to #1 and #2. #1 will vote for it because he will get nothing otherwise. #2 will get the same thing anyway, so he’ll vote for it as well. #5 keeps 98 coins.

Post a Comment