Python
Why is GIL needed at all, given that it imposes such restrictions?
Is it necessary to specify version numbers for dependencies in requirements.txt?
How is data exchanged between microservices?
What are iterators and generators? What is their purpose?
Why are immutable data types, such as tuples, needed in Python when lists exist?
What can be said about the advantages and disadvantages of NoSQL non-relational databases?
"""Write code that extracts links from raw text and sorts them according to certain rules. The list of links returned should not contain duplicates. Sorting rules are as follows: - Priority 1: The first detected links, up to self.first_extracted_links - Priority 2: Links to cloud drives and documents (Yandex Disk, etc.) - Priority 3: Links to files (ending with extensions like .exe, .pdf, .rar, etc.) - Priority 4: Remaining links sorted from longer to shorter strings Also, consider the limit on the number of links and implement a context manager. Can be run, for example, at [link] Total: - 30 minutes are given for execution - Write functions apply, process, and functions for the context manager - All tests must pass - Tests cannot be modified - You can use imports - After writing, you can check by running locally, and fix if something is wrong on this page Regex for link detection: (?:https?|ftp):\/\/(?:[a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(?::\d+)?(?:\/[^\s()]*)? """ class LinkExtractor: DEFAULT_CLOUDS = frozenset(( "drive.google.com", "mediafire.com", "yadi.sk", "disk.yandex.ru", "cloud.mail.ru", "mega.nz" )) # You can extend this method or rewrite it def __init__(self, max_links: int = 7, first_extracted_links: int = 2, clouds = None): # Maximum number of links to return in the array self.max_links = max_links # Number of links extracted for the first condition self.first_extracted_links = first_extracted_links # List of domains considered as clouds for the second condition self.clouds = clouds or self.DEFAULT_CLOUDS self._results = [] # Write this method, adds a part of text to analyze later def apply(self, text) -> "LinkExtractor": ... return self"""}]}]}
Have you used the @property decorator in your Python projects?
What is typing in Python?
How much of your work time do you spend programming in Python?
What microservice have you developed from scratch?
What components or mechanisms in Python control the concurrent execution of threads?
What is the difference between PUT and PATCH? How should the server respond if not all fields are sent with the PUT method? Provide a real case of using PATCH.
What tasks in your previous project did you find less interesting or more difficult to perform?
Have you experienced periods of professional burnout during your work?
If two synchronous FastAPI handlers with time.sleep(5) are called in parallel, how long will they take to execute?
How did you deploy in Kubernetes, and which web server did you use?
What problems can occur when transferring a file between servers? What should be paid attention to?
What will be important for you to see in a new company? What do you pay attention to first when choosing offers?
Какие схемы данных вы использовали или создавали с помощью библиотеки Pydantic?