Longest period without sleep was before my Contracts exam in law school. It was a full-year course, and I had wildly underestimated how much time it would take to get through all the material, since it had been so many years since I'd actually had an exam on material that spanned a whole year of classes. (I think that even in high school, none of our regular exams covered more than a semester's worth of classes.) Plus, the entire grade for the course depended on that one exam, no quizzes along the way or class participation factor to figure in. I did get a B on the exam, which was about as good as I could have expected, given my miscalculation. I had specifically underestimated how material learned back in September and October would require more study and relearning, given that it was the following May already.