Python Interview Questions

Dave Angel d at davea.name
Wed Sep 5 12:01:13 EDT 2012


On 09/05/2012 11:34 AM, Chris Angelico wrote:
> On Thu, Sep 6, 2012 at 1:22 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
>> The lack of an ORDER BY is the least of the problems with that SQL.
>> He's also using LIMIT without OFFSET, so the only thing that the
>> 'item' argument changes is how many rows are returned (all but one of
>> which are ignored), not which one is actually fetched.
> No, he's using the two-arg form of LIMIT.
>
>> It's a bit sad that these are touted as answers to interview
>> questions.  I wouldn't hire anybody who gave answers like these.
> The code does not work as posted; there are args missing from the
> INSERT example, for, uhh, example. It makes it hard to evaluate the
> quality of the code, in some places. I'm not sure what these posts are
> supposed to be, but I hope they're not being held up as model answers
> to interview questions. For a start, I can't find any sort of clear
> questions.
>
> Or is the code itself the question and "How would you improve this"?
>
> ChrisA

Skip ahead to about page 13 to get more traditional questions,  There,
many of the simplest questions have invalid answers, or confusing
explanations.

For example, on page 15, the question that says " ... if a list of words
is empty..."   uses     a=""   as its source data to test with.

The first question on page 16 forgets to construct a loop, thus
processing only the first line in the file.

page 18 introduces new syntax to the language:
     print n+=1  ##will work

and reassures us in the comment that it will work !!

page 18 also claims that values are passed to function by value.





-- 

DaveA




More information about the Python-list mailing list