Yeah I had an interview like this recently. First part of the interview proceeded well as they asked me to read different bits of code and how different language features worked.
Then I was asked a brain teaser that I bombed. And that was the end of the interview.