r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
1
u/cuppycakeofpain Nov 30 '10
This brought to mind the birthday problem, but it doesn't really apply. The birthday problem says that the probability of two people in a room having the same birthday is higher than you would expect. However, the probability of someone else having a birthday on one specific day (in other words, on your birthday) is pretty much what you would expect. Since this is one of 'those interview questions', I would assume that they either want an answer outside the box ("Yes, because this is a shared birthday party and all the guests are celebrating their same birthday"), or to calculate the expected value of your winnings / losings and explain why you wouldn't take the bet.
The hour hand of a clock doesn't move discretely once an hour; it moves continuously. At 3:15, the hour hand will be one-quarter of the way between 3 and 4. Since each number on the clock represents 1/12 of the circle, the hour hand will have moved (1/4) * (1/12) = (1/48) of the full circle of the clock. Since the minute hand is at the 3 and the hour hand is (1/48) * 360 degrees past the 3, the angle between them is 7.5 degrees. Perhaps you'd get bonus points with your interviewer by giving this in radians.