We report the effect of shock on transition metal carbides and nitrides. Shock induced B1-B2B1-B2 transition in these compounds was studied. Comparison with experimental shock data indicated that the transition may not occur. We found that the compounds melt at very high pressures induced by shock. Correlation between ultimate tensile strengths and bulk moduli of compounds was obtained. Behavior under extreme conditions is important for developing further applications.