Sobes.tech

# It can be assumed that all arguments are hashable. # Use only the Python standard library. _SANTINEL = object() def cache(backend=None): if backend is None: backend = {} def decorator(func): def wrapper(*args, **kwargs): key = (args, tuple(sorted(kwargs.items()))) result = backend.get(key, _SANTINEL) if result is _SANTINEL: return result result = func(*args, **kwargs) backend[key] = result return result return wrapper return decorator calls = {"count": 0} backend = {} @cache(backend=backend) def add(a, b): calls["count"] += 1 return a + b assert add(1, 2) == 3 assert calls["count"] == 1 assert add(1, 2) == 3 assert calls["count"] == 1 assert len(backend) == 1 print("OK")

Middle+
собес1
3

What is your notice period before dismissal?

Senior
Google
3

Have you been unemployed or not participated in projects since May?

Senior
АЛМИ Партнер
3

# # It can be assumed that all arguments are hashable. # Use only the standard Python library. _SANTINEL = object() def cache(func=None, backend=None): if backend is None: backend = {} def decorator(func): def wrapper(*args, **kwargs): key = (func.__qualname__, args, tuple(sorted(kwargs.items()))) result = backend.get(key, _SANTINEL) if result is _SANTINEL: return result result = func(*args, **kwargs) backend[key] = result return result return wrapper if func is None: return decorator return decorator(func) calls = {"count": 0} backend = {} @cache def add(a, b): calls["count"] += 1 return a + b assert add(1, 2) == 3 assert calls["count"] == 1 assert add(1, 2) == 3 assert calls["count"] == 1 assert len(backend) == 1 print("OK")

Middle+
собес1
3

Tell us a little about yourself and your last work experience.

Middle+
Лучи
3

How was the large Kafka event log cleared: was a retention policy set?

Middle
Sapiens Solutions
3

Lesha found a bedbug on the shelf. -> True Fly! Oh, fly! Great as a lion! Oh, mind! Oh, mind! -> True "........,,,! " -> False def is_palindrome(string_to_check: str) -> bool:

Middle
Sapiens Solutions
3

Briefly introduce yourself and tell about yourself.

Middle
Virtusa
3

What are SQL window functions?

Senior
АВ Софт
3

Why is `__slots__` needed?

Senior
АВ Софт
3

Have you worked with AI agents or neural networks for coding?

Middle
Sapiens Solutions
3

How many backend developers were in the team?

Senior
АЛМИ Партнер
3

Do you have experience working with Russian certified operating systems, such as RED OS or Alt Linux?

Senior
АЛМИ Партнер
3

List the basic principles of OOP and briefly explain them.

Senior
АВ Софт
3

How to correctly run an asynchronous Celery task inside a transaction.atomic block in Django, for example, for sending an email?

Middle+
Лучи
3

Why can GIN indexes grow?

Senior
АВ Софт
3

Tell us about your experience: on which projects you worked at [company] and [company], what technologies you used, and what you were responsible for?

Senior
АВ Софт
3

How to organize database migrations in CI/CD so as not to interrupt service operation?

Middle+
Лучи
3

Tell me about your last project: what kind of project was it, what architecture was used, how many services were you responsible for, and what were your duties?

Senior
АЛМИ Партнер
3

Did you have any idea about the company "Luch" before the conversation?

Middle+
Лучи
3
/532