Bird
Raised Fist0
Software Engineeringknowledge~20 mins

Coupling and cohesion in Software Engineering - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Coupling and Cohesion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Coupling Types

Which of the following best describes loose coupling in software design?

AModules depend heavily on each other's internal details.
BModules are combined into a single large block of code.
CModules interact through well-defined interfaces with minimal dependencies.
DModules share global variables extensively.
Attempts:
2 left
💡 Hint

Think about how modules should communicate to reduce problems when one changes.

📋 Factual
intermediate
2:00remaining
Identifying Cohesion Levels

Which of the following is an example of functional cohesion in a software module?

AA module that processes a customer order from start to finish.
BA module that contains utility functions for different unrelated calculations.
CA module that performs several unrelated tasks like logging, data validation, and user input.
DA module that only stores global variables.
Attempts:
2 left
💡 Hint

Functional cohesion means all parts of the module work together to perform one clear task.

🔍 Analysis
advanced
2:00remaining
Analyzing Coupling Impact

Consider two modules: Module A calls Module B's internal functions directly, and Module C calls Module D only through a public interface. Which statement is true about their coupling?

AModule A and B have loose coupling; Module C and D have tight coupling.
BModule A and B have tight coupling; Module C and D have loose coupling.
CBoth pairs have loose coupling.
DBoth pairs have tight coupling.
Attempts:
2 left
💡 Hint

Directly calling internal functions increases dependency and coupling.

❓ Comparison
advanced
2:00remaining
Comparing Cohesion Types

Which of the following best compares logical cohesion and functional cohesion?

ALogical cohesion groups unrelated tasks triggered by the same event; functional cohesion groups tasks that contribute to a single function.
BLogical cohesion groups tasks that perform one function; functional cohesion groups unrelated tasks.
CLogical cohesion means modules have no cohesion; functional cohesion means modules are tightly coupled.
DLogical cohesion and functional cohesion are the same.
Attempts:
2 left
💡 Hint

Think about whether tasks are related by purpose or just by timing.

❓ Reasoning
expert
2:00remaining
Evaluating Design for Maintainability

A software system has modules with high cohesion but also high coupling. What is the most likely impact on maintainability?

AThe system is easy to maintain because high coupling improves module communication.
BThe system is easy to maintain because high cohesion always ensures low coupling.
CThe system is hard to maintain because high cohesion causes modules to be too independent.
DThe system is hard to maintain because high coupling causes changes in one module to affect many others despite high cohesion.
Attempts:
2 left
💡 Hint

Consider how coupling affects the impact of changes across modules.

Practice

(1/5)
1. What does low coupling in software design mean?
easy
A. Modules have few dependencies on each other
B. Modules perform many unrelated tasks
C. Modules are tightly connected and dependent
D. Modules share all their data freely

Solution

  1. Step 1: Understand coupling concept

    Coupling measures how much modules depend on each other.
  2. Step 2: Interpret low coupling

    Low coupling means modules have few dependencies, making them independent.
  3. Final Answer:

    Modules have few dependencies on each other -> Option A
  4. Quick Check:

    Low coupling = few dependencies [OK]
Hint: Low coupling means less dependency between modules [OK]
Common Mistakes:
  • Confusing low coupling with high dependency
  • Thinking low coupling means modules do many tasks
  • Mixing coupling with cohesion concepts
2. Which of the following best describes high cohesion in a module?
easy
A. The module depends heavily on other modules
B. The module performs many unrelated tasks
C. The module focuses on a single, well-defined task
D. The module shares data with all other modules

Solution

  1. Step 1: Understand cohesion concept

    Cohesion measures how focused a module is on a single task.
  2. Step 2: Interpret high cohesion

    High cohesion means the module focuses on one clear, well-defined task.
  3. Final Answer:

    The module focuses on a single, well-defined task -> Option C
  4. Quick Check:

    High cohesion = single focused task [OK]
Hint: High cohesion means one clear task per module [OK]
Common Mistakes:
  • Thinking high cohesion means many unrelated tasks
  • Confusing cohesion with coupling
  • Assuming high cohesion means high dependency
3. Consider two modules: Module A calls Module B frequently and shares many variables. Module C performs one clear task independently. Which statement is true?
medium
A. Module A has low coupling and high cohesion
B. Module A has high coupling and Module C has high cohesion
C. Module B has high cohesion and low coupling
D. Module C has high coupling and Module A has low cohesion

Solution

  1. Step 1: Analyze Module A and B relationship

    Module A calls Module B frequently and shares many variables, indicating high coupling.
  2. Step 2: Analyze Module C's task focus

    Module C performs one clear task independently, indicating high cohesion.
  3. Final Answer:

    Module A has high coupling and Module C has high cohesion -> Option B
  4. Quick Check:

    High coupling = many dependencies; High cohesion = focused task [OK]
Hint: Frequent calls = high coupling; single task = high cohesion [OK]
Common Mistakes:
  • Mixing which module has high coupling
  • Confusing cohesion with coupling
  • Assuming independence means low cohesion
4. A software module is designed to handle user input, process data, and generate reports all in one. What is the main problem here?
medium
A. The module has low cohesion
B. The module has low coupling
C. The module is highly focused
D. The module is loosely connected

Solution

  1. Step 1: Identify tasks in the module

    The module handles user input, processes data, and generates reports, which are different tasks.
  2. Step 2: Assess cohesion level

    Because it does many unrelated tasks, the module has low cohesion.
  3. Final Answer:

    The module has low cohesion -> Option A
  4. Quick Check:

    Multiple unrelated tasks = low cohesion [OK]
Hint: Many tasks in one module means low cohesion [OK]
Common Mistakes:
  • Confusing low cohesion with low coupling
  • Thinking multiple tasks mean high cohesion
  • Ignoring the definition of cohesion
5. You have a large software system with modules that share many variables and perform multiple unrelated tasks. To improve design, which approach should you take?
hard
A. Increase coupling and decrease cohesion
B. Increase both coupling and cohesion
C. Keep coupling and cohesion as they are
D. Decrease coupling and increase cohesion

Solution

  1. Step 1: Identify current design issues

    Modules share many variables (high coupling) and perform unrelated tasks (low cohesion).
  2. Step 2: Apply good design principles

    Good design aims for low coupling (less dependency) and high cohesion (focused tasks).
  3. Final Answer:

    Decrease coupling and increase cohesion -> Option D
  4. Quick Check:

    Good design = low coupling + high cohesion [OK]
Hint: Aim for less dependency and focused tasks [OK]
Common Mistakes:
  • Thinking increasing coupling improves design
  • Confusing cohesion with coupling
  • Ignoring the benefits of modular design
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard