Sleep deprivation affects many different things, some of which are salvageable with stimulants like caffeine, and certain functions are fairly unaffected. Exams that can be solved mostly with rote memorization are less impacted by sleep deprivation than exams that require spontaneous creativity. In any case, glad to know it went well for you!