Python Interview Questions

C

Chris Angelico

Of course, if they try to sell themselves as having
five years experience with Python 3.2...

.... then they've been borrowing Guido's time machine for personal purposes.

ChrisA
 
S

Steven D'Aprano

Why would you want to hire someone that knows something pointless as the
version where feature X has been introduced ? Just tell him that feature
X has been introducted in version Y, costless 2.5sec training. Don't you
want to hire someone that knows things you don't and benefit from each
others abilities, learning from each others, improving the company
global skill range ?

The reason for the question is to get some idea of how well the candidate
actually knows Python. If you ask them questions that you don't know the
answer to, how will you tell if they're right?

I certainly wouldn't disqualify a candidate if they didn't know what
version introduced (say) decorators. If they said "what's a decorator?"
or "version 10", that would be a hint that they don't actually know much
about Python. If they said "I don't know, I'm still stuck on Python 2.3",
they would get a point for honesty and lose a point for being way out of
date. If they said version 2.3 or 2.5 (it's actually 2.4), well, that's
close enough.

Of course, an acceptable answer would be "buggered if I know, but if you
give me a minute, I'll google it for you".
 
S

Steven D'Aprano

Am 10.07.2012 09:33, schrieb Steven D'Aprano:

IMHO one category of answers is always wrong: lies. You may oversell
yourself a bit, you can (and should) keep private matters to yourself
but don't lie.

If only that were true. I know quite a few people who looked the
interviewer straight in the eye and told the most bare-faced lies without
a trace of shame, and got the job. Ten years on, at least one of them is
making something around $300,000 a year, based entirely on his ability to
smile and tell customers plausible lies.

I can't lie to save my life, which is why I have trouble in interviews.
But of course all good liars would say the same thing.
 
C

Chris Angelico

If only that were true. I know quite a few people who looked the
interviewer straight in the eye and told the most bare-faced lies without
a trace of shame, and got the job. Ten years on, at least one of them is
making something around $300,000 a year, based entirely on his ability to
smile and tell customers plausible lies.

So he's either a politician, a salesman, a lawyer, a counselor, a
manager, a thespian, or a venture capitalist. And maybe a few other
possibilities. Professional liars, all. :)

ChrisA
 
E

Ethan Furman

Chris said:
... then they've been borrowing Guido's time machine for personal purposes.

Reminds me of a job posting a few years ago where the prospective
employer wanted three plus years experience in some language, and that
language had only been created a year and a half before.

~Ethan~
 
J

Jean-Michel Pichavant

Steven said:
The reason for the question is to get some idea of how well the candidate
actually knows Python. If you ask them questions that you don't know the
answer to, how will you tell if they're right?

I certainly wouldn't disqualify a candidate if they didn't know what
version introduced (say) decorators. If they said "what's a decorator?"
or "version 10", that would be a hint that they don't actually know much
about Python. If they said "I don't know, I'm still stuck on Python 2.3",
they would get a point for honesty and lose a point for being way out of
date. If they said version 2.3 or 2.5 (it's actually 2.4), well, that's
close enough.

Of course, an acceptable answer would be "buggered if I know, but if you
give me a minute, I'll google it for you".
Must be a cultural thing. We don't question people experience that much
here. They'll be challenged anyway during the trial period (6 months
during which the contract can be cancelled anytime without any reason).
Actually I think it would be considered quite rude to challenge someone
with questions right after he told you he worked 5 years as technical
leader on a software developped in python for instance.

I've never been asked nor did I asked to go into such technical details.
Interviews are more about years of experience, projects, working with
teams, carreer expectations, distance between home and workplace,
willingness to work weekends when required.

I'm no saying one way is better than another. I'm making an observation
on how different can be an interview from one location to another.

JM
 
D

Dennis Lee Bieber

may not be capable of telling the difference between a cheese sandwich
and a box of hair -- and even the *good* interviewers are probably making

They are both containers holding samples of protein
 
S

Steven D'Aprano

So he's either a politician, a salesman, a lawyer, a counselor, a
manager, a thespian, or a venture capitalist. And maybe a few other
possibilities. Professional liars, all. :)

Actually, he's a senior software developer for a major international
software company whose name Might Seem familiar to you.

To be honest, I can't tell you too much more about his job, as I've made
it a practice not to learn too many details.
 
D

Dennis Lee Bieber

As an example from today, if someone claimed to have 5+ years of Python
experience, but didn't know that 'with' was standard in 2.6 (or at least
the end of the 2.x cycle) I would be suspicious that they actually had
the experience they claimed.
From the 2.5 help file:
"""
3.4.9 With Statement Context Managers
New in version 2.5.
"""
 
I

Ian Kelly

"""
3.4.9 With Statement Context Managers
New in version 2.5.
"""

In 2.5 the with statement requires a __future__ import, so can't be
considered "standard".
 
D

David Robinow

Reminds me of a job posting a few years ago where the prospective employer
wanted three plus years experience in some language, and that language had
only been created a year and a half before.
I saw several of those when Java was new.
 
R

Rick Johnson

Why would you want to hire someone that knows something pointless as the
version where feature X has been introduced ? Just tell him that feature
X has been introducted in version Y, costless 2.5sec training. Don't you
want to hire someone that knows things you don't and benefit from each
others abilities, learning from each others, improving the company
global skill range ?

JM

Ha! Intelligent people are scary to bosses. They want robots Jean.
Robots that are *just* intelligent enough to reduce their own work
load whist NOT intelligent enough to render them obsolete.
 
S

Stefan Behnel

Mark Lawrence, 10.07.2012 11:42:
I recall reading in a book in the local library
of a manager that wouldn't employ people unless they were wearing a new
pair of shoes. Guess they didn't take many people on.

Managers tend to like wasting resources. Buying a new pair of shoes for
each job interview sounds reasonable once you have a salary well beyond
your own capabilities.

Stefan
 
K

Kushal Kumaran

Finally I have decided to put best interview question and answers.

Please visit http://www.f2finterview.com/web/CorePython/ for core python and http://www.f2finterview.com/web/PythonAdvanced/ for advanced python

As I see from a quick glance, several of your answers seem to be
copied from the python faq at http://docs.python.org/faq/. The
copyright notice for the python.org website seems to be at
http://docs.python.org/copyright.html. Do you have the Python
Software Foundation's permission to copy large chunks of the
python.org website and claim it as your own content?
 
C

Chris Angelico

Hm, are you a reformed PHP programmer who has never heard of sql injection
attacks? The first "advanced" answer (and probably all the database-related
stuff) should definitely be withdrawn.

I wouldn't go that far. The 'name' parameter, I would expect, would be
a constant. However, this strikes me as encouraging some really
inefficient code, like iterating over all the rows in a table with N+1
queries (one to get the length, then a separate query for each row).
Plus, use of limit without order by is not guaranteed (although since
this is specific to MySQL, it's unlikely you'll run into trouble - but
PostgreSQL, with its MVCC storage system, frequently reorders rows in
a table).

As a general rule, I don't like SQL builders. I'd prefer to directly
embed SQL statements in my code. Although sometimes a class can
helpfully manage some things, it's seldom worth having something that
tries to pretend a table is iterable in that sort of way.

ChrisA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top