What do you think about tricky questions on interviews?
By that I mean questions that you wouldn't be able without reading Java Puzzlers: Traps, Pitfalls, and Corner Cases (or similiar) first.
I find those questions unnecessary and stressful.
Either you saw the trick before and you know the answer right away or you haven't seen the trick before and you won't be able to figure out the solution within one minute or two.
I am personally not a fan of tricky interview questions because of the same reasons you mentioned - they don't mirror problems you face in the real world, and I would be suspicious of anyone that knew the answer because it likely meant that they heard it before, rather than knew how to understand it. It simply isn't normal for someone to be able to spit out a tricky answer to a problem they've never heard. In real life, I wouldn't trust the solution!
However, some interviewers still ask these types of questions. When I was interviewing for my first job, after all the technical questions they asked me how many pennies would stack up to the empire state building. I had heard it before so I went through the motions of how many pennies per inch, per foot, per floor ect. Then they asked me another question about ferrying weighted people across a lake with a canoe.. something I hadn't heard before. I did my best to talk out loud and come up with a solution. It turns out my solution wasn't the best one, but it was obvious that they didn't care. They were more interested in me attempting the problem than actually solving the problem.
So, treat these types of questions not as tricks but rather as probes to see how you approach problems. The worst thing you can do is sit silently. Talk out loud, ask questions, spitball ideas, this is how problems are solved in real life. If you are solid on the fundamentals, I would have a hard time letting a trick question hold much weight.