This question is phrased incorrectly. I think you meant "4 units after 3 days". Which makes your answer wrong as well. This is not helpful at all.

View Allnum of num

Senior Systems Test Engineer Interview San Diego, CA

Qualcomm## There is a body of water that starts with 1 square unit

, and doubles in size every day (2 units after 2 days, 4 units after 4 days). It takes 100 days to fill up. How many days would it take to fill if you started with 2 square units?

Tags:

logic See More, See Less8

6 Answers

▲

2

▼

This question is phrased incorrectly. I think you meant "4 units after 3 days". Which makes your answer wrong as well. This is not helpful at all.

▲

0

▼

if you start with 1sq unit - lets say you end up with 'x' amount to fill up - takes 100 days

if you start with 2 sq unit - you will have to fill up '2x' amount thus it will take - 200 days.

▲

2

▼

Starting with 2 square units at time t=0 is like 1 square unit at t = 1. [this logic is the key to answering the question].

Now let's do the first few cases.

t = 0: size = 1+1 = 2

t = 1: size = 2(1+1) = 2+2 = 4 = f(2) in the 1 unit case.

Pretty easy to see it only requires 1 time period less from here. The OP was right.

▲

0

▼

1 day less that is 99 days.

▲

0

▼

It is still 100 days.

Starting from 2^0, and going all the way to 2^100, the reservoir has a capacity of 2^101 - 1 units.

Now in the second case, starting from 2^1, in 99 days there will be 2^101-2 units of water in the reservoir, which is one unit short of the capacity of the reservoir. So we need the 100th day to fill it up!

To comment on this, Sign In or Sign Up.

Would you like us to review something? Please describe the problem with this {0} and we will look into it.

Your feedback has been sent to the team and we'll look into it.

100 - 1 = 99 days