LinkedIn Interview Question

How many cubes are exposed in a Rubik's cube?

Interview Answers

Anonymous

Jan 15, 2011

rubik's cube consists of 3^3 = 27 cubes, and only one of them (central) is not exposed. the answer is 26. the less elegant way of counting would be to notice that 9 cubes are visible on each of 6 sides, but 12 of them on edges are counted twice (one extra) and 8 of them on vertices are counted 3 times (2 extra). Do the math: 9*6 - 12 - 8*2 = 26.

2

Anonymous

Feb 12, 2011

s important to be able to generalize this to higher dimensions as well.

1

Anonymous

Sep 15, 2012

(n^i - (n-2)^i) for i dimensional hypercubes it becomes hard to visualize for dimensions more than 3, but checkout the case with 4 dimensions and you will understand...

1