I was trying to think of a college or graduate level course I took that had random quizzes, and I couldn't think of any off the top of my head.
I remember there was one freshman level math class where you can drop off homework assignments and exams in the teacher's mailbox. I diligently completed every homework and exam, but didn't attend a single class. I knew most of the material already so I spent my time more productively elsewhere. To this day I don't even know what the professor looked like.