## Bank of America Interview Question for Software Engineer / Developers

• 0

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
5
of 7 vote

Well when the rock was on boat the amount of water displayed by it was equal to the volume of water equal to rocks mass (Archimedes Principle). When the rock sinked to the bottom the amount of water displayed by it was equivalent to the volume of the rock.

Comment hidden because of low score. Click to expand.
0

yes, and that would imply the level of water will decrese, since the volume of rock will be less than the volume of water equivalent to that weight to the rock.

Comment hidden because of low score. Click to expand.
0

Such a foolish answer !!!

Comment hidden because of low score. Click to expand.
0

This answer should be correct. And we should point out the density of the rock decide the level of the water.
If the rock is a floatstone which density is less than water. the level will increase.
If the densities are equal, level will not change.
Else, like perlscar said.

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

The problem states that the stone sank. Therefore, the density of the stone is greater than the density of the water. Yes?

Comment hidden because of low score. Click to expand.
1
of 3 vote

The level of the water should be lower compared to L1, the reasons are explained as following:

case (I), boat + rock are in an equlibrium state which means: floating force generated by water == gravitational force of the boat+rock, in physics language
rho * Volume_water * g = (m_rock + m_boat) *g

case (II), boat is still in an equilibrium state (floating force== gravitational force) however the rock must go to the bottom of the water as it has much larger density (floating force << gravitational force)
so rho * Volume_water * g << (m_rock+m_boat) *g

to conclude, Volume_water_1 > Volume_water_2
so, water_level_2 < water_level_1

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

answer will be l1 - [(m/1000 - v)[/A where m = mass of rock, v = volume of rock, A = surface area of water (considering uniform) 1000 = density of water

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

water level will surely go down....
You can prove it by writing equation of buoyancy force in both situation..

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

The level of water will go down for sure.

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

well i meant displaced

Comment hidden because of low score. Click to expand.
0

water level will be L1 why because when we lift the stone then water level will increase and when you throw stone in water then water will come to its original shape.

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

Is not it the level of the water ON THE BOAT ? Waterline ?

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

imagine a swimming pool. measure the water line on the side of the pool. L(0). now, drop a very big rock into that pool. That rock will displace water equal to its volume - effectively, pushing that water 'up' e.g. the water line will rise to L(1).

the rock sinks since the water displaced by the rock's volume is not enough to make it float

now - add a row boat and put the rock into the row boat. If the boat does not sink, the boat+rock is displacing *more water* than just the rock alone. Why? b/c the boat is floating the rock. Hence, the water line will be even higher - L(2).

L(2) - boat+rock water displacement is highest (since both rock and boat are floating); the water displaced produces a buoyant force enough to counteract gravitational pull on boat+rock.

L(1) - just the big rock, displacing its volume in water (but that's not enough to make it float)

L(0) - nothing in water; water line is at its lowest point on the side of the pool

Boat is a tool to displace enough water to counteract the force of gravity acting on the objects in the boat (and the boat itself).

A very heavy object would require a boat that displaced even more water - to create even more buoyant force - to counteract the naturally existing force of gravity acting on the object.

If the boat does not displace enough water to support the weight of the objects in it, the boat will naturally sink.

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

The level of water in in pool will remain same, the boat will be less dipped in water after throwing rock in water.
Explanation:
Initially volume of water displaced = Vi
volume of water displaced after rock is thrown = Va
density of water = dw
density of rock = dr

weight of boat = wb
weight of rock = wr

Vi = (wb + wr) / dw

Va = (wr/dr) + (wb/dw) = volume of rock + water displaced by boat

Assume no change in water level

Vi = Va
=> dw = dr

This means
if( dw < dr)
=> Vi < Va
=> The level of water will rise.

And
if( dw > dr)
=> Vi > Va
=> The level of water will fall.

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

Correct. Water level remain same.

Comment hidden because of low score. Click to expand.
-1
of 1 vote

Level of water will remain the same.

Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0

Well, that's what I said, but interviewer did not seem to agree though he did not give me an answer, so wondering if there is more to it.

Comment hidden because of low score. Click to expand.
0

Well Archimedes' principle has to do with the "weight of the liquid" and not so much with the volume displaced... but his famous "Eureka" story showed why the crown sunk in the bathtub... and that's the only explanation I can think of...

Comment hidden because of low score. Click to expand.
0

With the rock in the boat, the entire weight of the rock pushes the boat into the water. But when the rock is submerged, only its volume and not its weight is displaced. Since the rock is denser that water (presumably), then less water is displaced when the rock is submerged. The boat rises, and the water level falls.

Comment hidden because of low score. Click to expand.
0

Sounds reasonable to me.

Comment hidden because of low score. Click to expand.

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.

### 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.