Google Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
2
of 2 vote

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 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

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.

- Delta March 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Perfect answer.

- AlgoAlgae April 24, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

With 100% interest rate, money is doubling every year.

1, 2, 4, 8, ..... x

So x = 2^k
x = 15 billions

So 2^k = 15 billions
k = log(15 billions) -log with base 2

- confused_banda January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ln(15 billion) - ln(2)

- Engineer1111 January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

this cannot be a interview question. It's middle school math. Too easy, not much knowledge involved

- Anonymous January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Middle School Math? A Graduate From The Midvale School For The Gifted, Are You?

- Anonymous January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

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.

- Anonymous January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

That they can do basic math? How they think? Perhaps related to some project the candidate had on the resume?

- Anonymous January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let's say the principle amount is m and interest rate is r% and is calculated annually. so after n years the amount will be m*(1+ r/100)^n.
Here m=1 and r = 100 so the amount will be 1*(1+100/100)^n = 2^n.
given that 2^n = 15B. so n = ln(15B)
ln means log with base 2

- Ashok Rajpurohit January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

The question is incomplete. The answers would differ for a simple interest vs compound interest.

- Murali Mohan January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Where do banks pay simple interest?!

- javierturek January 30, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

log2 (x) = logy (x) / logy (2) use built in log

- glebstepanov1992 January 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

n=15b;
while(n!=1)
{
n=n/2;
}

- Anonymous January 31, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

n=15b;
year=0;
while(n!=1)
{
year++;
n=n/2;
}

- Anonymous January 31, 2014 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More