Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28502

Re: Python Interview Questions

References <1193768041.349129.26350@v3g2000hsg.googlegroups.com> <d4e47e64-91d3-4b9f-9e98-4985cd8cb936@googlegroups.com> <k27n53$3kp$1@ger.gmane.org>
Date 2012-09-06 00:34 +1000
Subject Re: Python Interview Questions
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.242.1346855687.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Sep 6, 2012 at 12:21 AM, Peter Otten <__peter__@web.de> wrote:
> charvigroups@gmail.com wrote:
>
>> Finally I have decided to put best interview question and answers.
>>
>> Please visit http://***/web/CorePython/ for core python
>> and http://***/web/PythonAdvanced/ for advanced python
>
> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python Interview Questions charvigroups@gmail.com - 2012-09-04 23:50 -0700
  Re: Python Interview Questions Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-09-05 14:10 +0530
  Re: Python Interview Questions Peter Otten <__peter__@web.de> - 2012-09-05 16:21 +0200
  Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-09-06 00:34 +1000
  Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-09-06 00:36 +1000
  Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-05 09:22 -0600
    Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-09-05 12:38 -0400
  Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-09-06 01:34 +1000
  Re: Python Interview Questions Dave Angel <d@davea.name> - 2012-09-05 12:01 -0400
  Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-09-05 12:11 -0400
  Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-05 10:40 -0600
    Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-09-05 12:45 -0400
  Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-09-06 08:13 +1000
  Re: Python Interview Questions Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-09-06 09:54 +0530
  Re: Python Interview Questions MRAB <python@mrabarnett.plus.com> - 2012-09-06 12:38 +0100

csiph-web