Python
# 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")
What is your notice period before dismissal?
Have you been unemployed or not participated in projects since May?
# # 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")
Tell us a little about yourself and your last work experience.
How was the large Kafka event log cleared: was a retention policy set?
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:
Briefly introduce yourself and tell about yourself.
What are SQL window functions?
Why is `__slots__` needed?
Have you worked with AI agents or neural networks for coding?
How many backend developers were in the team?
Do you have experience working with Russian certified operating systems, such as RED OS or Alt Linux?
List the basic principles of OOP and briefly explain them.
How to correctly run an asynchronous Celery task inside a transaction.atomic block in Django, for example, for sending an email?
Why can GIN indexes grow?
Tell us about your experience: on which projects you worked at [company] and [company], what technologies you used, and what you were responsible for?
How to organize database migrations in CI/CD so as not to interrupt service operation?
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?
Did you have any idea about the company "Luch" before the conversation?