Architecture & System Design Flashcards
7 cards from real POC practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Architecture & System Design flashcards as text
Which Python pattern separates the construction of a complex object from its representation?
Answer: Builder
The Builder pattern uses a director and builder classes to construct complex objects step-by-step, separating construction logic from the final representation.
In a Python application using the Repository pattern, what is the primary responsibility of the repository class?
Answer: To abstract data access and provide collection-like interfaces for domain objects
The Repository pattern abstracts the data layer, providing a clean interface for accessing domain objects without exposing database implementation details.
Which Python architectural approach best supports the principle of 'separation of concerns' in a web application?
Answer: Model-View-Controller (MVC) or Model-View-Template (MVT)
MVC/MVT separates data models, presentation logic, and business/control logic into distinct layers, keeping concerns isolated and maintainable.
What is the main advantage of using Python's `asyncio` event loop in a high-concurrency system design?
Answer: It handles thousands of concurrent I/O-bound operations without blocking threads
asyncio uses cooperative multitasking to handle many I/O-bound operations concurrently on a single thread without thread overhead.
In a Python service using the Command pattern, what does the 'invoker' component do?
Answer: Triggers command execution without knowing the concrete command details
The invoker holds a reference to a command object and triggers its execute() method, decoupling the caller from the receiver of the action.
What problem does the Circuit Breaker pattern solve in a Python microservices system?
Answer: Stopping cascading failures when a downstream service is unavailable
The Circuit Breaker pattern trips open when a service fails repeatedly, preventing the calling service from wasting resources on doomed requests and allowing time for recovery.
Which Python data structure is best suited as a backing store for implementing an LRU (Least Recently Used) cache from scratch?
Answer: collections.OrderedDict
collections.OrderedDict maintains insertion order and supports move_to_end(), making it efficient for LRU eviction without additional linked list logic.