Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Python Interview Questions

 

 

First page Previous page 1 2 3 4 5 Next page Last page  View All Python python RSS feed   Index | Next | Previous | View Threaded


krypto.wizard at gmail

Oct 30, 2007, 11:14 AM

Post #1 of 103 (3258 views)
Permalink
Python Interview Questions

Hi,

I have used Python for a couple of projects last year and I found it
extremely useful. I could write two middle size projects in 2-3 months
(part time). Right now I am a bit rusty and trying to catch up again
with Python.

I am now appearing for Job Interviews these days and I am wondering if
anybody of you appeared for a Python Interview. Can you please share
the questions you were asked. That will be great help to me.

Thanks,

--
http://mail.python.org/mailman/listinfo/python-list


sndive at gmail

Oct 30, 2007, 11:34 AM

Post #2 of 103 (3207 views)
Permalink
Re: Python Interview Questions [In reply to]

Krypto wrote:
> Hi,
>
> I have used Python for a couple of projects last year and I found it
> extremely useful. I could write two middle size projects in 2-3 months
> (part time). Right now I am a bit rusty and trying to catch up again
> with Python.
>
> I am now appearing for Job Interviews these days and I am wondering if
> anybody of you appeared for a Python Interview. Can you please share
> the questions you were asked. That will be great help to me.
>
> Thanks,

assert() in the c functions extending python ends the interview rather
quickly.
or at least it did for me @IronPort ages ago.
To be honest they have massively multithreaded app
and the last thing they needed was an appliance down because
some programmer was not sure what to do when a certain condition
arises.

--
http://mail.python.org/mailman/listinfo/python-list


python.list at tim

Oct 30, 2007, 12:24 PM

Post #3 of 103 (3190 views)
Permalink
Re: Python Interview Questions [In reply to]

> I have used Python for a couple of projects last year and
> I found it extremely useful. I could write two middle size
> projects in 2-3 months (part time). Right now I am a bit
> rusty and trying to catch up again with Python.
>
> I am now appearing for Job Interviews these days and I am
> wondering if anybody of you appeared for a Python
> Interview. Can you please share the questions you were
> asked. That will be great help to me.

While I haven't interviewed precisely for Python, I've been
on the other (interviewing) end and can offer a few of the
sorts of things I ask. I don't expect perfect answers to
all of them, but they show me a range of what the
interviewee knows. I try and give a scattershot of
questions from the following areas to try and narrow down
where they fall in terms of pythonability, and then grill
more deeply around the edges that I find.

Basic Python:
=============
- do they know a tuple/list/dict when they see it?

- when to use list vs. tuple vs. dict. vs. set

- can they use list comprehensions (and know when not to
abuse them? :)

- can they use tuple unpacking for assignment?

- string building...do they use "+=" or do they build a list
and use .join() to recombine them efficiently

- truth-value testing questions and observations (do they
write "if x == True" or do they just write "if x")

