I remember I had an all-day interview once that was very similar to the one described in the original question. It was at an IT Department at a big university. It was brutal and I almost left. They asked me all these ridiculous brain-teaser PHP questions I was expected to answer off the top of my head. I never got lunch. I thought I had just wasted a day, but they hired me anyway. Later I found out that kind of interview was required by the evil bureaucratic HR department and everyone hated having to do them.