Building Blocks of Software: An Easy Quiz on Component-Based Architecture Quiz

  1. Definition of Component-Based Architecture

    Which statement best describes component-based architecture in software development?

    1. An approach where software is built by assembling independent, reusable components with well-defined interfaces
    2. A style where all features are coded in one large file for maximum speed
    3. A method that only focuses on database tables and ignores code structure
    4. A technique where user interface code is mixed with data storage in a single class
    5. A process of randomly splitting code into parts called compnents
  2. Primary Benefit

    What is a primary benefit of using components in software design across multiple projects?

    1. Improved reusability across projects
    2. Guaranteed real-time performance under any load
    3. Increased coupling between modules
    4. Harder unit testing due to hidden boundaries
    5. Reusablity without documentation
  3. Well-Defined Interfaces

    In component-based architecture, what does having a well-defined interface mean for a component?

    1. A clear contract of inputs, outputs, and behavior that other components rely on
    2. A list of private variables that no other code can see
    3. A visual button panel drawn on the screen
    4. A shared global namespace that all components can modify
    5. An interfase file that includes every internal detail
  4. Communication Between Components

    How do components typically communicate with each other in a component-based system?

    1. Through published interfaces or contracts rather than accessing internal state directly
    2. By editing each other's source code at runtime
    3. By sharing the same global variables for speed
    4. Through undocumented side effects only
    5. By copying and pasting methods between classes
  5. Loose Coupling Scenario

    Which scenario best demonstrates loose coupling in a component-based shopping app?

    1. Replacing a payment component without modifying the shopping cart when the interface stays the same
    2. Editing every screen in the app because a button color changed
    3. Rewriting the database schema to adjust the font size in the checkout page
    4. Hard-wiring the payment component to call private methods in the cart
    5. Using a single god-class to hold payment, cart, and user profile logic
  6. Cohesion and Responsibility

    Which statement about component granularity and responsibility is true in component-based architecture?

    1. Components should be cohesive units that encapsulate a specific responsibility
    2. Components should include as many unrelated features as possible to reduce file count
    3. Every individual function must be a separate component
    4. Granularity is fixed by the programming language and cannot be designed
    5. Granularity refers to the graphical size of the component on the screen
  7. Deployment Flexibility

    Are components always deployed as separate processes or services in a component-based system?

    1. No, components can be libraries within the same process or separately deployed services
    2. Yes, every component must run in its own server
    3. Yes, components are always remote and never in-process
    4. No, components can only be global variables in a single script
    5. Sometimes, but only if they are named with a 'Service' suffix
  8. Assembly and Composition

    What practice is commonly used to assemble an application from multiple components?

    1. Composition and configuration to wire components together
    2. Deep inheritance chains for every feature
    3. Copy-pasting code across modules to share logic
    4. Manual byte-level memory layout tuning for each component
    5. Compostion without any configuration
  9. Interface Stability

    What is a likely consequence if a component's interface changes unexpectedly in a released system?

    1. Dependent components may fail because they rely on the original contract
    2. All dependent components will auto-update magically at runtime
    3. Overall performance will double due to fewer methods
    4. Security is automatically strengthened by the change
    5. Only the interfase filename needs updating while behavior stays identical
  10. Testing in Isolation

    Why is testing often simpler in a component-based architecture when using mocks or fakes?

    1. Each component can be tested in isolation with mocked dependencies
    2. All components must be run together for any test to pass
    3. Mocking is unnecessary because components share global state
    4. Components cannot be tested without a full production environment
    5. Isolated tests are slower than end-to-end tests by definition