In this talk, I will describe techniques for recognizing the high-level algorithmic idea of a program and its applications in feedback generation for introductory programming education. Both techniques are based on dynamic program analysis, in particular on execution trace analysis and constraint solving. The first technique is semi-automated and is aimed at finding performance problems in programs. The second technique uses a large corpus of correct programs, which are then clustered based on syntactic and execution trace criteria, and then used to repair incorrect programs. I will also discuss how some of these analysis techniques can be fully automated and may be applied to some other program analysis domains.