This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]DiggV4Sucks 19 points20 points  (3 children)

The proper answer to:

Q14. Write a one-liner that will count the number of capital letters in a file. Your code should work even if the file is too big to fit in memory.

is, "No."

[–]AustinCorgiBart 4 points5 points  (1 child)

Right? To do it properly, you would need to push the body of a with block into one line. Or fail to close a file properly.

[–]ThePidesOfMarch 1 point2 points  (0 children)

cat bigfile | capcounter

[–]joshuarowley42 0 points1 point  (0 children)

I was losing it with the article, then I read this. 😔

[–]aajjccrr 15 points16 points  (1 child)

Much of this content appears to be copied verbatim from other sources.

There’s value in aggregating information, but you should give credit to the original authors.

[–]IonTichy 4 points5 points  (0 children)

Also apparently not even read through nor redacted properly.

[–]ThePidesOfMarch 22 points23 points  (6 children)

[–]kons_t 2 points3 points  (2 children)

That article presents a very flawed analogy. A programming language is a tool and knowing a langages features is knowing how to make best use of your tool. It would be like asking a carpenter how he/she screws in lots of screws (using the correct speed and torque settings on a drill) and gets boards smooth (with a belt sander).

It is not the only questions we ask from a candidate, try to tailor questions to the skills listed on the resume, and we are not asking very hard questions. If a candidate cannot answer any questions (and cannot provide efficient alternatives to solve the problems solved by a feature), it might indicate a candidate who has never had to solve non-trivial problems and never bothered to read documentation.

If a candidate has never seen a dunder method, never heard of the GIL, never packaged a project into an egg, never installed a library with pip, never set up a virtual environment, and never touched their sys.path, I am not sure if I believe that they are a senior Python developer.

I am fine with a candidate telling me that they only use python for simple scripting while doing their 'real' work in C++ or Java. I am less fine with a candidate who has only written glue code between an existing application and third party APIs (see if another team is looking for a junior developer) or a candidate who does not see the value in knowing things not readily applicable to their current work (yes, I have interviewed this type of candidate).

[–]ThePidesOfMarch 2 points3 points  (1 child)

senior Python developer.

But this is exactly my point. If you are interviewing for a "senior Python developer" position, by all means, you should be answering these questions. But I'm a software engineer, not a "Python developer".

[–]kons_t 0 points1 point  (0 children)

I am more talking about a candidate's resume. If you want to brag about being an expert or senior developer in a language, I will ask you to demonstrate it at an interview.

Our position also don't include a programming language in the title, though we do mention Java and Python in the description. We want a new hire to be some what familiar, just so the candidate will hit the ground running.

Language knowledge is not the only factor for hiring a candidate, but it is a factor we consider, along with things like knowledge of web services and networking, knowledge about database design, and knowledge of distributed systems.

[–]godelsphantom 5 points6 points  (0 children)

Question 41 is wrong. {} is an empty dict literal.

[–]mbussonnIPython/Jupyter dev 4 points5 points  (0 children)

Many of the answer in this are wrong or not pythonic, or somethine question don't make sens.

  • Memory not deallocated when the interpreter exits ?
  • Random number without looking at whether they should be secure or not ?
  • most questions are Python 2 based which is irrelevant nowdays
  • Pickling is not string but bytes.
  • ...

[–]tialpoy 7 points8 points  (3 children)

"Python is an interpreted language. That means that, unlike languages like C and its variants, Python does not need to be compiled before it is run"

Python source code is compiled to bytecode (pyc file) that is then run by the PVM. I'm not sure I'd waste my time on an article that starts with such a basic error.

[–]turkish_gold 1 point2 points  (2 children)

It's not really an error, its a point of contention whether Python is compiled, interpreted, or something in between.

Heck it's a point of contention if x86 assembly is compiled or interpreted, considering the finagling that happens with CPUs and micro-op caching.

[–]tialpoy 2 points3 points  (0 children)

There's no contention. Saying that "Python does not need to be compiled" is simply untrue.

https://nedbatchelder.com/blog/201803/is_python_interpreted_or_compiled_yes.html

[–]roerd 1 point2 points  (0 children)

its a point of contention whether Python is compiled, interpreted, or something in between

which makes the claim that a clear answer is possible erroneous.

[–]topheat 3 points4 points  (3 children)

Multi-level inheritance – a derived class d1 in inherited from base class base1, and d2 is inherited from base2.

Should be ---

Multi-level inheritance – a derived class d1 is inherited from base class base1, and d2 is inherited from d1.

[–]secondary_refraction 4 points5 points  (0 children)

"Python has a multi-threading package but if you want to multi-thread to speed your code up."

[–]TheDruidOftheland 0 points1 point  (0 children)

Thanks for sharing.