The physics of the instability of flows around surface imperfections such as humps, dips, and forward- and backward-facing steps is investigated. The mean flow is calculated using interacting boundary layers, thereby accounting for strong viscous/inviscid interaction and separation bubbles. Then, the two- and three-dimensional linear and subharmonic instabilities of this flow are analyzed and the amplification factors (i.e., N-factors) are computed. The results of this approach have been validated by using Navier-Stokes solutions and the experimental results of Walker and Greening for bulges and Dovgal and Kozlov for steps. The effects of suction, heat transfer, and compressibility (Mach numbers up to 0.8) on the stability of these flows are investigated. The results show that although compressibility significantly reduces the amplification factor in the case of a smooth surface, this stabilizing effect decreases as the hump height increases. In the absence of separation, it is found that increasing the imperfection height results in an increase in the amplification factors of both the primary and subharmonic waves. In the case of separation, the amplification factors are considerably increased.