Interesting idea. However, what I don't like about this is that it gives the interviewee too little idea what they are actually expected to do. If you'd ask me this question:
How would you programmatically screw in a lightbulb?
in an interview, I would have no idea what you are talking about. Add the heightened nervousness of an interview situation, and you'll have perfectly capable candidates failing at this simply because they don't know what they're supposed to do.
In my opinion, you would at least need to add
In pseudo-code reflecting the process, how would you programmatically screw in a lightbulb?
For example: .... (and then some of the code you write above)