Why is dict searching usually faster than list searching, what is a decorator, and when is a generator useful?
Банк вопросов из реальных собеседований
Направления, темы и вопросы из записей интервью. Фильтры ниже сохраняются в ссылке.
Python
79 questions from real interviews
What do `_attr` and `__attr` mean in the Python class, and how is convention different from name mangling?
In Python, what actually makes a tuple: parentheses or comma? Give examples.
After computing revenue metrics in Pandas, what simple anomaly checks would you run on the table before trusting the result?
What happens if you assign one list to another variable and change it? What is the difference between shallow copy and deep copy?
What is a Python context manager, what do __enter__ and __exit__ do, and why not just wait for garbage collection?
If several decorators are recorded above the function, in what order do they create the wrappers and in what order are they executed when called?
What do the five principles of SOLID mean, and how do they help you change your server code without being too connected?
Why do pytest need fixtures, how to organize the preparation and cleaning of resources and what areas of action are available?
When to use async, threading and multiprocessing in Python, and how does the GIL influence these choices?
How does @dataclass reduce boilerplate, what does frozen=True do, and how do descriptors or properties relate to attribute access?
What is the Python GIL, when would you use multiprocessing vs multithreading, and how does Python garbage collection work?
What are the differences between asynchronous Lock, Event, and Semaphore, and which server code tasks does each primitive solve?
Explain what the GIL is, why CPython has it, and what happens at a high level when you run a Python file.
Python-service consumes a lot of CPU or memory under load. How to diagnose and what can you do if the problem is really in the Python code?
Explain ROC-AUC for binary classification. When is PR-AUC preferable, and what happens if you compute ROC-AUC on already-binarized predictions?
What is the difference between RDD, DataFrame and Dataset in Spark? Why is DataFrame usually faster, and how do repartition, coalesce, cache, and persist affect Spark tasks?
What should a stream job look like that calculates CTR by campaign_id and time windows?
Why does a custom nn.Module need super().__init__()? Separately, why is tags=[] as a default argument in Python dangerous?
What blocks does a language model agent consist of, where is its state stored, and how does it safely invoke external tools?
Does Python int overflow? How can you roughly estimate how much memory n! needs without computing the factorial?
For users who already have partial subscription history, what transaction features would you build for LTV prediction, and how would you avoid confusing churned users with recently returned users?
Which Candidate Generators Can Be Used in the Recommended System? How does ALS implicit feedback fit into this stack?
What boundary cases should be considered if the LRU cache stores arbitrary user values?