posted 4 months ago
I dislike interview questions that probe things that programmers should not normally be doing--like asking what the value of [3] * true is. But here are a few questions that I think are pretty good.
1. What is a after the following?
This just tests understanding of the in operator.
2. What is a after the following?
That's more interesting. What happens with a[-1]?
3. How about
This brings up an interesting fact about array indexes...which should allow the candidate to ace the following:
4. What is a after the following?
Which brings up the depressing reality how hard it is to avoid cruft from the ages.