My Three Favorite Python Interview Questions

Not too long ago I used to be interviewing some Python builders for a job opening. And I assumed I would share my unorthodox strategies for evaluating somebody’s ability as a developer utilizing Python.

That is totally different from “how effectively do they know Python”. As a result of I actually do not care how effectively they’ll rattle off arcane particulars of the language.

As a substitute, I wish to grasp whether or not they can steadiness getting-things-done with doing-things-right, in conditions that aren’t fully not like what I would truly be paying them to do.

So relatively than having them sketch out bubble type on a whiteboard or one thing, this is a number of issues I would do:

1) Course of CSV information

I inform them to deliver their laptop computer to the interview, and ensure it is arrange for Python growth.

I am going to give them a CSV file of some form of fascinating information. Vitamin information for various meals, for instance – one thing like that. And I’ll ask them to write down a program to ingest and reply questions on that information.

Beginning with the easy: “What is the common worth of the “energy” column?”

So I do know that they’ll a minimum of open the file and slurp within the information.

Then one thing somewhat extra fascinating, like: “Type the meals by their ratio of protein to energy”.

And so forth.

I do not care in the event that they use Pandas, or the csv module, or some library I’ve by no means heard of. I do not care whether or not they use PyCharm or Vim or Nano. Except it is one thing primary, I do not even care in the event that they search on-line through the interview to determine it out.

I simply care that they CAN determine it out.

2) Converse JSON over HTTP

I wrote somewhat todo-list internet service, which you’ll GET and PUT and POST to over the community. And I give them the deal with, and a brief doc that totally specifies its API…

create new duties; record incomplete duties; mark duties as completed; et cetera.

And I lead them by writing some code that workout routines it. As a result of within the fashionable world, we’ve got to write down glue code with internet companies like this loads.

In the event that they occur to have by no means completed this type of factor but – possibly they’ve simply had jobs to date the place it was by no means required, for instance – in a approach, that is even higher.

As a result of I may give them a fast tutorial in utilizing the “requests” module, and see if they’ll use it instantly to create easy interactions with the API.

And this lets me consider their skill to shortly be taught a library and use it in actual code… ANOTHER vital skill within the fashionable world.

3) Take a look at-Pushed Model Management

I am going to have them develop a easy library, utilizing test-driven growth.

Emphasis on “easy”. I am not going to ask them to implement a JIT compiler for a C-like language.

Extra like: producing integer sequences. One thing somewhat trivial, as a result of I am testing one thing else at this level. And we do not have all day to do the interview.

So I inform them the primary requirement. And inform them to write down code that meets that requirement, utilizing test-driven growth, and model management.

(Once more, I do not care in the event that they use unittest or pytest or nostril; git or mercurial or fossil or no matter. If they’ll do it with one in every of these, they’ll shortly be taught to do it within the one I would like.)

As soon as they’ve completed that, I give them the brand new requirement. And so they have to write down new unit checks, possibly modifying among the checks they only wrote, after which implementing utility code to make the checks cross.

And I repeat a few times extra.

This tells me loads about how they develop software program, their strengths and their weaknesses.

There’s extra to the interview course of than this. What I wrote above are just a few items I would use in an interview.

And in the event you plan to go on an interview quickly, contemplate training with these questions earlier than. Simply possibly, it’ll assist put together you to cross with flying colours.

Leave a Comment