Sobes.tech

Explain the concept of asynchronous functions in Python and their role in optimizing operation execution.

Junior — Middle
166

How to determine if a specific character (for example, the character A) can be discarded when narrowing the window from the left without losing alphabet coverage?

166

Can you give an example of a situation where ignoring a variable or factor that can change leads to a logical error?

Junior — Middle
166

Explain the merge sort algorithm and its main stages.

Junior — Middle
166

How can access to private class members be implemented from outside its definition?

Junior — Middle
166

How have you implemented synchronization between threads using semaphores or their equivalents in various programming languages?

Junior — Middle
166

Can you give an example of using the standard generator from Python's built-in capabilities?

Junior — Middle
166

Design an indexing system for a table that stores all cities in Russia, considering that searches will be based on city names.

166

In what situations is the use of relational databases not recommended?

Junior — Middle
166

Do you follow the latest news and updates in thematic Telegram channels?

Junior — Middle
166

Why don't you accept offers if you already have them?

Middle
166

Task 2. Merging two sorted arrays Given two sorted arrays in ascending order, nums1 and nums2. It is necessary to merge them into one sorted array in ascending order. nums1 = [1, 3, 5] nums2 = [2, 4, 6] merge_sorted(nums1, nums2) -> [1, 2, 3, 4, 5, 6]

Senior
166

Have you had experience performing your duties while working remotely?

Intern — Junior
166

How did you determine the scope of work and the volume of tasks in your previous position?

Junior — Middle
166

Каким образом убедиться, что ключ присутствует в словаре?

Junior — Middle
166

What techniques prevent unwanted data read operations?

Middle — Middle+
166

What is JWT in the context of authorization? What are its three parts?

Middle+
166

```python import asyncio from typing import List, Optional class Chunk: def __init__(self, items: List[dict]): self.items = items @property def size(self) -> int: return len(self.items) class Producer: async def next(self) -> Optional[Chunk]: # возвращает пачку данных или None ... async def commit(self, chunks: List[Chunk]) -> None: # фиксируем успешную обработку chunks ... class Consumer: max_batch_size = 100 async def consume(self, chunks: List[Chunk]) -> None: total_size = sum(chunk.size for chunk in chunks) if total_size > self.max_batch_size: raise ValueError("batch is too large") # обработка данных ... producer = Producer() consumer = Consumer() async def process(): while True: chunk = await producer.next() if chunk is None: break try: await consumer.consume([chunk]) await producer.commit([chunk]) except Exception as e: print("error but continue:", e) continue if __name__ == "__main__": asyncio.run(process()) ``` This code defines asynchronous producer-consumer classes with batch processing and error handling. The task is to implement or complete the logic for producing, consuming, and committing chunks of data, ensuring batch size limits are respected and errors are handled gracefully.

Middle
166

Explain the differences between generator, iterator, and coroutine, their purpose, and usage features.

Junior — Middle
166

From which settlement did you come?

Intern — Junior
166
/555