Preparing for interviews is a waste of time. If you did not answer some question even after you came home and had enough time to think and read on the topic, perhaps it means that you are not qualified to the job. And no, you don't want to go for the interview if you are not qualified.
Don't get me wrong. I don't say that you should be able to answer each and every question. 1) in many cases, "I cannot suggest anything right now" or even "I don't know" would be an acceptable or decent answer; 2) some interview questions are plain stupid. The question you quoted can be considered reasonable enough for certain roles of developers.
See also my past answer where I give some more interview advice: SSRS interview questions and answers