Python | Вопросы собесов
Cайт: easyoffer.ru Реклама: @easyoffer_adv ВП: @easyoffer_vp Тесты t.me/+20tRfhrwPpM4NDQy Задачи t.me/+nsl4meWmhfQwNDVi Вакансии t.me/+cXGKkrOY2-w3ZTky
Show more📈 Analytical overview of Telegram channel Python | Вопросы собесов
Channel Python | Вопросы собесов (@python_easy_ru) in the Russian language segment is an active participant. Currently, the community unites 13 104 subscribers, ranking 9 734 in the Technologies & Applications category and 50 704 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 13 104 subscribers.
According to the latest data from 10 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -55 over the last 30 days and by 1 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 8.86%. Within the first 24 hours after publication, content typically collects 5.51% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 161 views. Within the first day, a publication typically gains 722 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 3.
- Thematic interests: Content is focused on key topics such as ставь, модуль, строка, docker, alice.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Cайт: easyoffer.ru
Реклама: @easyoffer_adv
ВП: @easyoffer_vp
Тесты t.me/+20tRfhrwPpM4NDQy
Задачи t.me/+nsl4meWmhfQwNDVi
Вакансии t.me/+cXGKkrOY2-w3ZTky”
Thanks to the high frequency of updates (latest data received on 11 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
from abc import ABC, abstractmethod
# Интерфейс выражения
class Expression(ABC):
@abstractmethod
def interpret(self):
pass
# Конкретное выражение для чисел
class Number(Expression):
def __init__(self, value):
self.value = value
def interpret(self):
return self.value
# Конкретное выражение для сложения
class Add(Expression):
def __init__(self, left: Expression, right: Expression):
self.left = left
self.right = right
def interpret(self):
return self.left.interpret() + self.right.interpret()
# Конкретное выражение для умножения
class Multiply(Expression):
def __init__(self, left: Expression, right: Expression):
self.left = left
self.right = right
def interpret(self):
return self.left.interpret() * self.right.interpret()
# Клиентский код для использования паттерна Интерпретатор
def main():
# Создаем выражение: (5 + 10) * 2
expression = Multiply(
Add(Number(5), Number(10)),
Number(2)
)
result = expression.interpret()
print(f"Result: {result}") # Result: 30
if __name__ == "__main__":
main()
1⃣Интерфейс `Expression`:
Объявляет метод interpret, который должен реализовать каждое конкретное выражение.
2⃣Конкретные выражения:
Классы Number, Add и Multiply, которые реализуют интерфейс Expression и определяют интерпретацию чисел, сложения и умножения соответственно.
3⃣Компоновка выражений:
Выражения могут быть составными, например, Add и Multiply могут принимать другие выражения в качестве аргументов.
4⃣Интерпретация:
Метод interpret вызывается для вычисления значения выражения.
Ставь 👍 и забирай 📚 Базу знанийfrom abc import ABC, abstractmethod
# Интерфейс команды
class Command(ABC):
@abstractmethod
def execute(self):
pass
@abstractmethod
def undo(self):
pass
# Получатель команды
class Light:
def on(self):
print("Light is ON")
def off(self):
print("Light is OFF")
# Конкретная команда для включения света
class LightOnCommand(Command):
def __init__(self, light: Light):
self._light = light
def execute(self):
self._light.on()
def undo(self):
self._light.off()
# Конкретная команда для выключения света
class LightOffCommand(Command):
def __init__(self, light: Light):
self._light = light
def execute(self):
self._light.off()
def undo(self):
self._light.on()
# Инициатор команды
class RemoteControl:
def __init__(self):
self._command = None
def set_command(self, command: Command):
self._command = command
def press_button(self):
if self._command:
self._command.execute()
def press_undo(self):
if self._command:
self._command.undo()
# Использование паттерна Команда
light = Light()
light_on_command = LightOnCommand(light)
light_off_command = LightOffCommand(light)
remote = RemoteControl()
# Включаем свет
remote.set_command(light_on_command)
remote.press_button() # Light is ON
remote.press_undo() # Light is OFF
# Выключаем свет
remote.set_command(light_off_command)
remote.press_button() # Light is OFF
remote.press_undo() # Light is ON
🚩Как это работает
🟠Интерфейс `Command`:
Объявляет методы execute и undo, которые должны реализовать конкретные команды.
🟠Конкретные команды:
Реализуют интерфейс Command и определяют, как выполнять и отменять действия.
🟠Получатель (`Light`):
Объект, который выполняет действия (в данном случае, включение и выключение света).
🟠Инициатор (`RemoteControl`):
Объект, который вызывает команды. Он не знает, что именно делает команда, а просто вызывает её методы execute и undo.
Ставь 👍 и забирай 📚 Базу знанийfrom abc import ABC, abstractmethod
class Handler(ABC):
def __init__(self, successor=None):
self._successor = successor
@abstractmethod
def handle(self, request):
if self._successor:
return self._successor.handle(request)
return None
class BasicSupportHandler(Handler):
def handle(self, request):
if request == 'basic':
return "Basic support handled the request"
return super().handle(request)
class IntermediateSupportHandler(Handler):
def handle(self, request):
if request == 'intermediate':
return "Intermediate support handled the request"
return super().handle(request)
class AdvancedSupportHandler(Handler):
def handle(self, request):
if request == 'advanced':
return "Advanced support handled the request"
return super().handle(request)
# Создаем цепочку обработчиков
handler_chain = BasicSupportHandler(
IntermediateSupportHandler(
AdvancedSupportHandler()
)
)
# Тестируем цепочку
print(handler_chain.handle('basic')) # Basic support handled the request
print(handler_chain.handle('intermediate')) # Intermediate support handled the request
print(handler_chain.handle('advanced')) # Advanced support handled the request
print(handler_chain.handle('unknown')) # None (запрос не обработан)
🚩Как это работает
🟠Создание абстрактного класса `Handler`:
Все конкретные обработчики наследуются от него и реализуют метод handle.
🟠Реализация конкретных обработчиков:
Каждый обработчик проверяет, может ли он обработать запрос. Если может, он обрабатывает его и возвращает результат. Если не может, он передает запрос следующему обработчику в цепочке.
🟠Создание цепочки обработчиков:
Обработчики связываются друг с другом, образуя цепочку.
🟠Передача запроса: Запрос передается по цепочке, пока один из обработчиков не обработает его или пока не будет достигнут конец цепочки.
Ставь 👍 и забирай 📚 Базу знанийfrom abc import ABC, abstractmethod
class Strategy(ABC):
@abstractmethod
def execute(self, data):
pass
class ConcreteStrategyA(Strategy):
def execute(self, data):
return sorted(data)
class ConcreteStrategyB(Strategy):
def execute(self, data):
return sorted(data, reverse=True)
class Context:
def __init__(self, strategy: Strategy):
self._strategy = strategy
def set_strategy(self, strategy: Strategy):
self._strategy = strategy
def execute_strategy(self, data):
return self._strategy.execute(data)
data = [5, 2, 9, 1]
context = Context(ConcreteStrategyA())
print(context.execute_strategy(data)) # [1, 2, 5, 9]
context.set_strategy(ConcreteStrategyB())
print(context.execute_strategy(data)) # [9, 5, 2, 1]
Наблюдатель (Observer)
Определяет зависимость "один ко многим" между объектами таким образом, что при изменении состояния одного объекта все зависимые объекты оповещаются и обновляются автоматически.
class Subject:
def __init__(self):
self._observers = []
def add_observer(self, observer):
self._observers.append(observer)
def remove_observer(self, observer):
self._observers.remove(observer)
def notify_observers(self, message):
for observer in self._observers:
observer.update(message)
class Observer:
def update(self, message):
pass
class ConcreteObserver(Observer):
def update(self, message):
print(f"Observer received: {message}")
subject = Subject()
observer1 = ConcreteObserver()
observer2 = ConcreteObserver()
subject.add_observer(observer1)
subject.add_observer(observer2)
subject.notify_observers("Hello Observers!") # Observer received: Hello Observers!
Ставь 👍 и забирай 📚 Базу знанийProxy контролирует доступ к классу RealSubject, добавляя проверку доступа и логирование.
from abc import ABC, abstractmethod
class Subject(ABC):
@abstractmethod
def request(self):
pass
class RealSubject(Subject):
def request(self):
print("Реальный объект: Обработка запроса.")
class Proxy(Subject):
def __init__(self, real_subject):
self._real_subject = real_subject
def request(self):
if self.check_access():
self._real_subject.request()
self.log_access()
def check_access(self):
print("Заместитель: Проверка доступа перед выполнением запроса.")
return True
def log_access(self):
print("Заместитель: Логирование времени запроса.")
# Клиентский код
real_subject = RealSubject()
proxy = Proxy(real_subject)
proxy.request()
Ставь 👍 и забирай 📚 Базу знаний
Available now! Telegram Research 2025 — the year's key insights 
