Complete the code to avoid the {{BLANK_1}} anti-pattern in system design.
def handle_request(request): # Avoid [1] by not tightly coupling components pass
The spaghetti_code anti-pattern means code is tangled and hard to maintain. Avoiding it improves design clarity.
Complete the code to prevent the {{BLANK_1}} anti-pattern by using proper data storage.
def save_data(data): # Avoid [1] by not storing all data in one place pass
The single_point_of_failure anti-pattern means one failure can crash the whole system. Avoid it by distributing data.
Fix the error in the code that causes the {{BLANK_1}} anti-pattern by separating concerns.
class UserManager: def __init__(self): self.db = Database() def process(self, data): # This causes [1] by mixing logic and data access self.db.save(data) self.send_email(data)
The god_object anti-pattern happens when one class does too much. Splitting responsibilities fixes it.
Fill both blanks to avoid the {{BLANK_1}} and {{BLANK_2}} anti-patterns in system design.
def process_request(req): # Avoid [1] by not blocking main thread # Avoid [2] by not duplicating code pass
blocking_io causes delays by waiting too long; code_duplication makes maintenance hard. Avoid both for clean design.
Fill all three blanks to fix the {{BLANK_1}}, {{BLANK_2}}, and {{BLANK_3}} anti-patterns in this code snippet.
def handle_data(data): # Avoid [1] by not sharing mutable state # Avoid [2] by not ignoring errors # Avoid [3] by not overloading one service pass
shared_mutable_state causes bugs from unexpected changes; silent_failures hide problems; service_monolith overloads one service. Fixing these improves reliability.