Sample Technical Interview Questions: Python

Got a job interview coming up in development or data science? Chances are you will be asked to complete a technical interview with questions designed to measure your analytical and coding skills. In this post, we've compiled a set of practice questions you can use to strengthen your Python skills ahead of an interview.
Share on linkedin
Share on twitter
Share on facebook

Most application processes for software development or coding jobs include a technical interview. This is a session where you’ll be tested on your problem solving skills and technical knowledge. You can read all about technical interviews in our Guide to Acing the Technical Interview.

A Python Technical Interview consists of very specific questions related to programming with Python. You may be asked to participate in this kind of interview if you are applying to a specific role as a Python Developer or Python Programmer, or if the job description emphasizes Python as a key skill. Python is useful for roles that work with large amounts of data and is also a favorite of many software engineering teams. You can learn more about the uses of Python in our ultimate guide to Python programming.

To help you prepare for a Python interview, we’ve compiled a list of sample questions that will help you get a feel for what to expect.

Sample Technical Interview Questions – Python

1. Write a program in Python to print the following pattern:

2. Write a program in Python to print the following pattern:

3. Write a program to find the common elements of the following Sets:



4. Write a program to find the common elements of the following Lists:

List1=[22, 32, 42, 52, 62, 72, 82]

List2=[30, 32, 34, 36, 38, 40, 42, 44, 46, 48]

List3=[24, 32, 40, 48, 56, 64, 72, 80]

5. Explain “reserved” words in Python and give examples.

6. Initialize a 6*6 numpy array with only zeroes.

7. What are the four kinds of joins available in pandas? Explain each.

8. How do you add comments to your Python code?

9. What are “objects” and what are “classes” in Python? Can you give examples?

10. What is a dictionary? Give an example.

11. Write a Python program to solve the Fibonacci sequence using recursion.

12. Write a Python program to get the 8th element of a Tuple.

13. Write a Python program to get the second-to-last element of a Tuple.

14. Given the following array, find the mean, median, and standard deviation.


15. Remove duplicates from the following list.

list1 = [3, 3, 6, 7, 8, 8, 3, 4, 5, 9, 4]

16. Explain the use of “with” in Python.

17. What is a “frozen set” in Python?

18. Make a Bar Graph for “Number of Books Read by Class” From the Following Data Set (below Question 19).

19. Using the Following Data Set, Make a Line Plot for “Average Number of Books Read Per Student” with Grade Level on the Horizontal Axis.

Practice Interview Problems Python

20. Using the Dataset for Iris Flowers, Build a decision tree classification model where the dependent variable is “Species” and the independent variable is “Sepal.Length”.

Python Practice Data

More Prep

The following sites are great additional resources to keep practicing your Python skills in advance of a technical interview:

LeetCode is an awesome one-stop shop for technical interview prep. They have a large database of questions for general technical interviews as well as focused Python sessions. They also offer guided study plans and forums where other job hunters can post about their technical interview experiences.

InterviewBit has a robust collection of practice questions for Python and other subjects. They also have useful guides to the interview processes at prominent tech companies like Google, Adobe, and Amazon. 

Interview Cake sells an interview prep course for $100 to $200. However, they also offer an abbreviated free course as well as free interview tips and review materials.

To find coding bootcamps that cover Python in their curriculums, check out our Python overview page. If you’re ready to start applying for Python jobs now, review out our Guide to Writing a Technical Resume to start creating your application materials. To learn more about technical interviews in general – what to expect, study tips, and more – read through our Guide to Acing the Technical Interview

Best of luck on the job hunt!

Related Articles