There are no good Python interview questions. Why? Because you want to hire a good developer, not a Python nerd. I used to think that there are some good Python-related problems to solve during the interview. But I doubt there is any.
I've interviewed more than 30 developers. I've gradually drifted from only-python-nerd-knows-the-answer questions to general programming problems to solve. There are several reasons for that.
An interview is not an ideal thing. You have an hour to decide if a candidate suits a position. In most cases, you as an interviewee look at a particular skill - task solving skill. This skill should be accompanied by the ability to code and test own code. These are the second and the third skills to check.
Maybe, ask how GIL works?
So what is the popular Python-related question? How does GIL work? Maybe. At least I saw that abbreviation a lot in lists of interview questions.
Let's imagine a typical interview. The candidate, John, is a brilliant guy with many years of experience. John had spent about 20 minutes describing GIL in detail. Wonderful. But what do I learned from the answer about his ability to code? Not much if anything.
I can try to find a coding problem where GIL is a bottleneck and ask John to solve it. But I can't. Real-world problems connected with GIL usually require at least a week to solve. And mostly, they are architecture-related issues.
That's why questions about GIL or CPython implementation details are wastes of time. Answering them, a candidate doesn't show any required skills. So why interviewers keep asking them?
What about the standard library?
Python has a huge standard library. There is a trap if someone thinks that there is a commonly used part. Even build-in functions like "sort" are not used often. As an example, last year I hardly used it.
Anyway, Python has probably the best documentation. So asking this kind of question is equivalent to asking someone to recall the part of the documentation.
Ok. What if I ask a question about syntax sugar?
Decorators are told to be a good thing to ask during an interview. I don't think so. Any engineer with a non-Python background will fail on this kind of question. But it takes 10 minutes to explain the basics and extra 15-20 minutes to explain decorators in depth.
I used to ask about decorators. If interviewees have experience in programming, usually they can solve decorator-based problems after a 5-minute-long decorator crash course.
As a conclusion
Python is not the hardest language to learn. If you can't invite an interviewee to work with you on a real task, a real-world feature in your project for a couple of days, and you have to use traditional technical interviews, use general programming problems.
It is much better to filter out a guy who can't tell "for" from "while" than a guy who can't explain how GIL works in detail.
Got a question? Hit me on Twitter: avkorablev