A cube is a 3-dimensional diagram with all sides equal.  If we divide it into the size (1n)th   part of its side, we get n3 smaller cubes. 
Shown below is a cube which is painted on all the sides and the cut into (14)th of its original side. 

cube corners edges faces

Some observations: A cube has 6 faces, 12 edges and 8 corners. We can see that the cubes which got all the three sides painting lies at the corners. So the number of cubes which got painted all the three sides is equal to 8. Cubes with 2 sides painting lie on the edges (see the diagram). But the cubes which are on the left and right side of the edge matches with the corners. So we have to substract these two cubes from the number of cubes lying on the edge to get the number of cubes with 2 sides painting. Cubes with 1 side painting lies on the surfaces. Since, the top row, bottom row, left column, and right column matches with the edges, We must exclude these cubes while calculating the single side painted cubes.
The following rules may be helpful: If a cube is divided into the size $\left( {\displaystyle\frac{{\rm{1}}}{{\rm{n}}}} \right)^{{\rm{th}}} $ of its original side after get painted all the sides, Then

Total number of cubes = ${\rm{n}}^3 $
Cubes with 3 sides painting = 8
Cubes with 2 sides painting = $12 \times (n - 2)$
Cubes with 1 sied painting = ${\rm{6 \times (n - 2)}}^{\rm{2}} $
Cubes with no painting = ${\rm{(n - 2)}}^{\rm{3}} $

Solved Examples (Level - 1)

1. A cube whose two adjacent faces are colored is cut into 64 identical small cubes. How many of these small cubes are not coloured at all?
Assume the top face of the cube and its right side are colored green and orange respectively.

cube adjacent faces colored

Now If we remove the colored faces, we left with a cuboid, whose front face is indicated with dots. 

cube adjacent face colored solution

So on the front face there are 9 cubes, and behind it lies 4 stacks.  So total 9 x 4 = 36

2. A cube, painted yellow on all-faces is cut into 27 small cubes of equal size. How many small cubes got no painting?

cube painted yellow

Assume we have taken out the front 9 cubes.  Then the cube looks like the one below.

cube painted yellow solution

Now the cube which is in the middle has not got any painting.  The cubes on the Top row, bottom row, left column and right column all got painting on atleast one face.
Alternative method:
Use formula: ${\rm{(n - 2)}}^{\rm{3}} $  Here n = 3 So ${\rm{(3 - 2)}}^3 $ = 1

3.  All surfaces of a cube are colored. If a number of smaller cubes are taken out from it, each side 1/4 the size of the original cube's side, Find the number of cubes with only one side painted.

cube problems

The original (colored) cube is divided into 64 smaller cubes as shown in the figure.  The four central cubes on each face of the larger cube, have only one side painted.  Since, there are six faces, therefore total number of such cubes = 4 x 6 = 24.

Alternative Method: 
Use formula : ${\rm{6 \times (n - 2)}}^{\rm{2}} $ = ${\rm{6}} \times {\rm{(4 - 2)}}^2 $ = 24

Level - 2

4. Directions: One hundred and twenty-five cubes of the same size are arranged in the form of a cube on a table. Then a column of five cubes is removed from each of the four corners. All the exposed faces of the rest of the solid (except the face touching the table) are coloured red. Now, answer these questions based on the above statement:
(1) How many small cubes are there in the solid after the removal of the columns?
(2) How many cubes do not have any coloured face?
(3) How many cubes have only one red face each?
(4) How many cubes have two coloured faces each?
(5) How many cubes have more than 3 coloured faces each?
The following figure shows the arrangement of 125 cubes to form a single cube followed by the removal of 4 columns of five cubes each.

cube on table cut into small cubes

When the corner columns of the original cube are removed , and the resulting block is coloured on all the exposed faces (except the base) then we get the right hand side diagram.  We labelled the various columns from a to u as shown in the figure
(1): Since out of 125 total number of cubes, we removed 4 columns of 5 cubes each, the remaining number of cubes = 125 - (4 x 5) = 125 - 20 = 105.
(2): Cubes with no painting lie in the middle.  So cubes which are blow the cubes named as s, t, u, p, q, r, m, n, o got no painting.    Since there are 4 rown below the top layer, total cubes with no painting are (9 x 4) = 36.
(3): There are 9 cubes namaed as m, n, o, p, q, r, s, t and u in layer 1, and 4 cubes (in columns b, e, h and k) in each of the layers 2, 3, 4 and 5 got  one red face. Thus, there are 9 + (4 x 4) = 25 cuebs.
(4)  the columns (a, c, d, f, g, i, j, l) each got 4 cubes in the layers 2, 3, 4, 5.  Also in the layer 1, h, k, b, e cubes got 2 faces coloured.  so total cubes are 32 + 4 = 36
(5): There is no cube in the block having more than three coloured faces. There are 8 cubes (in the columns a, c, d, f, g, i, j and l) in layer 1 which have 3 coloured faces. Thus, there are 8 such cubes.
Thus, there are 8 such cubes.

5.  Directions: A cube of side 10 cm is coloured red with a 2 cm wide green strip along all the sides on all the faces. The cube is cut into 125 smaller cubes of equal size. Answer the following questions based on this statement:
(1) How many cubes have three green faces each?
(2) How many cubes have one face red and an adjacent face green?
(3) How many cubes have at least one face coloured?
(4) How many cubes have at least two green faces each?
Clearly, upon colouring the cube as stated and then cutting it into 125 smaller cubes of equal size we get a stack of cubes as shown in the following figure.

cube painted green strip

The figure can be analysed by assuming the stack to be composed of 5 horizontal layers.
(1): All the corner cubes are painted green.  So there are 8 cubes with 3 sides painted green.
(2): There is no cube having one face red and an adjacent face green as all the green painted cubes got paint on atleast 2 faces.
(3): Let us calculate the number of cubes with no painting.  By formula,  $\left( {{\rm{n - 2}}} \right)^{\rm{3}} $ = $\left( {{\rm{5 - 2}}} \right)^{\rm{3}} $ =  27
Therefore, there are 125 - 27 = 98 cubes having at least one face coloured.
(4): From the total cubes, Let us substract the cubes with red painting, cubes with no painting. 
125 - (9 x 6) - 27 = 44