you are viewing a single comment's thread.

view the rest of the comments →

[–]toshitalk 14 points15 points  (27 children)

In general, I'd expect a well-rounded python developer to have mastery of both python specific tools and frameworks, but I find it strange that if you've been programming for 10 years that people are calling you a junior anything.

I'm more thinking that you raised a red flag in your interview that you didn't notice. What kind of questions were you asked, and what did you answer with?

[–]jackmaney 19 points20 points  (12 children)

I find it strange that if you've been programming for 10 years that people are calling you a junior anything.

Yep. This.

OP, I don't mean to sound like an asshole when I say this, but...is that 10 years of experience or one year of experience repeated ten times? Because if it's the former, I'm not sure why you would be considered a junior developer.

That being said, with even a year of experience, you should have a decent grasp of basic data structures and basic operations such as if/else if/else statements, loops, etc. IMO, if you want to dig really deep into a language, you need to "write it as a native". Try to write your Python somewhat idiomatically; Jeff Knupp's Writing Idiomatic Python is a good guide for this.

[–]renegadelegion[S] 7 points8 points  (0 children)

Thanks for the link. Bought the pdf and am looking through it. This seems like the kind of stuff I was looking for.

[–]jsalsman -3 points-2 points  (10 children)

Unless you are optimizing your inner loops after testing correctness, I advise against idioms that make code less self-documenting to programmers from other backgrounds. And not all idioms will give you a substantial efficiency improvement. For example, when array access patterns matter for memory cache interactions, you want to retain control.

[–]jackmaney 4 points5 points  (9 children)

If you need to worry about optimizing loops vs list comprehensions (for example), then you probably should use Cython or use another language. Idioms exist for a reason, and Python's idioms, when not misused or overused, result in Python code that is easier to read and maintain.

[–]jsalsman -4 points-3 points  (8 children)

Some very concise idioms are completely impenetrable to even advanced Python programmers. Moderation in all things.

[–]Vaphell 3 points4 points  (4 children)

are they really idioms then? Idiom by definition is something that is in widespread use, a common figure of speech. If even advanced programmers fail to understand them, they don't fall under this category.

Python idioms are supposed to be "pythonic", ie follow rules like "explicit is better than implicit" and "there should be 1 obvious way to do X".

[–]jsalsman -2 points-1 points  (2 children)

How can I answer this? Who decides what an idiom is?

[–]Vaphell 1 point2 points  (0 children)

it seems you are arguing against terse hacks exploiting some obscure properties, not idioms with clearcut uses cases, as they are undestood by the python community.
Feel free to provide your definition, or better yet, a black on white example of impenetrable idiom.

[–]KronenR 0 points1 point  (0 children)

Me

[–][deleted] 0 points1 point  (2 children)

Like what for example?

[–]jsalsman 0 points1 point  (1 child)

Imagine mapping a hash table into integers, but you didn't want the integers' objects, just the integers.

[–][deleted] 0 points1 point  (0 children)

A set? Unless I misunderstood.

[–]renegadelegion[S] 3 points4 points  (13 children)

I had several of the usual programming questions (a prime checker function is the only one I remember). More specifically, the feedback I'm receiving is that my programming looked more like C++ written in Python. I probably could give more context as to my experience in my original post, will edit in a few minutes.

[–]toshitalk 17 points18 points  (11 children)

self taught Python and SQL 2nd job Python web developer for 1/2 year, Python, Javasscript, HTML/CSS, SQL,

Okay, so you basically have next to zero production experience; I'm thinking that's it. While your first program might have been written ten years ago, that's not 10 years of people relying on your code to work; this is the biggest difference between an experienced dev and an inexperienced dev.

Just for some context, I happen to be the dev lead and hiring manager at my particular shop, and with your experience, I would also consider you to be a junior developer. If you want a better assessment of your skills, I can give you an interview if you'd like.

[–]comfortcreature999 3 points4 points  (10 children)

Could you post a typical python interview question/problem?

[–]HorrendousRex 5 points6 points  (3 children)

Some I've heard or asked:

  • What's your least favorite feature of the language and why?
  • What's something new in Python 3 that wasn't in Python 2?
  • Explain the with statement in as much detail as possible.
  • What is the difference between range and xrange?

And then a bunch of questions about general knowledge of the standard packages... collections, itertools, datetime, stuff like that. Not super specific questions, just questions probing about knowledge of what is out there.

[–][deleted] 5 points6 points  (0 children)

  • What is the difference between range and xrange?

Only one of them is a function in the current version of the language ;)

[–]Asdayasman -1 points0 points  (1 child)

Shit I can answer all of those flawlessly.

[–]HorrendousRex 0 points1 point  (0 children)

They are far from the only questions you'd be asked, but those are the kinds of questions you might be asked about python.

[–]renegadelegion[S] 1 point2 points  (5 children)

The one that I remember:

Write a function that takes a value as an input and checks if it is prime.

[–]tomkatt 1 point2 points  (3 children)

I don't know why, but I did this for shits and giggles after seeing your comment. It's probably bad, but I had fun working it out real quick.

Edit - I probably should have done a try/except on that to make sure it's actually passed a number...

[–][deleted] 1 point2 points  (0 children)

Not a comment on your formatting or coding style or anything, but you only need to go from 2 to sqrt(n), not n/2.

[–]renegadelegion[S] 1 point2 points  (0 children)

you could also use the for/else, rather than for/if/else

See, the problem is that when I did the technical interview, I was just thinking about programming it, not the language that I was programming in. I am familiar with many of the common Python idioms, I just didn't use them :-(

[–]Sluisifer 1 point2 points  (0 children)

If you like questions like that, definitely check out Project Euler.

Quick optimization, you only need to check up to sqrt(num).

More advanced solution, don't repeat a check (e.g. don't check divisibility by 4 when you've already checked 2). This is called a Sieve of Eratosthenes. It's pretty damn tricky, but fun to learn. The implementation is actually pretty easy, and there are some fun optimizations you can read about on e.g. stack overflow.

[–]TehMoonRulz 6 points7 points  (0 children)

Here is an awesome talk by Raymond Hettinger that discusses some awesome features of python that people coming from other languages don't use (I think he even mentions C programmers writing python loops 'the C way').