THINK FIRST·CODE LATER

← Software Engineering
Chapter 6 · Week 6

Architecture and Design for Change

Answered 0/30 Correct 0
Sign in to save progress across devices
Q1

Which decision is most clearly architectural?

Q2

Architecture is driven mainly by…

Q3

A change to the posts database table forces changes in the Android screens, the web pages and the notification code. This indicates…

Q4

A class Utils contains methods for date formatting, sending emails, computing quiz scores and resizing images. Its main design problem is…

Q5

According to Parnas's information-hiding principle, how should modules be chosen?

Q6

Which is the best example of dependency inversion in StudyBuddy?

Q7

Why does a FakeTutor implementation make testing easier?

Q8

Every Tutor implementation must either return an answer or throw TutorUnavailableException — never return null. Which SOLID principle does this protect?

Q9

For a 5-student team building StudyBuddy in one semester, which architecture is most appropriate?

Q10

Which problem do microservices mainly solve?

Q11

In a layered architecture (presentation → service → domain → data), which dependency is a violation?

Q12

StudyBuddy publishes a PostReported event; the moderation module adds the post to the queue, the notification module informs the TA, and the statistics module counts it. What style is this, and what is its main weakness?

Q13

Buddy calls an external AI service that sometimes hangs for minutes. Which tactic is the first to add?

Q14

What does a circuit breaker do?

Q15

Why are retries done with back-off (e.g., 1 s, 2 s, 4 s) rather than immediately and endlessly?

Q16

Forty students ask Buddy "What is polymorphism?" the night before the midterm. Which tactic reduces cost and waiting time?

Q17

Module board depends on 3 modules and 1 module depends on it. What is its instability I = Ce / (Ca + Ce)?

Q18

StudyBuddy sends notifications through a long switch on the channel type (PUSH, EMAIL). Adding WeChat requires editing that switch in four places. Which principle does a Notifier interface with one class per channel restore?

Q19

Why are dependency cycles (A → B → C → A) harmful?

Q20

Which sections does a classic ADR (Nygard) contain?

Q21

A year later, the team replaces the decision in ADR-003. What should they do with ADR-003?

Q22

What is the main idea of retrieval-augmented generation (RAG) for Buddy?

Q23

Why should Buddy's prompt template be versioned configuration with a controlled release process, instead of text anyone can edit live?

Q24

An AI assistant proposes, for StudyBuddy, 9 microservices, Kafka, Kubernetes and a database per service. What is the best engineering response?

Q25

Which is a sensible output guardrail for Buddy?

Q26 Short answer

Explain coupling and cohesion and, for each, give one concrete sign in code that it is bad, using StudyBuddy examples.

Q27 Short answer

Describe the three states of a circuit breaker (closed, open, half-open) and when it moves between them. Why is it useful for Buddy's calls to the AI provider?

Q28 Short answer

Write an ADR (title, status, context, decision, consequences) for: "StudyBuddy will be built as a modular monolith, not as microservices."

Q29 Short answer

Draw or describe Buddy's request flow with RAG and guardrails, and explain what each step protects against.

Q30 Short answer

List five things in StudyBuddy that are likely to change in the next two years and, for each, the module or interface that should hide it (information hiding).