9. Akash's birthday cake is a $4 \times 4 \times 4$ cube, as shown in Figure 2. The top and four sides of the cake are frosted, but the bottom is not frosted. If the cake is cut into 64 $1 \times 1 \times 1$ small cubes, then the number of small cube pieces that have exactly two frosted faces is ( ).
(A) 12
(B) 16
(C) 18
(D) 20
(E) 24
9. D.

Notice that, for the small cubes that do not include the bottom face, the middle two blocks of each edge have exactly two faces frosted, and there are $12-4=8$ such edges. Thus, there are $8 \times 2=16$ small cubes that meet the requirement.

When the bottom face is included, the 4 corner small cubes meet the requirement.

Therefore, there are a total of $16+4=20$ small cake cubes that have exactly two faces frosted.