We present a model predicting the effects of mechanical defects at layer interfaces on the contact stiffness measured by ultrasonic atomic force microscopy (AFM). Defects at subsurface interfaces result in changes at the local contact stiffness between the AFM tip and the sample. Surface impedance method is employed to model the imperfections and an iterative algorithm is used to calculate the AFM tip-surface contact stiffness. The sensitivity of AFM to voids or delaminations and disbonds is investigated for film-substrate combinations commonly used in microelectronic structures, and optimum defect depth for maximum sensitivity is defined. The effect of contact force and the tip properties on the defect sensitivity are considered. The results indicate that the ultrasonic AFM should be suitable for subsurface detection and its defect sensitivity can be enhanced by adjusting the applied force as well as by judicious choice of the AFM tip material and geometry.