โ† All POC Flashcard Decks

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
  1. In Python system design, what is the primary purpose of using a message broker like RabbitMQ or Redis Pub/Sub?

    Answer: To decouple producers and consumers by asynchronously passing messages

    Message brokers enable asynchronous communication between services, so producers don't block waiting for consumers and services remain loosely coupled.

  2. Which Python library implements the Data Mapper pattern, mapping objects to database rows without the objects needing to know about the database?

    Answer: SQLAlchemy ORM

    SQLAlchemy ORM implements Data Mapper where Python classes map to database tables via metadata, keeping domain objects free of persistence logic.

  3. In the context of Python clean architecture, which layer should contain the application's core business rules?

    Answer: Domain/Entity layer

    The Domain/Entity layer holds the highest-level business rules and has no dependencies on outer layers like databases or frameworks.

  4. What is the role of a Python `__slots__` declaration in memory-efficient system design?

    Answer: It prevents dynamic attribute creation and reduces per-instance memory overhead

    __slots__ replaces the per-instance __dict__ with a fixed-size array, significantly reducing memory usage when millions of instances are created.

  5. When would you choose the Facade pattern in a Python system?

    Answer: When you want to provide a simple interface to a complex subsystem

    The Facade pattern wraps a complex subsystem behind a simple, unified interface, reducing the learning curve and coupling for client code.

  6. In a Python distributed system, what does 'eventual consistency' mean?

    Answer: Given enough time without new updates, all replicas converge to the same value

    Eventual consistency is a model where replicas may temporarily diverge but will converge to the same state once updates propagate through the system.

  7. Which Python concurrency primitive is best for sharing state between threads safely?

    Answer: threading.Lock

    threading.Lock provides mutual exclusion, ensuring only one thread accesses a shared resource at a time, preventing race conditions.