Google Interview Question
1,223 Interview Reviews |
Back to all Google Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at Google:
Give the descending order of the following 4 terms, assume that n is infinite. n!(n factorial), n^n, 2^n, n^(google)
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
2 of 2 people found this helpful
1. 2^n is a product of n twos
2. n! is also a product of n numbers which, except for one, are all >= 2. The largest is n.
3. n^n is also a product of n numbers, all of them equal to n
What about n^googol. Googol is a humonguos number (10^100). So n^G is a product of a humongous number of n's. But if n itself is much larger than googol than both n! and n^n beat it. The tricky one is 2^n. How much does 2^n increase when you increase n by 1? It doubles. How much does n^G increase? You have to divide (n +1)^G / n^G. The numerator is a binomial: n^G + (G 1)*n^(G-1) + ... 1. Division gives us 1 + (G 1)* n^(-1) + ... n^(-G). For large n the sum after 1 gets tinier and tinier (like 1/n), so in fact 2^n beats n^googol.
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
2 of 3 people found this helpful
by Interview Candidate: