I believe Stanford only has 1 current course with enrollment on that level – CS 229, which is an advanced undergrad/beginning graduate class called Machine Learning. I suspect that the enrollment is so high because they are counting SCPD professionals who are taking the class remotely from their place of employment.
Among lower level undergrad classes, I believe the most popular one is CS 106a (Programming Methodology) in Java, which has 386 enrolled this quarter. You can also choose CS 106a in Javascript (only in Autumn) or Python, which have smaller enrollments. The class has 55 sections this quarter, suggesting ~7 persons per section, which are generally run by grad student TAs. Having this small sections gives the opportunity to get personalized attention and ask a lot of questions about the lecture, in spite of it being a class size of hundreds. However, you are unlikely to get a lot of personal interaction with the professor.
I’ve taken quite a few large classes like this at Stanford. The big lecture by a well known professor in the field followed by smaller section format with a grad student TA worked well for me. I had few questions and didn’t mind asking those questions to TAs. However, I can see how students who are trying to get to know professors might feel differently. There were generally more opportunities for getting to know professors in higher level within major classes, rather than big intro to … lectures. It was still possible to get to know professors in intro classes, but the few times that happened to me all related to doing something to stand out (in a positive way).