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.


Questions

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 in the dictionary?

Q: What is globals and locals?

Q: What is PEP8?

Q: In Python what is slicing?

Q: What is negative index in Python?

Q: What is __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 object in Python?

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

Q: Can you write multi-threading 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. Both tuples contain unique values? Write a program for this.

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

def f():
     x = 15
     print(x)
x = 12
f()

Q: How to convert a string to a number which 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 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)

Next:

Python interview questions. Part II. Middle

Python interview questions. Part III. Senior

Support author