- basic file-processing (iterating over a file's lines)

- basic understanding of exception handling

Broader Basic Python:
=====================
- questions about the standard library ("do you know if
there's a standard library for doing X?", or "in which
library would you find [common functionality Y]?") Most
of these are related to the more common libraries such as
os/os.path/sys/re/itertools

- questions about iterators/generators

- questions about map/reduce/sum/etc family of functions

- questions about "special" methods (__<foo>__)

More Advanced Python:
=====================
- can they manipulate functions as first-class objects
(Python makes it easy, but do they know how)

- more detailed questions about the std. libraries (such as
datetime/email/csv/zipfile/networking/optparse/unittest)

- questions about testing (unittests/doctests)

- questions about docstrings vs. comments, and the "Why" of
them

- more detailed questions about regular expressions

- questions about mutability

- keyword/list parameters and unpacked kwd args

- questions about popular 3rd-party toolkits (BeautifulSoup,
pyparsing...mostly if they know about them and when to use
them, not so much about implementation details)

- questions about monkey-patching

- questions about PDB

- questions about properties vs. getters/setters

- questions about classmethods

- questions about scope/name-resolution

- use of lambda

Python History:
===============
- decorators added in which version?

- "batteries included" SQL-capible DB in which version?

- the difference between "class Foo" and "class Foo(object)"

- questions from "import this" about pythonic code

Python Resources:
=================
- what do they know about various Python web frameworks
(knowing a few names is usually good enough, though
knowledge about the frameworks is a nice plus) such as
Django, TurboGears, Zope, etc.

- what do they know about various Python GUI frameworks and
the pros/cons of them (tkinter, wx, pykde, etc)

- where do they go with Python related questions (c.l.p,
google, google-groups, etc)

Other Process-releated things:
==============================
- do they use revision control
(RCS/CVS/Subversion/Mercurial/Git...anything but VSS) and
know how to use it well

- do they write automated tests for their code

Touchy-feely things:
====================
- tabs vs. spaces, and their reasoning

- reason for choosing Python

- choice of editor/IDE

Good luck with your interviewing and hope this helped,

-tkc





--
http://mail.python.org/mailman/listinfo/python-list


krypto.wizard at gmail

Oct 30, 2007, 1:30 PM

Post #4 of 103 (3188 views)
Permalink
Re: Python Interview Questions [In reply to]

> Good luck with your interviewing and hope this helped,
>
> -tkc

Well, I was looking exactly for this. Many thanks to you Tim. After
going through your list I came to know that I know nothing in Python
and have to catch up a whole lot.

--
http://mail.python.org/mailman/listinfo/python-list


bignose+hates-spam at benfinney

Oct 30, 2007, 3:14 PM

Post #5 of 103 (3182 views)
Permalink
Re: Python Interview Questions [In reply to]

Krypto <krypto.wizard [at] gmail> writes:

> I am now appearing for Job Interviews these days and I am wondering
> if anybody of you appeared for a Python Interview. Can you please
> share the questions you were asked. That will be great help to me.

I've given some interviews for programming positions. I find it
worthless to ask questions about the language; instead, I ask the
applicant *what they've done* with the language.

Then, I ask them to write some code, usually something simple but
poorly-specified, and observe their approach to the task. That tells
me far more about their knowledge of the language than answers to quiz
questions; it also tells me far more about them as a programmer, which
is what I actually care about.

--
\ "Any intelligent fool can make things bigger and more |
`\ complex... It takes a touch of genius – and a lot of courage |
_o__) – to move in the opposite direction." —Albert Einstein |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list


python.list at tim

Oct 30, 2007, 3:17 PM

Post #6 of 103 (3172 views)
Permalink
Re: Python Interview Questions [In reply to]

>> Good luck with your interviewing and hope this helped,
>>
>> -tkc
>
> Well, I was looking exactly for this. Many thanks to you Tim. After
> going through your list I came to know that I know nothing in Python
> and have to catch up a whole lot.

It was certainly not an exhaustive list of "you must know
everything on this list or else you'd never get hired", or
conversely, it's also not a "if you don't know everything on this
list, you're not worthy to call yourself a Python programmer".

It's a way I've found to gauge what somebody means when they say
the program in Python. I've had the gamut of folks where that
phrase means anything from "I glanced at some Python code once"
to "I'm Guido" (okay, so that's a bit of hyperbole, but you get
the idea). My goal is to use as few questions as possible to
flush out just what an interviewee mean by "I program in Python".

Hanging out here on the c.l.p list will introduce you to a lot of
these ideas on the sly. For my "basic" categories,
lists/tuples/dicts/sets as well as list-comprehensions show up
here regularly; I've answered several on basic file processing in
the last day or two (iterate over a file object, doing something
with each line); you see truth-testing regularly (and
chastizement when folks do things like "if foo == True"); you see
basic exception handling...all the basic stuff is regularly
covered/used here.

Knowledge of the available system libraries comes with using them
and having need for them. I'm still learning it. I finally
tired of writing my own command-line parsers and investigated
what the std. lib had to offer, only to find that optparse did
everything I needed: cleanly, readably, and extensibly. So now I
use that instead. That sort of experience only comes from time
emersed in using Python to solve problems.

All that to say, don't sweat it too badly, and that fortunately
Python is an easy language to work with.

-tkc






--
http://mail.python.org/mailman/listinfo/python-list


konryd at gmail

Oct 31, 2007, 1:58 AM

Post #7 of 103 (3170 views)
Permalink
Re: Python Interview Questions [In reply to]

> - string building...do they use "+=" or do they build a list
> and use .join() to recombine them efficiently


I'm not dead sure about that, but I heard recently that python's been
optimized for that behaviour. That means: using += is almost as fast
as joining list. Besides, "+=" is more obvious than the other choice
and since performance is not a problem until it's a problem, I'd
rather use it. Anyway: I wouldn't pick it for an interview question.

regards
Konrad

--
http://mail.python.org/mailman/listinfo/python-list


steven.bethard at gmail

Oct 31, 2007, 7:43 AM

Post #8 of 103 (3159 views)
Permalink
Re: Python Interview Questions [In reply to]

konryd wrote:
>> - string building...do they use "+=" or do they build a list
>> and use .join() to recombine them efficiently
>
>
> I'm not dead sure about that, but I heard recently that python's been
> optimized for that behaviour. That means: using += is almost as fast
> as joining list.

For some simple cases, this is true. But it only works in CPython, not
say Jython. So it's a better practice to continue using .join().

STeVe
--
http://mail.python.org/mailman/listinfo/python-list


rhamph at gmail

Oct 31, 2007, 3:31 PM

Post #9 of 103 (3188 views)
Permalink
Re: Python Interview Questions [In reply to]

On Oct 31, 2:58 am, konryd <kon...@gmail.com> wrote:
> > - string building...do they use "+=" or do they build a list
> > and use .join() to recombine them efficiently
>
> I'm not dead sure about that, but I heard recently that python's been
> optimized for that behaviour. That means: using += is almost as fast
> as joining list. Besides, "+=" is more obvious than the other choice
> and since performance is not a problem until it's a problem, I'd
> rather use it. Anyway: I wouldn't pick it for an interview question.

Concatenating strings using += will often perform quadratically with
the number of concatenations. Your testing will likely use a small
number and not take a noticeable amount of time. Then it'll get
deployed and someone will plug in a much larger number, wondering why
the program is so slow. The recent optimizations just make it more
obscure.

+= shouldn't be an obvious choice for sequences. If it's mutable,
use .append(). If it's immutable, build up in a mutable sequence,
then convert.

--
Adam Olsen, aka Rhamphoryncus

--
http://mail.python.org/mailman/listinfo/python-list


"http://phr.cx" at NOSPAM

Oct 31, 2007, 11:06 PM

Post #10 of 103 (3168 views)
Permalink
Re: Python Interview Questions [In reply to]

Rhamphoryncus <rhamph [at] gmail> writes:
> += shouldn't be an obvious choice for sequences. If it's mutable,
> use .append(). If it's immutable, build up in a mutable sequence,
> then convert.

I generally prefer to do this with generators rather than mutation.
I.e. instead of

blech = []
while some_condition():
yuck = some mess
blech.append(yuck)
result = ''.join(blech)

I like

def gen_blech():
while some_condition():
yield (some mess)
result = ''.join(gen_blech())

It just seems cleaner. YMMV. Of course when "some mess" is a single
expression instead of multiple statements, it may be possible to use
a genexp without the auxiliary function.
--
http://mail.python.org/mailman/listinfo/python-list


yeryomin.igor at gmail

Jul 8, 2012, 11:39 PM

Post #11 of 103 (3008 views)
Permalink
Re: Python Interview Questions [In reply to]

On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:
> > I have used Python for a couple of projects last year and
> > I found it extremely useful. I could write two middle size
> > projects in 2-3 months (part time). Right now I am a bit
> > rusty and trying to catch up again with Python.
> >
> > I am now appearing for Job Interviews these days and I am
> > wondering if anybody of you appeared for a Python
> > Interview. Can you please share the questions you were
> > asked. That will be great help to me.
>
> While I haven't interviewed precisely for Python, I've been
> on the other (interviewing) end and can offer a few of the
> sorts of things I ask. I don't expect perfect answers to
> all of them, but they show me a range of what the
> interviewee knows. I try and give a scattershot of
> questions from the following areas to try and narrow down
> where they fall in terms of pythonability, and then grill
> more deeply around the edges that I find.
>
> Basic Python:
> =============
> - do they know a tuple/list/dict when they see it?
>
> - when to use list vs. tuple vs. dict. vs. set
>
> - can they use list comprehensions (and know when not to
> abuse them? :)
>
> - can they use tuple unpacking for assignment?
>
> - string building...do they use "+=" or do they build a list
> and use .join() to recombine them efficiently
>
> - truth-value testing questions and observations (do they
> write "if x == True" or do they just write "if x")
>
> - basic file-processing (iterating over a file's lines)
>
> - basic understanding of exception handling
>
> Broader Basic Python:
> =====================
> - questions about the standard library ("do you know if
> there's a standard library for doing X?", or "in which
> library would you find [common functionality Y]?") Most
> of these are related to the more common libraries such as
> os/os.path/sys/re/itertools
>
> - questions about iterators/generators
>
> - questions about map/reduce/sum/etc family of functions
>
> - questions about "special" methods (__<foo>__)
>
> More Advanced Python:
> =====================
> - can they manipulate functions as first-class objects
> (Python makes it easy, but do they know how)
>
> - more detailed questions about the std. libraries (such as
> datetime/email/csv/zipfile/networking/optparse/unittest)
>
> - questions about testing (unittests/doctests)
>
> - questions about docstrings vs. comments, and the "Why" of
> them
>
> - more detailed questions about regular expressions
>
> - questions about mutability
>
> - keyword/list parameters and unpacked kwd args
>
> - questions about popular 3rd-party toolkits (BeautifulSoup,
> pyparsing...mostly if they know about them and when to use
> them, not so much about implementation details)
>
> - questions about monkey-patching
>
> - questions about PDB
>
> - questions about properties vs. getters/setters
>
> - questions about classmethods
>
> - questions about scope/name-resolution
>
> - use of lambda
>
> Python History:
> ===============
> - decorators added in which version?
>
> - "batteries included" SQL-capible DB in which version?
>
> - the difference between "class Foo" and "class Foo(object)"
>
> - questions from "import this" about pythonic code
>
> Python Resources:
> =================
> - what do they know about various Python web frameworks
> (knowing a few names is usually good enough, though
> knowledge about the frameworks is a nice plus) such as
> Django, TurboGears, Zope, etc.
>
> - what do they know about various Python GUI frameworks and
> the pros/cons of them (tkinter, wx, pykde, etc)
>
> - where do they go with Python related questions (c.l.p,
> google, google-groups, etc)
>
> Other Process-releated things:
> ==============================
> - do they use revision control
> (RCS/CVS/Subversion/Mercurial/Git...anything but VSS) and
> know how to use it well
>
> - do they write automated tests for their code
>
> Touchy-feely things:
> ====================
> - tabs vs. spaces, and their reasoning
>
> - reason for choosing Python
>
> - choice of editor/IDE
>
> Good luck with your interviewing and hope this helped,
>
> -tkc

--
http://mail.python.org/mailman/listinfo/python-list


python.list at tim

Jul 9, 2012, 4:07 AM

Post #12 of 103 (3002 views)
Permalink
Re: Python Interview Questions [In reply to]

On 07/09/12 01:39, yeryomin.igor [at] gmail wrote:
> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:

yes, yes I did, almost 5 years ago. :-)

You didn't include any questions/comments on my email, so it's a bit
hard to respond.

>> While I haven't interviewed precisely for Python, I've been
>> on the other (interviewing) end and can offer a few of the
>> sorts of things I ask.
[snip]
>> Python History:
>> ===============
>> - decorators added in which version?
>>
>> - "batteries included" SQL-capible DB in which version?

I've long wanted to update my original post in this department to
include things like the "with" statement as well as my reasoning.
Some of our deployments were stuck on earlier versions (currently
our oldest is a 2.4 deployment that is merrily chugging along,
somewhat stuck due to an external binary dependency for which terms
changed between versions). At the time I wrote that, we had some
2.2 and 2.3 code in production that couldn't use decorators, and
sqlite wasn't officially added until 2.5 (IIRC). Now that
everything is at least 2.4, code can now use decorators freely.

I'd also likely include questions about integer division and other
stuff added in 3.x (such as the default new-class behavior).

So my main motivation was to make sure applicants knew that, in some
of our environments, certain features might not be available. Not
that I wanted to hire a Python historian.

>> Other Process-releated things:
>> ==============================
>> - do they use revision control
>> (RCS/CVS/Subversion/Mercurial/Git...anything but VSS) and
>> know how to use it well
>>
>> - do they write automated tests for their code

Don't let the importance of these two escape. It's SOOOOOOO easy to
grab any of the freely available VCS tools and learn the ropes, or
to write some test code. Failure to do so just seems like
negligence these days.

-tkc





--
http://mail.python.org/mailman/listinfo/python-list


roy at panix

Jul 9, 2012, 6:25 AM

Post #13 of 103 (2987 views)
Permalink
Re: Python Interview Questions [In reply to]

In article <3e0ef383-9615-4b4d-89c1-e5519971189f [at] googlegroups>,
yeryomin.igor [at] gmail wrote:

> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:

> > - more detailed questions about the std. libraries (such as
> > datetime/email/csv/zipfile/networking/optparse/unittest)

You need to be careful when you ask questions like this. I would expect
somebody to be aware of those and have a high-level understanding of
what they do, but certainly not remember the details of the exact syntax
and argument order. Even with stuff I use everyday (like unittest and
datetime), I have a browser open to the reference manual most of the
time.

> > - questions about PDB

Heh. I would answer that with, "Python Debugger? I've never used it".

> > Python History:
> > ===============
> > - decorators added in which version?
> >
> > - "batteries included" SQL-capible DB in which version?
> >
> > - the difference between "class Foo" and "class Foo(object)"
> >
> > - questions from "import this" about pythonic code

With the exception of the question about new-style classes, these are
silly questions. I was around when both decorators and sqlite3 were
added. I couldn't possible tell you when to any precision better than
"2 dot something". As for the zen of python, it's cute, and a piece of
python folklore, but hardly an essential part of being a good python p
--
http://mail.python.org/mailman/listinfo/python-list


python.list at tim

Jul 9, 2012, 10:40 AM

Post #14 of 103 (3007 views)
Permalink
Re: Python Interview Questions [In reply to]

On 07/09/12 08:25, Roy Smith wrote:
>> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:
>
>>> - more detailed questions about the std. libraries (such as
>>> datetime/email/csv/zipfile/networking/optparse/unittest)
>
> You need to be careful when you ask questions like this. I would expect
> somebody to be aware of those and have a high-level understanding of
> what they do, but certainly not remember the details of the exact syntax
> and argument order. Even with stuff I use everyday (like unittest and
> datetime), I have a browser open to the reference manual most of the
> time.

Yeah, the aim isn't to grill them on the minutia, but to get a
feeling that they know the basics. The zipfile module offers a
ZipFile object for reading/writing zip files with or without
compression. The CSV file allows for reading/writing CSV files with
definable delimiters and quoting/escaping. Etc.


>>> - questions about PDB
>
> Heh. I would answer that with, "Python Debugger? I've never used it".

The ability to know off the top of your head that it's the "Python
Debugger" is more than enough :-) That's just first-order
ignorance: you know what you don't know and can spend a few minutes
reading up on it if you need it. The second[or higher]-order
ignorance of not knowing what pdb is (or, if you need more powerful
debugging, how to do it) is sign the person hasn't been programming
in Python much.

>>> Python History:
>>> ===============
>>> - decorators added in which version?
>>>
>>> - "batteries included" SQL-capible DB in which version?
>>>
>>> - the difference between "class Foo" and "class Foo(object)"
>>>
>>> - questions from "import this" about pythonic code
>
> With the exception of the question about new-style classes, these are
> silly questions. I was around when both decorators and sqlite3 were
> added. I couldn't possible tell you when to any precision better than
> "2 dot something".

I'd even be satisfied if a person just knew that such features
weren't there all along and might need to be worked around for older
deployments.

> As for the zen of python, it's cute, and a piece of python
> folklore, but hardly an essential part of being a good python p

[Ed: something appears to have gotten truncated there] Yeah, it's
more about a person being sufficiently steeped in python to know
bits and pieces of the zen, and their ability to recognize/create
pythonic code. I've seen enough Java-written-in-Python to know what
I don't want :-)

-tkc


--
http://mail.python.org/mailman/listinfo/python-list


rantingrickjohnson at gmail

Jul 9, 2012, 11:44 AM

Post #15 of 103 (2996 views)
Permalink
Re: Python Interview Questions [In reply to]

On Jul 9, 12:40pm, Tim Chase <python.l...@tim.thechases.com> wrote:
>The second[or higher]-order
> ignorance of not knowing what pdb is (or, if you need more powerful
> debugging, how to do it) is sign the person hasn't been programming
> in Python much.

So guru knowledge of pdb is prerequisite to being accepted as a
Pythonista? I find that ridiculous since *real* programmers don't use
debuggers anyway.

> [Ed: something appears to have gotten truncated there] Yeah, it's
> more about a person being sufficiently steeped in python to know
> bits and pieces of the zen, and their ability to recognize/create
> pythonic code. I've seen enough Java-written-in-Python to know what
> I don't want :-)

I know you are a member of the group who has an aversion to strict OOP
paradigm but is this a justified aversion, or just fear of OOP due to
static evolution? Look, i don't like java's strict approach either,
however, i do not have an aversion to OOP.

--
http://mail.python.org/mailman/listinfo/python-list


demianbrecht at gmail

Jul 9, 2012, 1:11 PM

Post #16 of 103 (2998 views)
Permalink
Re: Python Interview Questions [In reply to]

On Monday, 9 July 2012 10:40:59 UTC-7, Tim Chase wrote:
> On 07/09/12 08:25, Roy Smith wrote:
> >> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:
> >
> >>> - more detailed questions about the std. libraries (such as
> >>> datetime/email/csv/zipfile/networking/optparse/unittest)
> >
> > You need to be careful when you ask questions like this. I would expect
> > somebody to be aware of those and have a high-level understanding of
> > what they do, but certainly not remember the details of the exact syntax
> > and argument order. Even with stuff I use everyday (like unittest and
> > datetime), I have a browser open to the reference manual most of the
> > time.
>
> Yeah, the aim isn't to grill them on the minutia, but to get a
> feeling that they know the basics. The zipfile module offers a
> ZipFile object for reading/writing zip files with or without
> compression. The CSV file allows for reading/writing CSV files with
> definable delimiters and quoting/escaping. Etc.
>
>
> >>> - questions about PDB
> >
> > Heh. I would answer that with, "Python Debugger? I've never used it".
>
> The ability to know off the top of your head that it's the "Python
> Debugger" is more than enough :-) That's just first-order
> ignorance: you know what you don't know and can spend a few minutes
> reading up on it if you need it. The second[or higher]-order
> ignorance of not knowing what pdb is (or, if you need more powerful
> debugging, how to do it) is sign the person hasn't been programming
> in Python much.
>
> >>> Python History:
> >>> ===============
> >>> - decorators added in which version?
> >>>
> >>> - "batteries included" SQL-capible DB in which version?
> >>>
> >>> - the difference between "class Foo" and "class Foo(object)"
> >>>
> >>> - questions from "import this" about pythonic code
> >
> > With the exception of the question about new-style classes, these are
> > silly questions. I was around when both decorators and sqlite3 were
> > added. I couldn't possible tell you when to any precision better than
> > "2 dot something".
>
> I'd even be satisfied if a person just knew that such features
> weren't there all along and might need to be worked around for older
> deployments.
>
> > As for the zen of python, it's cute, and a piece of python
> > folklore, but hardly an essential part of being a good python p
>
> [Ed: something appears to have gotten truncated there] Yeah, it's
> more about a person being sufficiently steeped in python to know
> bits and pieces of the zen, and their ability to recognize/create
> pythonic code. I've seen enough Java-written-in-Python to know what
> I don't want :-)
>
> -tkc

Definitely appreciate your approach, I've asked similar questions when interviewing.

I also usually like to ask what a candidate likes and dislikes about Python, hoping for the GIL to creep up, along with an explanation as to what it is, implementations that don't have it along with methods of getting around the lock (although that would be a fairly advanced topic IMHO). If it doesn't come up, sometimes I'll pop it in depending on their level of experience.
--
http://mail.python.org/mailman/listinfo/python-list


demianbrecht at gmail

Jul 9, 2012, 1:11 PM

Post #17 of 103 (2993 views)
Permalink
Re: Python Interview Questions [In reply to]

On Monday, 9 July 2012 10:40:59 UTC-7, Tim Chase wrote:
> On 07/09/12 08:25, Roy Smith wrote:
> >> On Tuesday, 30 October 2007 21:24:04 UTC+2, Tim Chase wrote:
> >
> >>> - more detailed questions about the std. libraries (such as
> >>> datetime/email/csv/zipfile/networking/optparse/unittest)
> >
> > You need to be careful when you ask questions like this. I would expect
> > somebody to be aware of those and have a high-level understanding of
> > what they do, but certainly not remember the details of the exact syntax
> > and argument order. Even with stuff I use everyday (like unittest and
> > datetime), I have a browser open to the reference manual most of the
> > time.
>
> Yeah, the aim isn't to grill them on the minutia, but to get a
> feeling that they know the basics. The zipfile module offers a
> ZipFile object for reading/writing zip files with or without
> compression. The CSV file allows for reading/writing CSV files with
> definable delimiters and quoting/escaping. Etc.
>
>
> >>> - questions about PDB
> >
> > Heh. I would answer that with, "Python Debugger? I've never used it".
>
> The ability to know off the top of your head that it's the "Python
> Debugger" is more than enough :-) That's just first-order
> ignorance: you know what you don't know and can spend a few minutes
> reading up on it if you need it. The second[or higher]-order
> ignorance of not knowing what pdb is (or, if you need more powerful
> debugging, how to do it) is sign the person hasn't been programming
> in Python much.
>
> >>> Python History:
> >>> ===============
> >>> - decorators added in which version?
> >>>
> >>> - "batteries included" SQL-capible DB in which version?
> >>>
> >>> - the difference between "class Foo" and "class Foo(object)"
> >>>
> >>> - questions from "import this" about pythonic code
> >
> > With the exception of the question about new-style classes, these are
> > silly questions. I was around when both decorators and sqlite3 were
> > added. I couldn't possible tell you when to any precision better than
> > "2 dot something".
>
> I'd even be satisfied if a person just knew that such features
> weren't there all along and might need to be worked around for older
> deployments.
>
> > As for the zen of python, it's cute, and a piece of python
> > folklore, but hardly an essential part of being a good python p
>
> [Ed: something appears to have gotten truncated there] Yeah, it's
> more about a person being sufficiently steeped in python to know
> bits and pieces of the zen, and their ability to recognize/create
> pythonic code. I've seen enough Java-written-in-Python to know what
> I don't want :-)
>
> -tkc

Definitely appreciate your approach, I've asked similar questions when interviewing.

I also usually like to ask what a candidate likes and dislikes about Python, hoping for the GIL to creep up, along with an explanation as to what it is, implementations that don't have it along with methods of getting around the lock (although that would be a fairly advanced topic IMHO). If it doesn't come up, sometimes I'll pop it in depending on their level of experience.
--
http://mail.python.org/mailman/listinfo/python-list


peter.milliken at gmail

Jul 9, 2012, 2:22 PM

Post #18 of 103 (2993 views)
Permalink
Re: Python Interview Questions [In reply to]

One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?"

If the answer included programming then they were hired, if not, then they went to the "B" list.

In my experience, anybody who is really interested in programming will have it as a hobby (and is keen to learn even if they don't currently have the knowledge you require) - otherwise it is "just a job". Every job has a learning curve - whether it is just the particular domain or even a new language, the individual who sees programming as more "than a job" will come up to speed much faster and be more productive in both the short and long term.

Every programmer I have ever hired using this criteria worked out well.
--
http://mail.python.org/mailman/listinfo/python-list


peter.milliken at gmail

Jul 9, 2012, 2:22 PM

Post #19 of 103 (3005 views)
Permalink
Re: Python Interview Questions [In reply to]

One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?"

If the answer included programming then they were hired, if not, then they went to the "B" list.

In my experience, anybody who is really interested in programming will have it as a hobby (and is keen to learn even if they don't currently have the knowledge you require) - otherwise it is "just a job". Every job has a learning curve - whether it is just the particular domain or even a new language, the individual who sees programming as more "than a job" will come up to speed much faster and be more productive in both the short and long term.

Every programmer I have ever hired using this criteria worked out well.
--
http://mail.python.org/mailman/listinfo/python-list


jeanpierreda at gmail

Jul 9, 2012, 3:53 PM

Post #20 of 103 (2991 views)
Permalink
Re: Python Interview Questions [In reply to]

On Mon, Jul 9, 2012 at 5:22 PM, Peter <peter.milliken [at] gmail> wrote:
> One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?"
> If the answer included programming then they were hired, if not, then they went to the "B" list.

Woe is the poor college grad, who wants to appear like a well-rounded
individual and lists capoeira and gardening, instead.

-- Devin
--
http://mail.python.org/mailman/listinfo/python-list


cs at zip

Jul 9, 2012, 4:05 PM

Post #21 of 103 (2993 views)
Permalink
Re: Python Interview Questions [In reply to]

On 09Jul2012 11:44, Rick Johnson <rantingrickjohnson [at] gmail> wrote:
| On Jul 9, 12:40 pm, Tim Chase <python.l...@tim.thechases.com> wrote:
| > The second[or higher]-order
| > ignorance of not knowing what pdb is (or, if you need more powerful
| > debugging, how to do it) is sign the person hasn't been programming
| > in Python much.
|
| So guru knowledge of pdb is prerequisite to being accepted as a
| Pythonista? I find that ridiculous since *real* programmers don't use
| debuggers anyway.

You've misread him. He's saying not knowing what PDB is and what it may
be used for is a sign of low experience. Whether one uses it or not
isn't what he's measuring, it's whether one knows what it is for and how
it may be used.

| > [...]  I've seen enough Java-written-in-Python to know what
| > I don't want :-)
|
| I know you are a member of the group who has an aversion to strict OOP
| paradigm but is this a justified aversion, or just fear of OOP due to
| static evolution? Look, i don't like java's strict approach either,
| however, i do not have an aversion to OOP.

More misreading. "Java-written-in-Python" (and its variants) means non-python
code written in python, in this case from someone with a strong (or
rigid) Java background who is not adept with Python idioms. It has
nothing to do with OOP one way or the other. Surely we've all seen
(and doubtless written) clumsy python code; this is an example.

Cheers,
--
Cameron Simpson <cs [at] zip>

A strong conviction that something must be done is the parent of many
bad measures. - Daniel Webster
--
http://mail.python.org/mailman/listinfo/python-list


roy at panix

Jul 9, 2012, 4:08 PM

Post #22 of 103 (3009 views)
Permalink
Re: Python Interview Questions [In reply to]

In article <mailman.1959.1341868974.4697.python-list [at] python>,
Peter <peter.milliken [at] gmail> wrote:

> One of my favourite questions when interviewing - and it was 100% reliable
> :-) - "what are your hobbies?"

"My hobby happens to be gardening, for which I don't expect to be paid."
--
http://mail.python.org/mailman/listinfo/python-list


cs at zip

Jul 9, 2012, 4:12 PM

Post #23 of 103 (2996 views)
Permalink
Re: Python Interview Questions [In reply to]

On 09Jul2012 18:53, Devin Jeanpierre <jeanpierreda [at] gmail> wrote:
| On Mon, Jul 9, 2012 at 5:22 PM, Peter <peter.milliken [at] gmail> wrote:
| > One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?"
| > If the answer included programming then they were hired, if not, then they went to the "B" list.
|
| Woe is the poor college grad, who wants to appear like a well-rounded
| individual and lists capoeira and gardening, instead.

A new word! A quick google search confused me as to whether this was
martial art or a form of dance. The GF suggested it was both. Having
seen this:

http://www.youtube.com/watch?v=Z8xxgFpK-NM

I am now convinced :-)
--
Cameron Simpson <cs [at] zip>

Hit the button Chewie! - Han Solo
--
http://mail.python.org/mailman/listinfo/python-list


lists at cheimes

Jul 9, 2012, 4:33 PM

Post #24 of 103 (2984 views)
Permalink
Re: Python Interview Questions [In reply to]

Am 09.07.2012 23:22, schrieb Peter:
> One of my favourite questions when interviewing - and it was 100% reliable :-) - "what are your hobbies?"
>
> If the answer included programming then they were hired, if not, then they went to the "B" list.

on the contrary! When a potential candidate has computer stuff as her
main hobby then she goes on the no-hire list. I prefer people that can
cope with stress and pressure as well as people who can think outside
the box. When you work with computers all day at work *and* at home then
you are unable to shut off mentally.

Gardening is great hobbies for a developer. You need to be patient,
reliable and provide constantly good work to grow your own vegetables.

Christian

--
http://mail.python.org/mailman/listinfo/python-list


python.list at tim

Jul 9, 2012, 4:37 PM

Post #25 of 103 (3006 views)
Permalink
Re: Python Interview Questions [In reply to]

On 07/09/12 17:53, Devin Jeanpierre wrote:
>> One of my favourite questions when interviewing - and it was
>> 100% reliable :-) - "what are your hobbies?" If the answer
>> included programming then they were hired, if not, then they
>> went to the "B" list.
>
> Woe is the poor college grad, who wants to appear like a
> well-rounded individual and lists capoeira and gardening,
> instead.

The problem is the "instead...if your list of hobbies includes
capoeira and gardening in addition to programming, you're at least
considered. :-)

-tkc


--
http://mail.python.org/mailman/listinfo/python-list

First page Previous page 1 2 3 4 5 Next page Last page  View All Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.