Data's more than a walking calculator. For one thing, even if the first Pulaski test against Moriarty wasn't finished, all but one person thought he'd win, and he definitely won the second time around in the Ship in a Bottle episode. He figured out Moriarty's plan and turned it around on him. Furthermore, both times he was effectively in command of a ship he performed excellently, once relying completely on intuition. When he was alone or isolated he also handled himself well. The whole premise of the character is that he's a mimic of human behavior, so he's got access to a shit-ton of observed behavior to draw on. While I suppose he might have been less capable when he was actually in the academy, at the time we're seeing him he'd have been the all-time magna cul lauda.
As for the Kobayashi Maru, I believe they were under orders not to discuss it for that very reason. It's also possible that they changed the ship, or even the test around at random. I imagine a bridge officer in training takes all kinds of similar tests, so even if you knew that one of them was impossible to pass, schoolyard gossip and such, you wouldn't know when or where it would happen.
The only ST book I ever read was Kobayashi Maru, where six of them are stuck in a shuttlecraft for days and they all recount their experiences. Amusing read. The winner in the whole deal was Sulu, who decided that they shouldn't be in the neutral zone anyway, so fuck'em!