Question Bank

Python interview questions

Working Python code does not by itself explain memory behavior, iteration or mutable objects. Use these questions to review language mechanisms. Support your answer with a small example and predict the result before running it.

1635
questions
16
categories
50
companies

Showing 20 of 114 questions

EasyPythonNNS

What is a list comprehension in Python?

lang-python
Practice in bot
MediumPythonNNS

How do generators differ from collections in Python?

lang-python
Practice in bot
EasyPythonNNS

What is the difference between set and frozenset in Python?

lang-python
Practice in bot
EasyPythonNNS

Which can be used as a dictionary key: set or frozenset?

lang-python
Practice in bot
MediumPythonNNS

Why is it dangerous to use a mutable object as a function argument's default value?

lang-python
Practice in bot
EasyPythonNNS

How does exception handling work in Python with try, except, else, and finally?

lang-python
Practice in bot
HardPythonNNS

How are generators related to asynchronous programming in Python?

lang-python
Practice in bot
EasyPythonNNS

What are dunder methods, or magic methods, in Python?

lang-python
Practice in bot
MediumPythonNNS

What is a context manager, used with the with statement, in Python?

lang-python
Practice in bot
EasyPythonАвтотехника

In Python, what keyword is used to access the parent class?

lang-python
Practice in bot
EasyPythonАвтотехника

In Python, what keyword is used to work with a context manager?

lang-python
Practice in bot
EasyPythonАвтотехника

In Python, how do you pass named arguments from a dictionary to a function?

lang-python
Practice in bot
MediumPythonАвтотехника

What is the difference between tensor.view() and tensor.reshape() in PyTorch?

lang-python
Practice in bot
EasyPythonАвтотехника

How do you put a PyTorch model into inference mode?

lang-python
Practice in bot
EasyPythonАвтотехника

How do you convert a PyTorch model to FP16 (Float16)?

lang-python
Practice in bot
MediumPythonТочка

In PyTorch, if you assign an ordinary Tensor rather than a Parameter to an nn.Module attribute, will it be trained?

lang-python
Practice in bot
EasyPythonТочка

What is PyTorch's automatic differentiation mechanism called?

lang-python
Practice in bot
MediumPythonPulsePoint

What are async and await in Python? What happens if you put a blocking HTTP call inside an async function?

lang-python
Practice in bot
MediumPython

Может ли быть теоретически у нас такая ситуация, что на train у нас попадут все объекты 1 класса на тесте не одного?

general
Practice in bot
MediumPython

А как внутрь декоратора прокидываются переменные для декорированной функции?

general
Practice in bot

Prepare for your next interview with Vibe Interview.

Download Vibe Interview
Python interview questions — page 3 | Vibe Interview