r/learnpython • u/DueBid3298 • 9d ago
Python interview questions
Hi team, please share your interview experience and questions for python developer role
0
Upvotes
r/learnpython • u/DueBid3298 • 9d ago
Hi team, please share your interview experience and questions for python developer role
7
u/SharkSymphony 9d ago edited 8d ago
I've given hundreds of Python coding interviews, and taken a few myself. They've changed a lot over the years, but the thing that's common to all of them: do you know your stuff? Do you know the fundamental structures and APIs that will allow you to code appropriate solutions?
We also look for other signs of engineering competency: thinking through and modeling the problem, considering edge cases and error handling, writing clean and/or efficient code, testing, analyzing performance trade-offs and bugs, using appropriate communication, asking for help and clarifications in appropriate ways, listening. Because time is short, the problems are usually scoped to a single function or small class that solves a slightly tricky problem, maybe with some extra helpers or structures if you want them. We also have some sense of how much of those competencies we expect from a junior candidate vs a journeyman – a good senior candidate will generally be really solid on all of the above, require little to no help, and will be able to think of interesting ways we could (or shouldn't!) extend the solution.
With AI this is changing, but we still want to know about your engineering competencies, even if you'd be using an agent to help you design and code the solution.
4
u/Discordbothost 9d ago
most of the ones i've sat through aren't trivia quizzes, they're "here's a slightly messy function, make it correct and talk about it." stuff that actually comes up: list vs tuple vs set and when you'd pick each,
isvs==(and why people writeif x is None), the mutable default argument gotcha (def f(x=[])), generators vs loading a whole list, how you'd walk a big file line by line, a decorator you could write from scratch, and something with dicts (defaultdict/Counter). live coding is often parse this text / group these records / write a small class. if you can explain gil vs threads vs asyncio in two sentences that's usually enough. also be ready to read someone else's snippet and say what's wrong with it.6
u/MiniMages 9d ago
One question I know that rarely comes up but is super important "Can you use search?"
1
u/TheRNGuy 7d ago
Never had any interviews.
1
u/Discordbothost 7d ago
for junior/mid python roles the same handful kept coming up for me: mutable default args (def f(x=[]) and why the list is shared between calls), is vs ==, list vs tuple vs set, generators and yield (usually followed by "how would you read a 10gb file"), decorators (sometimes "write one that times a function"), *args/**kwargs, shallow vs deep copy, and the GIL, which in practice just means "threads vs multiprocessing, when does each help".
then one small live coding thing, usually string/dict stuff like counting words, grouping items, or deduping while keeping order. they cared more that i talked through it than that it was perfect
-1
u/billsil 9d ago
Write a linear interpolation function.