I would walk out of a job interview that asked brain teasers. It's not revealing of anything and tells the interviewers that either you've heard that piece of trivia before, or you got lucky and reasoned it out. And "we just want to see how you think" is evidence that the interviewers hadn't thought about how to actually determine what kind of an engineer you were.
The best interview I ever had was basically a small amount of spec work accompanied by a writeup of why I did what I did.