I'm taking real analysis I, and my professor gives us a previous exam with solution each time before the midterm/exam. I would do the previous exam and check if I get it right. But it's obvious that my professor are not going to give us the same questions.
So, I also read and tried to understand the proofs that are given on the book. Sometimes, I proved the theorems and corollaries by myself. Besides, I would memorize the theorems and corollaries.
For courses like calculus, we have some general steps to solve a type of question. So it's easier to prepare for the exam. But for proof-based courses like real analysis, algebra and topology, etc, how can we know whether we're well-prepared for the exam? How did you study the materials and prepare for the exam when you were an undergraduate student? Exams are designed to test our understanding of the materials, but how can we test ourselves first?