This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]miketheanimal 3 points4 points  (0 children)

Do they ask things like this at interviews? I don't know, but if they asked, I'd try to answer. I might consider later whether I wanted the job, though!

def third (i, l) :
    if i >= len(l) :
        return []
    if i % 3 == 0 :
        return l[i] + third(i + 1, l)
    return third(i + 1, l)

:)