interview-prep
A repository to store the answers for frequently asked interview questions.
Frequently Asked Interview Questions for the following roles
- Python Backend Developer
- Python Developer
- Software Engineer (Python)
- Backend Software Engineer (Python)
Python
-
Explain the data structures in Python.
-
Explain mutable and immutable data structures in Python.
-
What are the differences between list and array in Python. Which one is more efficient?
-
Explain list and dictionary comprehensions. Does the performance of the program increase if they are used?
-
Can a list be used as a key of a dictionary?
-
What is magic or dunder methods in Python? List some of them for Python. List some of them for Django.
-
What is generators in Python? How to define a generator?
-
What are the differences between return and yield? When to use them? Make use of yield to compute factorial(n).
-
What are the usages of help() and dir() in Python?
-
What is CLI and what are the usages of Python CLI?
-
Explain decorators. What are the different ways of defining a decorator. How to define a decorator for classes?
-
What is @property? What are the usage of that? When to use that?
-
Suppose you are importing 2 libraries, how will you import them? In single line or multiple lines?
-
How constructor is used in Python?
-
How encapsulation is achieved in Python?
-
How abstraction is achieved in Python?
-
How polymorphism is achieved in Python?
-
How inheritance is achieved in Python? How multiple inheritance is achieved in Python?
-
Explain the usages of 'with' keyword in Python?
-
How to use ternary operator in Python? What are the benefits of it?
-
How to use map and filter in Python?
-
How enumerate is used? Why should you use that?
-
What is zip and unzip? When to use that? Write the syntax for zip and unzip.
-
What is lambda function? When to use that? Give an example.
-
How *args and **kwargs are used in Python? Give examples.
-
How exceptions are handled in Python? Explain the demerits of using a bare exception.
-
What is docstring in Python? What are the benefits of it?
-
Explain concurrency in Python.
-
What are the differences between thread and process? How to declare them in Python?
-
How multi-processing is achieved in Python?
-
How multi-threading is achieved in Python?
-
What is the Global Interpreter Lock (GIL) in Python? How to deal with GIL?
-
What are the differences between synchronous and asynchronous programming?
-
How to achieve asynchronous programming in Python?
-
How to use asyncio in Python?
-
How cache and session are managed in Python?
-
Can session be stored in both client and server sides?