Code Reading Question
Tuesday June 16, 2015
Here's an idea for a type of question to help assess a person's skill in programming. Give the person some code to read:
def norf(bar, foo): for baz in bar: if baz in foo or norf(baz, foo+[baz]): return True return False
This is four lines of Python.
Some of the questions you could ask:
- What does
- What are the types of the arguments
- What are better names for
- What data structure are we working with?
- What are alternatives for the design of this data structure?
- What are limitations of this function?
I suspect that this could be interesting. I haven't seen anyone use interview questions of this type. I wonder how well this one would work.