Home / Python interview questions. Part I. Junior

Python interview questions. Part I. Junior

Python interview questions. Part I. Junior

I am starting a series of posts about my own base of interviewing questions. Of course, it is not full and it doesn't have any answers and maybe some of the questions seem weird or even stupid, but I think they are good for finding the right candidate for Python position.


Q: What is Python?

Q: What is lambda in Python?

Q: What is pass in Python?

Q: What is *args, **kwargs?

Q: What is docstring in Python?

Q: What are the built-in type does python provides? Which are mutable which are immutable?

Q: What is the difference between list and tuple?

Q: What keywords can be used in conjunction with the for keyword?

Q: What can be the key to the dictionary?

Q: What are globals and locals?

Q: What is PEP8?

Q: In Python what is slicing?

Q: What is the negative index in Python?

Q: What is the __init__.py module? What it's for?

Q: How can I swap the values of two variables within a string in Python?

Q: How to know the methods of the object?

Q: How to get documentation of objects in Python?

Q: What is a module? What is a package? What the difference between packages and modules?

Q: Can you write multithreading applications in Python? What the difference between multithreading, multiprocessing?

Q: What is decorator? How to create custom decorator?

Q: What do these mean to you: @classmethod, @staticmethod, @property?

Q: What the difference between @classmethod and @staticmethod?

Q: Does Python fully support OOP?

Q: What is the __dict__ attribute?

Q: What is self?

Q: What are __init__ functions ?

Q: Explain how can you make a Python Script executable on Unix?

Q: What is pickling and unpickling?

Code involving questions

Q: How to translate a string containing a binary code (1 and 0) into a number (integer)? Write a program for this.

Q: How to check that tuple A contains all elements of tuple B. Do both tuples contain unique values? Write a program for this.

Q: What will be the output of the following code?

def f():
     x = 15
x = 12

Q: How to convert a string to a number that consists of letters ASCII code. Example: 'abcd' -> 979899100. Write a program for this.

Q: How to remove empty lines from a list of lines (with a length of 0). Write a program for this.

Q: Write a program that counts all distinct pairs with a difference equal to k

Q: Build a string with the numbers from 0 to 100, "0123456789101112..."

Q: Making a list with the unique element from a list with duplicate elements

Q: Make a prime number list from (1,100)


Python interview questions. Part II. Middle

Python interview questions. Part III. Senior

Daily dose of