The composite figure can be broken down into three cuboids as shown in the figure below.
The first cuboid consists of 12 small cubes. The second and third cuboids consist of 9 and 2 small cubes respectively. So, there are 23 small cubes in the composite figure in total.
Now, each small cube has a side of length 2 cm.
Volume of each small cube =2×2×2=8cm3