Barclays Capital Interview Question
Software Engineer / DevelopersTotal cubes along each x, y, z directions those are not appearing on surface are 8, 8, 8.
Therefore total cubes which are not shown on any surface = 8*8*8 = 512
Therefore total number of cubes on surface = 1000-512 = 488
OR Look at it from a different way
Create 10 small cubes on each side
Use surface area (i.e. 100 x 6 ) which is WRONG
Take the inner 8x8 surface area thats 64 small cubes x 6 faces thats 384 (non-connected CUBES).
then take sides covering 2 faces each (8x4x3) = 96
Then you take the edges (As with rubiks cube solution) at top left, BL, TR, BR x 2 = 8 more cubes.
Result is 384+ 96 + 8 = 488 ,
alternaively, the easiest way is obviously 1000-512 = 488
think it this way...if you've a cube of 3*3 thn when u remove everything from the surface you'll be remained with only 1 cube which is (3-2)*(3-2) in dimension...which means only 1 cube....similarly if u've a cube of 4*4 thn you'll remain with 2*2 inside because removing from the surface will end up removing 2 edges of cube everywhere.....then let's solve this problem like 10*10*10 then inside cube will be 8*8*8...then the cube at the surface will be 10*10*10-8*8*8=488...which is the answer....
think it this way...if you've a cube of 3*3*3 thn when u remove everything from the surface you'll be remained with only 1 cube which is (3-2)*(3-2)*(3-2) in dimension...which means only 1 cube....similarly if u've a cube of 4*4 thn you'll remain with 2*2*2 inside because removing from the surface will end up removing 2 edges of cube everywhere.....then let's solve this problem like 10*10*10 then inside cube will be 8*8*8...then the cube at the surface will be 10*10*10-8*8*8=488...which is the answer....
My Answer is 480.
First count cube in front and back end..as the side is 10,then both side will have 100*2=200 cube
Now comes to left and right side of the cube.Here we need to left 20 cube from each side, as this cubes are already used in front and back end side. So total cube in left and right side = 80*2 = 160
Now comes to top and bottom side, here we need to left 40 cube from each side, as these are already used by other sides, so total no of cubes in top and bottom = 60*2
No total no cubes in surface = 200+160+120=480
Always Draw a small diagram to solve Geometrical problems :)
488! sexy!
- nagabhushana.s July 03, 2010