Interview Question
Software Engineer / Developersin a 3 X 3 X 3 rubiks cube , there are a total of 24 units [ 8 corner pieces , 4 centre pieces , and 12 edge pieces ] , there are 12 edge pieces = 4 pieces that have one face on the top and the other on the side + 4 pieces that have one face on the bottom and the other on the side + 4 pieces that have both faces on the sides.
If you rip all of these apart, there is nothing left !
And similarly , in a 10 X 10 X 10 rubiks cube there should be total of 548 units [
8 corner pieces [ 4 on top and 4 on the bottom], 64 edge pieces and 486 centre pieces. Thats a total of 548 pieces on the outer layer.
Typically if you break open this cube, nothing would remain. But for the sake of the question , lets assume that the 10 X 10 X 10 cube has been made of smaller such cubes. if the outer layer is removed = it should give 1000 - 548 = 452 pieces !!
its = 452 pieces for sure!
You should put Edge of cube length, Number of centermeter cubes total, number of cubes with three painted faces, number of cubes with two painted faces, number of cubes with one painted face, and number of cubes with zero painted faces. I think you should add all this information form 1x1x1 to 10x10x10 type of cubes.
the question is "how many cubes remain" - the answer is 512 ( ie 8*8*8) pieces. If the question was "how many cubes on the outer layer" then the answer would have been 10*10*10 - 8*8*8
- prep4Inter February 03, 2010