python interview quuestions

Peter peter.milliken at gmail.com
Mon Aug 9 02:28:59 CEST 2010


On Aug 9, 6:49 am, Terry Reedy <tjre... at udel.edu> wrote:
> On 8/7/2010 7:53 AM, Peter Otten wrote:
>
>
>
> > You mean you'd go for the candidate who took the conservative approach and
> > got it right:
>
> > print 1
> > print 2
> > print 'Fizz'
> > print 4
> > print 'Buzz'
> > print 'Fizz'
> > print 7
> > print 8
> > print 'Fizz'
> > print 'Buzz'
>
> Way too verbose. How about
> print("1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n
> etc.
>
> --
> Terry Jan Reedy

And to hell with the code being maintainable afterwards? :-)

Personally I would FIRE somebody who produced code like this. Assuming
I was a manager or in a position to hire (I used to be in a previous
life), then I would be looking for somebody who was capable of writing
good, solid and MAINTAINABLE code (love those subjective words? :-)).

Realistically, if the application is anything other than trivial then
it will most likely have somebody poking around in it at some stage
who isn't the brightest spark in the firmament. Anybody who produces
nice, readable and straight forward code in my books gets the tick of
approval.

No offence intended, but anybody who tried to prove how "bright" they
are by producing the least number of (unmaintainable) lines of code
would not get past the first interview - unless they were prepared to
sign a contract that guaranteed they would be available to maintain
the application for its entire lifecycle. Generally (in my experience)
people who write code like this don't hang around long - certainly not
long enough to maintain their monstrosity!

Peter




More information about the Python-list mailing list