Google Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: In-Person
Think of it is a binary tree, interest is 100%, means every dollar becomes double, so essentially answer is height of binary tree where number of leaves is 15 billion.
this cannot be a interview question. It's middle school math. Too easy, not much knowledge involved
What could this interview question possibly reveal about a SDE candidate? It has nothing to do with computer science. If it's a real question, that interviewer should cease and desist being involved in interview loops.
The question is incomplete. The answers would differ for a simple interest vs compound interest.
100% interest rate means that the amount that you have in the bank doubles after each year: $1 at the beginning, 2 * $1 after one year, 2 * 2 * $1 after two years, ..., 2^n * $1 after n years = 15B . Therefore log_2(15B) = n.
- Julian January 29, 2014