Python
Are you not from Moscow yourself? When and why did you move to Moscow?
[name] asked: If the call count information is stored in a closure via nonlocal, how can I find out outside how many times a specific function (e.g., a) was called?
How does multithreading work in Python considering GIL? What are the differences between threads and processes?
Can there be two primary keys on one table in PostgreSQL?
Pros and cons of FastAPI?
Has [name] heard anything about our company or can they tell us briefly?
В целом чем компания занималась / расскажи про продукт (маркетплейс, похожий на Wildberries)?
How do you personally feel about criticism directed at you?
Please tell us what WAL (Write-Ahead Log) is.
class ATM(SKD): def __init__(self, atm_api: "SKD"): self.atm_api: SKD = atm_api self.bills_count: dict[int:int] = {bill: self.atm_api.count_banknotes(bill) for bill in BILLS} def withdraw(self, amount: int) -> bool: bills_plan: dict[int: int] = {} remaining = amount for bill in BILLS: available = self.bills_count[bill] take = min(remaining // bill, available) if take > 0: bills_plan[bill] = take remaining -= take * bill if remaining != 0: return False bills_count_const = {50: 0, 100: 2, 500: 0, 1000: 0, ...}, expected = True @pytest.mark.parametrize( "bills_count_const,expected", [ ({5000: 0, 1000: 0, 500: 0, 100: 0, 50: 0}, False), ({5000: 100, 1000: 100, 500: 100, 100: 100, 50: 100}, True), ({5000: 1, 1000: 0, 500: 0, 100: 2, 50: 0}, True) ] ) def test_false(bills_count_const, expected): atm = ATM(FakeSDK()) atm.bills_count = bills_count_const amount = 1000 res = atm.withdraw(amount) assert res == expected
What is a closure?
The description is provided by a business analyst who wrote the task "as they could" and can give business requirements descriptions. There is a terrible legacy PHP code that receives log files from S3 parses them, writes the result to the required location. It is known: files arrive once an hour, currently 5 files all files are in one bucket Data should be directed to different places depending on the format – postgres/local file It is necessary to write an ETL that implements this functionality. Writing specific implementations of methods (reading data/sending data, etc.) can be neglected.
What project structure pattern is used in Django? What are its disadvantages and what are the alternatives?
A little about OOP. What is the difference (between some OOP concepts)?
Can you tell more about VACUUM? What types of VACUUM are there?
What if you believe the project requires clean architecture, but the manager insists on delivering quickly with a dirty architecture?
Describe the simplest case of list operation complexity.
[name] asked: What is the difference between EXPLAIN and EXPLAIN ANALYZE in PostgreSQL, and what should be looked at when comparing the plans of two queries (whether an index is used, etc.)?
How to sort a very large file (100 GB) with integers, one per line?
What types of indexes are available in PostgreSQL?