This paper presents a solution for online composite sketchy shape recognition. The kernel of the strategy treats both stroke segmentation and sketch recognition as an optimization problem of “fitting to a template”. A nested recursive optimization process is then designed by means of dynamic programming to do stroke segmentation and symbol recognition cooperatively by minimizing the fitting errors between inputting patterns and templates. Experimental results prove the effectiveness of the proposed method.