Every man in a village of 100 married couples has cheated on his wife…
The cheating husband problem is a classic recursion pb.
Once all the wives know there are at least 1 cheating husband, we can understand the process recursively. Let's assume that there is only 1 cheating husband. Then his wife doesn't see anybody cheating, so she knows he cheats, and she will kill him that very day. If there are 2 cheating husband, their wives know of one cheating husband, and must wait one day before concluding that their own husbands cheat (since no husband got killed the day of the announcement).
So with 100 cheating husbands, all life is good until 99 days later, when the 100 wives wives kill their unfaithful husband all on the same day.
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)?
Four people need to cross a rickety rope bridge to get back to their camp at night…
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!)
What is the probability of breaking a stick into 3 pieces and forming a triangle?
There's a latency problem in South Africa. Diagnose it.
What's 2 to the power of 64?
https://answers.yahoo.com/question/index?qid=1006041003840
You can do this without a calculator when noting that 2^10 is approximately 1024 = 10^3. An error of 2.4%
Therefore 2^64 = 2^4 x 2^60 = 16 x 10^18. Approximately.
To account for the error multiply this by 1.024 ^ 6 =1.15 and
you get 18.4 x 10^18.
How long it would take to sort 1 trillion numbers? Come up with a good estimate.
O(1,000,000,000,000 Log 1,000,000,000,000) - Average Case Scenario
I'd guess you can do 1 billion operations per second, thus 3000 seconds.
How many resumes does Google receive each year for software engineering?
Google hired about 3,400 people in 2008. Figure 75%, or 2,550, of those hired were engineers and that, like Harvard, Google only accepted 3% of those who applied. 2,550 is 3% of 85,000
You are given a list of numbers…
When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum # in this list. Find any given # in the list. The numbers in the list are always increasing but you don’t know where the circular list begins, ie: 38, 40, 55, 89, 6, 13, 20, 23, 36.
Create temporary pointer and start from the root. (Most of the time circular lists have a front and back pointers.) Check if front is larger or if back is larger. If front is larger then you know you are at the end of the list and at the front of the list. If front is larger then traverse the opposite direction and compare numbers. If there is no root or a pointer pointing to any part of the list then your data is lost in memory.
Read full article from Answers To 15 More Google Interview Questions That Will Make You Feel Stupid - Business Insider
The cheating husband problem is a classic recursion pb.
Once all the wives know there are at least 1 cheating husband, we can understand the process recursively. Let's assume that there is only 1 cheating husband. Then his wife doesn't see anybody cheating, so she knows he cheats, and she will kill him that very day. If there are 2 cheating husband, their wives know of one cheating husband, and must wait one day before concluding that their own husbands cheat (since no husband got killed the day of the announcement).
So with 100 cheating husbands, all life is good until 99 days later, when the 100 wives wives kill their unfaithful husband all on the same day.
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)?
Four people need to cross a rickety rope bridge to get back to their camp at night…
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!)
What is the probability of breaking a stick into 3 pieces and forming a triangle?
There's a latency problem in South Africa. Diagnose it.
What's 2 to the power of 64?
https://answers.yahoo.com/question/index?qid=1006041003840
You can do this without a calculator when noting that 2^10 is approximately 1024 = 10^3. An error of 2.4%
Therefore 2^64 = 2^4 x 2^60 = 16 x 10^18. Approximately.
To account for the error multiply this by 1.024 ^ 6 =1.15 and
you get 18.4 x 10^18.
How long it would take to sort 1 trillion numbers? Come up with a good estimate.
O(1,000,000,000,000 Log 1,000,000,000,000) - Average Case Scenario
I'd guess you can do 1 billion operations per second, thus 3000 seconds.
How many resumes does Google receive each year for software engineering?
Google hired about 3,400 people in 2008. Figure 75%, or 2,550, of those hired were engineers and that, like Harvard, Google only accepted 3% of those who applied. 2,550 is 3% of 85,000
You are given a list of numbers…
When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum # in this list. Find any given # in the list. The numbers in the list are always increasing but you don’t know where the circular list begins, ie: 38, 40, 55, 89, 6, 13, 20, 23, 36.
Create temporary pointer and start from the root. (Most of the time circular lists have a front and back pointers.) Check if front is larger or if back is larger. If front is larger then you know you are at the end of the list and at the front of the list. If front is larger then traverse the opposite direction and compare numbers. If there is no root or a pointer pointing to any part of the list then your data is lost in memory.
Read full article from Answers To 15 More Google Interview Questions That Will Make You Feel Stupid - Business Insider