Python is one of the most highly appreciated general-purpose programming languages in use today. Easy to learn, highly productive, and pleasant to use—it’s wildly popular amongst developers across every skill level. It’s important to remember, however, the difference between knowing how to write Python code and engineering systems using the language.
We’ve already covered why and how you should go about Hiring Python Developers, but what about when it comes to the interview? A good technical interview should separate the experienced Python engineer from those who have used the language occasionally or are merely familiar with its syntax.
By the end of the interview process, you should come away with a firm idea of a candidate’s abilities, their level of experience, and an idea of how well they might fit in as a member of the team. Achieving all these goals, in just the few hours you have available, isn’t a trivial task.
Getting a good result from the technical interview means starting with questions about previous work and past projects before finding out a candidate’s knowledge on the fundamental principles and practices of Python engineering. It means assessing an applicant’s problem-solving abilities, soft skills, and communication under the pressure of an interview environment.
Outlined here are the questions you can ask, qualities you should look for, and skills you should aim to find to identify the ideal Python developer to join your firm. Alternatively, just tell us what you need and within 72h we can connect you with up to 5 companies that match your needs—all for free.
Before you start interviewing any potential developers, it’s important to answer some questions of your own. Think about the position you're hiring for and the kind of developer you imagine would fit into that role.
Python is an exceptionally broad language. It’s routinely used for tasks ranging from worldwide service deployment to the creation of internal tools and prototype demonstrations. In different scenarios, it can be an object-oriented platform, a simple scripting language, procedural language, or a functional one.
It’s precisely because there’s no single-use case for Python development and that there’s also no single kind of Python developer. Knowing the role Python is likely to play in your firm, at least for the near future, will help shape the qualities and skills you can look for in a potential candidate.
Internal questions to ask of your firm include:
Before an applicant has even come in for an interview, you should already have a rough idea about how well they can code. You should know of the work they’ve done before and the kinds of projects and technologies that interest them personally and professionally. Online profiles, Github, and similar resources are ideal tools to get to know a candidate early in the process.
The kinds of projects they undertake in their free time, or open-source contributions they’ve made in previous companies, can tell you a lot about their technical abilities and interests. Also, as mentioned, you can simply tell us what you need and we’ll do all the legwork for you, for free! After 72h we’ll connect you with up to 5 companies that have the background that matches your requirements!
When it comes to the interview, this is a conversation that should go both ways. You’d expect a thorough candidate to have researched your company before applying for the role or attending for an interview.
Informally introducing the firm by talking about the company’s work, projects, and technologies you have in common is a great way to break the ice before jumping into more in-depth and detailed technical topics later.
Discussing a candidate’s portfolio is an ideal starter topic; you’ll gain a greater understanding of their role in projects, and they’ll get a chance to talk about some of their best work.
At the heart of the many diverse use cases of the Python language are the diverging libraries and frameworks that it supports (for more about the latter, check out our Ultimate Guide to Python Frameworks in 2021). A python developer with some professional experience is likely to have worked with a few that relate directly to their field.
Asking questions about these tools can give you an insight into the kind of work they’ve done in the past. It’s an insight into the topics they are confident about and how well they communicate complex technical subjects with a team that may not know a great deal about them.
The right answer should break down the relevant libraries to be easy to understand at a relatively high level. It should be clear, opinionated, and offer up alternatives that developers could also investigate.
Questions on Python’s libraries may include:
To add to a high-level understanding of the projects a candidate has worked on in the past—it can be helpful to find out how well they can describe and discuss the language. Fundamental questions can be a useful insight into a developer’s understanding.
More than simply using Python as a tool, a high-quality Python engineer should know the details of the language from the ground up. Listed below are some Python development questions and a selection of sample answers that should help to investigate these skill sets.
Some aspects of the Python language that a candidate may want to mention:
Python can be multi-threaded, but it’s a poor way to optimise code for speed.
Python uses a Global Interpreter Lock that ensures safety by ensuring only one thread can execute at a time. This means threads take turns using one CPU core at a time, prohibiting parallel computation and adding additional overheads. Python’s threading package is suited to IO or networking, but it’s not useful as a performance tool.
Python code may call other functions (such as a C function) to do multi-threading performance calls if required.
Memory management in Python is done with a private heap space. Objects and data structures are stored in a private heap that the programmer can not access directly.
This is another way that Python aims to abstract obstacles away from the developer, preferring to handle memory automatically instead.
Python retains a count of references to each object. If an object’s reference count reaches zero, then the object is no longer considered live, and its memory is freed for other tasks.
Recently created objects are prioritised for garbage collection over older ones.
Occasionally reference cycles happen; this means the reference count is greater than zero, but references are only held between objects that each have no other references to them in memory.
object1.x == object2
object2.x == object1
The garbage collector periodically checks for these conditions and removes them.
Pickling is the process of taking a Python object and converting it into a string representation for storage. Unpickling is the reverse process of taking the string representation and converting it back into an object in Python.
This has uses in making temporary storage and debugging code relatively simple.
init is a method or constructor in Python. This method is automatically called to allocate memory when a new object or instance of a class is created. All classes have the init method.
An example of init in Python:
def __init__(self, name, position,salary):
self.name = name
self.position = position
self.salary = 60000
E1 = Employee("XYZ", "Senior Engineer", 60000)
# E1 is the instance of class Employee.
#__init__ allocates memory for E1.
As we’ve shown, Python has an exceptionally broad range of use cases. It’s often called on to do everything from quick and simple ‘hacks’ to data analysis, scripting, feature implementation, and everything in-between.
These wide ranges of uses for the language betray the fact that it is also a highly capable language for large engineering tasks. It’s one that your developers should know in full.
Listed here are some questions related to using Python as an object-oriented language for application development.
Inheritance allows a class to gain all the attributes and methods of another class without writing the same code twice. Inheritance promotes reusability and makes it easier to maintain an application. The class we are inheriting from is the super-class, and the class that is inherited is the child class.
They are different types of inheritance supported by Python:
Polymorphism allows child classes to modify the methods it inherits from its parent. For example, a child class may have a method with the same name as its parent but may wish to add its own parameters and variables to that method.
Data abstraction is centred around exposing only the required details of a class and hiding the detail of its implementation. Developers can achieve data abstraction in Python by using interfaces and abstract classes.
Encapsulation is about binding the code and the data of a program together. A Python class is an example of encapsulation.
As with most technical and practical skills, there’s no substitute for physically doing the task and solving real-world problems. For this reason, practical coding examples are the most valuable part of any technical interview.
With an eye on practical coding, it’s important to make enough time to undertake pair or solo programming exercises and discuss, review, and modify the solutions after.
The very best problems are the domain-specific ones that come from your own codebase. Problems your developers have already tackled and solved in the past are especially well-suited to provide a non-trivial example. Talking about real code is invariably a step up from toys and demonstrations.
However, if none of these are available, we’ve included some small challenge programs you may ask a candidate to implement with only 10-15 minutes required for the task.
The single most common coding interview question in any language, most candidates will be familiar with this task, even if they’ve not personally encountered it before.
The rules are that candidates should iterate over a predefined list of numbers, and:
An example solution is included below:
numbers = [25, 76, 15, 13, 11, 5, 0, 9]
for i, num in enumerate(numbers):
if num % 3 == 0 and num % 5 == 0:
numbers[i] = 'fizzbuzz'
elif num % 3 == 0:
numbers[i] = 'fizz'
elif num % 5 == 0:
numbers[i] = 'buzz'
output: ['buzz', 76, 'fizzbuzz', 13, 11, 'buzz', 'fizzbuzz', 'fizz']
A palindrome is a sequence of letters that reads the same forward and backwards, such as ‘pip’. A relatively simple and self-contained exercise would be to ask candidates to implement a python function that checks a sequence of letters to determine if they are, in fact, a palindrome.
The simplest example might be:
if not string[left]==string[right]:
Either of these tasks could be modified with extra steps, challenges, or tests to stretch a candidate’s abilities a little further under pressure.
Technical skills are, in reality, only one part of the equation when it comes to hiring a developer in any language. Personality and soft skills play just as large a role.
While engineering abilities define how well a developer will work on code, soft skills will define how well a team works together. The latter is undoubtedly the most valuable asset to the larger company.
Many of the technical questions already covered will go some way to investigating a developer’s soft skills. Analyse, not just the content of a candidate’s answers, but the way they present technical information, communicate solutions with the group, and convey new information to an audience.
These skills, though often overlooked, are a fundamental part of software development. The response and intuition you get today is the best insight you’ll get before investing time and money into hiring a new candidate.
Some additional soft skill questions you might ask developers to get their insight on the topic could include:
Additional skills a valuable candidate should have would include keeping up to date in an industry that is continually evolving and changing month to month. A broad awareness of the direction languages, tools, and technologies are moving in is essential for any high-quality engineer.
Attempting to gauge the enthusiasm a candidate has for the topic is a very difficult skill to master, but there are a few key topics and questions that can help:
A strong Python developer has a general problem-solving ability that matches the language they use. They should have a broad set of skills and an ability to tackle a great breadth of development challenges. Some fundamental traits of the ideal Python developer might include:
Python is such a popular, easy to learn, and widely adopted language that there are millions of developers out there with some understanding of its features. In finding the ideal candidate, you need more than that.
You need a candidate with an in-depth understanding of the features of Python and the libraries, frameworks, and platforms that support it. You need a strongly opinionated candidate, one found through careful and considerate interview, one that can engineer complex solutions and deliver maximum value for your firm.
Sounds like a lot, right? Well never fear, you can always refer back to this article or our Comprehensive Guide to Hiring Python Engineering Teams to make sure you have it all straight!
Take a moment out of your busy day to kick back and relax whilst we log you in to meet the top 7% of software vendors.
To be able to see all the information in a better light and with more clarity, please visit this page from a desktop device.
Launch your journey to unlock unparalleled transparency to the future of work!
You will find a curated universe of the world’s leading software development vendors that include over 4500 passionate designers and engineers.
Discover and explore in-depth vendor profiles with over 130 data-points, compare vendors side-by-side and engage vendors with a click of a button.
We would love for you to join us ⚡️
To be able to see all the information in a better light and with more clarity, please visit this page from a desktop device.
Accelerate your search by tellings us what you need. Share more about your requirements in our guided smart brief, and open the brief to our entire vendor community,
Vendors will receive an anonymised copy of your brief with no personally identifiable information to contact you directly. The anonymised copy simply aids the vendors in the application process of the contest and allows Pangea to recommend up to 5 suitable vendors based on a mix of our algorithm (beta) and human experts within 72 working hours.
How does that sound?