You don't even need to randomly select a question to do something like this.
In the past I was hired on the back of simply sitting down with the team lead, and us pair programming to implement what he happened to be working on at the time.
That gave a good idea of how quickly I could start contributing, how easy I was to communicate with, whether I was going to be a snob about the existing code, whether I have relevant pre-existing knowledge about the technologies being used and whether I had any interesting insights to offer. There was also a more standard interview process accompanying this (which I doubt I excelled at) but the pair programming excercise gave a real world insight into exactly what I had to offer and what I was like to work with.
I once saw a company that interviewed like this. The also paid the candidate for the afternoon. The thinking was if you are working on our codebase you should be compensated.
In the past I was hired on the back of simply sitting down with the team lead, and us pair programming to implement what he happened to be working on at the time.
That gave a good idea of how quickly I could start contributing, how easy I was to communicate with, whether I was going to be a snob about the existing code, whether I have relevant pre-existing knowledge about the technologies being used and whether I had any interesting insights to offer. There was also a more standard interview process accompanying this (which I doubt I excelled at) but the pair programming excercise gave a real world insight into exactly what I had to offer and what I was like to work with.