[Tutor] Python Interview Questions..

Martin A. Brown martin at linux-ip.net
Wed May 25 00:11:39 CEST 2011


Hi there,

 : Hey I'll be appearing for Job Interviews and wondering if anybody 
 : of you appeared for a Python Interview Or if on the other end as 
 : an interviewer.   Can you please share the questions asked?   
 : That will be of great help :)

I would point out that there are many types of interviews.  There's 
the technical screen, which is what it sounds like you are asking 
about, but there are other types of interviews that tend to focus on 
drawing out your approach to problems or your mindset.  With the 
latter type of interview, I would only suggest that you know 
yourself.

If however, you are worried about the technical content of an 
interview, it is possible that having my list of questions may help 
you.  It may also hinder you, because the set of questions that I 
ask may differ dramatically from another technical interviewer.  We 
are a fickle lot, prone to ask questions we (think we) know the 
answers to, which may differ from what you know [0].

With that said, here's a subset of the questions that I commonly use 
when interviewing candidates for a technical screen--I would rarely 
ask all of these.

  * What's your favorite stdlib module?  (And, why?)
  * Distinguish a dict() and a set().  When would I use which?
  * Distinguish a tuple() and a list().  When would I use which?
  * What's the risk of 't = sys.stdin.readlines()'?
  * What's an iterator?  Why would I care?
  * When should I use 'with'?  Is there any advantage?
  * What's a regex?  Why not just use string matching?
  * What does os.stat() return?  For what is this useful?
  * What's WSGI?  Why would I use it?
  * What are ElementTree and lxml?
  * What's a decorator?
  * What (unit) testing tools exist and how would I use them?
  * What does 'raise' do?  What does 'pass' do?
  * Describe Python's inheritance model.

And, some others that are geared more toward those who have written 
network (or SQL) applications:

  * What's a file descriptor?
  * What's a socket?
  * How do I create a listening socket in Python?
  * What's a signal?
  * How do I talk to a SQL DB from Python?  Any other DBs?
  * What tools are available for calling an external process?
  * What's a queue?
  * What's a thread?  Are there any (special) concerns about 
    threads I should have as a Python programmer?

If you have some familiarity with Python (particularly in a 
Unix-like environment) many of these questions would be familiar to 
you.  I would get some idea of your facility with the language and 
the underlying operating system from the accuracy and comfort with 
which you answered.  You might also find one or two of these 
(mis)leading and might want to tell me about corner cases that you 
as a developer have faced.  That would also be interesting to me as 
a technical interviewer.

-Martin

 [0] http://www.quotationspage.com/quote/12220.html

-- 
Martin A. Brown
http://linux-ip.net/


More information about the Tutor mailing list