He probably got a copy of the questions from media sources. You know how desperately they want him to win. They'll do anything for Obama.
The Wife and I have been discussing the possibility that Obama, possibly with the help of the moderator, will try and get McCain to lose his famous temper. According to some sources, Obama pushed things in the meeting with the President (but then they are also saying several people lost it in that meeting).