Google and Facebook long ago stopped asking (or at least now they discourage their interviewers from asking) puzzle-like questions in their SWE interviews.
Easy for me to say, since I find problems like those easy; I cranked through a few dozen of them with only having to really think about a couple.
If you can't answer them all yet...well, now you have something specific to study.
[1] http://www.amazon.com/Cracking-Coding-Interview-Programming-...