Sobes.tech

What is TDD and what is the meaning of this approach?

215

What version of Python have you worked with in your last company?

199

Using any task as an example, tell how you identified bottlenecks in PostgreSQL queries: what tools you used and how you found the problem.

198

How does a generator differ from a regular function?

175

How is an abstract syntax tree (AST) used in Python?

164

In which areas of Python development do you consider yourself to be the strongest specialist?

157

There is a module that accepted a task and is dependent. What will you do?

156

Is it possible to access an attribute or method of a class starting with two underscores? What are the features?

148

"""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"""}]}]}

147

When and why do you choose multiprocessing processes?

146

What types of queues as data structures do you know?

141

Tell about an interesting incident or a difficult situation at work.

141

What is the difference between a shallow copy and a deep copy (`copy` and `deepcopy`)?

141

What profiling tools in Python do you know?

139

What good things did you do at [company]? Tell us about interesting projects.

137

What can cause memory leaks if there is a garbage collector?

137

What types of replication does PostgreSQL support?

136

How to deal with table bloat in PostgreSQL?

135
/4