Bloomberg LP Interview Question for Software Engineer / Developers






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

60 minutes only. As at 59 minutes it will be half filled , so the period of replicating is 1 minute (it can't replicate before that-- similar to 9 month human cycle) so there can;t be any time between 59 and 60. Jar will never be 75% . It will become 100% at 60 minute itself

- Tarun July 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

Question: does that mean that one fly produces two of the same flies after a minute, or that one fly produces another fly after a minute? Does each fly that is produced reproduce?

Assuming that one fly produces another after a minute:
t[n]=total number of flies in the jar after n minutes
t[0]=1
t[1]=2
t[2]=4
..
t[60]=2^60 (when the Jar is 100% full)
t[n]=2^n

The Jar is 75% full when there are 3/4*2^60 flies. 2^n=3/4*2^60 => n ~ 59.584
But n is an integer. In the stage of reproducing, it is possible that a fly will increase in size gradually. Therefore the 75% capacity is achieved somewhere in between 59-60 minute.

- Anonymous July 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I loved your technical approach and answers the question beyond doubt!

- Rakesh July 19, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I got the exact same answer!!!

- Ani March 05, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

very nicely described! thx! :)

- Anonymous June 28, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

wt a procedural approach... awesome..

- PKT September 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
2
of 2 vote

at 45 minutes jar will be 75% filled. As there is only 1 fly who is replicating...

- Anonymous July 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

u r right..

- xclamation July 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

59min 35seconds?

- Zaphod July 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

A fly => a chunk of self replicating mysterious material

A fly that replicates at 1:2 (One fly becoming 2} => some material take one minute for its volume doubled.
If the jar is filled(100%) in 60 Mins.
At what time it will be filled with 75%.

- Zaphod July 15, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

what type of question is this?
when every minute the number of flies are getting doubled, How come you gonna have 75% filled jar....

- Anonymous July 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It will be 60 min as rightly said by Tarun

- DashDash July 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

correct answer is given by "anonymous on july 16th,2010"

- Ran July 29, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

From anonymous comment on July 16th,
The Jar is 75% full when there are 3/4*2^60 flies. 2^n=3/4*2^60
this is also equal to 3* 2^58 = (2+1) * 2 ^58 = 2^59 + 2^58.
It reaches to 2^59 in 59 mins.
now for it to double it takes 1 minute which means from 2^59 to 2^60 (which is 2^59 for 1 min).
If it takes 1 min for producing 2^59, how much time it will take to become 2^58?
2^58/2^59 = 1/2 min
So total time would be 59.5 mins...

correct me if I am wrong...

- subbu October 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

As every minute passes, the number of flies doubles. If 100% was filled in time "x", then at time "x-1" minutes, there would have only been 50% of the flies. Considering that the flies just pop out after replication at the end of a minute, I think 75% is never really observed

- anon October 24, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yep. Anonymous on 16th July is correct. It follows exponential growth - x(t) = a.b^t/T
a = initial condn. = 1 fly
b = rate of growth = 2 (since it doubles)
T = time it takes from a to b = 1 min.
t = time to reach x(t)
First find 100% for t = 60mins and then solve for 75% with t unknown.

- Sid November 26, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

60 minutes.......... at 59th minute, its 50% full, at 60th minute, its 100% full....

- Anonymous February 11, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let n be the number of minutes the fly replicates.

In 60 minutes, the jar is full and the total number of flies will be 2 ^ 0 + 2 ^ 1 + .. + 2 ^ n = 2 ^ (n + 1) - 1 where n = 60.

When the jar is 3/4 full after m minutes, the number of of flies is 3/4 * [2 ^ (n + 1) - 1].

We need to find m such that 2 ^ (m + 1) - 1 = 3/4 * [2 ^ (n + 1) - 1] where n = 60

Take a logarithm of base 2 of both sides and simplifies

m + 3 = log3 + (n + 1) => m = 60 + 1 - 3 + log3 = 58 + 1.58 = 59.58 minutes, approximately 59 minutes and 35 seconds

- Hai Nguyen April 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Since fly get double every minute that means if Jar get full in 60 mins it was half full at 59 mins i.e. 50% full, now for the last minute remaining 50% of jar will get full. So it'll take 59.5 mins to fill 25% more of it as 1 min fill it completely.

- cliff March 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It will be 60 minutes. In 59 minutes the jar is 50% filled . since it takes 1 minute to replicate it will be (both 75% and 100%) filled in 60th minute

- Anonymous May 26, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

2^t = 75% × 2^60
t = 58 + log3

- Zheng Gao September 06, 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