In The Order of the Phoenix, there's this conversation between Harry and Professor McGonagall at the end of the twelfth chapter.
"Didn't you listen to Dolores Umbridge's speech at the start-of-term feast, Potter?"
"Yeah," said Harry. "Yeah... she said... progress will be prohibited or... well, it meant that... that the Ministry of Magic is trying to interfere at Hogwarts."
Professor McGonagall eyed him for a moment, then sniffed, walked around her desk, and held open the door for him.
"Well, I'm glad you listen to Hermione Granger at any rate."
Did some of you notice that the professor is talking about Hermione, when she can't possibly know the talk between Harry, Ron, and Hermione at the feast? When they were talking about it, they were sitting at the Gryffindor table, weren't they? Professor McGonagall was sitting at the professor's table, which is far away from them and it's really impossible to hear student's conversations. Well, I wonder how she knows. The professors really couldn't be spying on students, could they?