Sobes.tech

What techniques prevent unwanted data read operations?

Middle — 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

What are the consequences of using a list as a key in a dictionary?

Junior — Middle
166

How to output all list elements without using a for loop?

Junior — Middle
166

from src import load_model @app.post("/classify") async def classify(request: dict): text = request["text"] model = load_model("classifier_v1") prediction = model.predict([text]) return {"label": prediction}

Middle+
166

What are the advantages of using ModelSerializer in Django REST Framework?

Junior — Middle
166

What professional skills and knowledge do you plan to develop within this project or company?

Junior — Middle
166

Why did you use Celery instead of Kafka for all tasks? What is the difference?

Middle
166

What principles should be considered when developing RESTful APIs?

Junior — Middle
166

Have you ever experienced professional burnout or exhaustion?

Junior — Middle
166

Are you familiar with Event Sourcing? Have you used it?

Middle
166

Is it possible to run Docker containers on Windows, and what features are involved?

Junior — Middle
166

What main problems did you encounter when testing the application?

Junior — Middle
166

What are the main advantages and disadvantages of using co-processes in systems?

Junior — Middle
166

To which category of tools does the Athena service belong in the context of data analytics?

Junior — Middle
166

If you have seen slow queries, how did you analyze the problem and what solutions did you implement? Is there a real case?

Senior
166

What tools or approaches do you use to ensure adherence to a unified coding style in the project?

Junior — Middle
166

In which cases is it recommended to use key-value databases?

Junior — Middle
166

How is the user verification and login process implemented within the Django framework?

Junior — Middle
166

What type of data is stored using values in Redis?

Junior — Middle
166
/554