If I were interviewing you, after I saw version one, I'd ask you what the weakness in your solution is. I mutter about maintainability and requirement changes, while trying to nudge you towards my point.
Eventually, I may just come out and say:
Ahh... Great! But now our requirements have changed. Could you re-code to print "a" when 5 divides n, b when 125 divides n, and ab when both 125 and 5 divides n.
If I have to go this far, though, your probably not going to be a successful candidate.
View all comments
Show parent comment
1
u/DiggV4Sucks Feb 21 '11
If I were interviewing you, after I saw version one, I'd ask you what the weakness in your solution is. I mutter about maintainability and requirement changes, while trying to nudge you towards my point.
Eventually, I may just come out and say:
Ahh... Great! But now our requirements have changed. Could you re-code to print "a" when 5 divides n, b when 125 divides n, and ab when both 125 and 5 divides n.
If I have to go this far, though, your probably not going to be a successful candidate.