I remember once there was a question on Quora about an IIT BTech guy who had offers from all major web companies. Some one asked him how he did it. And his advice was that you had to simply 'practice'. Simply go out on the internet check for good interview forums work on it an hour every day. Even if you are actually a worthless programmer on the ground. You can pretty much ace any interview with simply practice.
This also reminds of my Math classes in pre-university college here in India. I would generally try to solve a problem in more than one way and show it to my lecturer. One day she scolded me badly, that my experiments might end up in me scoring less marks. Her point was the evaluators were used to seeing a certain pattern of answers over years. And if the student had a new innovative answer, they would simply mark it wrong because it didn't their 'one true' answer, even if the solution was more elegant and better than the common pattern. Therefore the only way of scoring high marks was to practice all the common patterns.
Rote learning works at all levels.
I remember some days back I watched a interview of RMS on youtube, and he was asked a question on how you could be a good programmer and what books you had to read. And he gave a straight reply- You had to simply work on some hard real world problems/projects and bring them to closure. That was his advice.
Too bad these days we check people on everything apart from their actual work.