
This set covers the principles that separate a maintainable design from a fragile one. Questions test types of coupling and cohesion, modularity and information hiding, fan-in and fan-out, the major UML structural and behavioural diagrams, and common architectural styles such as layered, pipe-and-filter and MVC. Short explanations accompany every answer, making the set useful for GATE, UGC NET, university exams and system design discussions in interviews.
How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 18 questions.
Topics covered in this set
- Types of coupling and their ranking
- Types of cohesion and their ranking
- Modularity, information hiding, fan-in and fan-out
- UML class diagram notation
- UML sequence, state machine and deployment diagrams
- Architecture styles: layered, pipe-and-filter, MVC
Software Engineering MCQs with answers and explanations
Q1. Which type of coupling is considered the most desirable?
a) Control coupling
b) Common coupling
c) Stamp coupling
d) Data coupling
Q2. Which type of coupling is considered the worst?
a) Content coupling
b) Data coupling
c) Stamp coupling
d) External coupling
Q3. Which type of cohesion is considered the best?
a) Sequential cohesion
b) Functional cohesion
c) Temporal cohesion
d) Logical cohesion
Q4. A utility module contains unrelated routines for date formatting, printing a banner and computing GST that happen to be placed together. Its cohesion is
a) Functional
b) Communicational
c) Coincidental
d) Procedural
Q5. A module named startup() opens log files, initialises counters and loads configuration, all because they must happen when the program starts. Its cohesion is
a) Temporal
b) Logical
c) Functional
d) Sequential
Q6. Module A passes a flag to module B that decides which branch of logic B executes. This is an example of
a) Data coupling
b) Control coupling
c) Content coupling
d) Stamp coupling
Q7. Several modules read and update the same global variable. They are said to be
a) Data coupled
b) Stamp coupled
c) Functionally cohesive
d) Common coupled
Q8. Which combination characterises a good modular design?
a) Low cohesion and high coupling
b) High cohesion and high coupling
c) High cohesion and low coupling
d) Low cohesion and low coupling
Q9. In a structure chart, a module with high fan-in usually indicates
a) Poor design, since it calls too many modules
b) Good reuse, since many modules call it
c) That it should be removed
d) That it contains content coupling
Q10. Which UML diagram best shows the time-ordered exchange of messages between objects for one scenario?
a) Class diagram
b) Component diagram
c) Deployment diagram
d) Sequence diagram
Q11. In a UML class diagram, a filled (black) diamond at the end of an association denotes
a) Aggregation
b) Generalisation
c) Composition
d) Dependency
Q12. Which UML diagram models the states an object passes through and the events that trigger transitions between them?
a) State machine diagram
b) Use case diagram
c) Object diagram
d) Package diagram
Q13. In UML, a solid line with a hollow triangular arrowhead pointing to a class represents
a) Composition
b) Realisation of an interface by a dashed line
c) Generalisation (inheritance)
d) Navigable association
Q14. Which UML diagram shows the physical nodes such as servers and devices, and the software artifacts deployed on them?
a) Activity diagram
b) Communication diagram
c) Timing diagram
d) Deployment diagram
Q15. A compiler is organised as lexical analysis, parsing, semantic analysis and code generation, each stage transforming the output of the previous one. This architectural style is
a) Pipe-and-filter
b) Client-server
c) Blackboard
d) Peer-to-peer
Q16. In the Model-View-Controller pattern, which component interprets user input and decides how the model should change?
a) Model
b) Controller
c) View
d) Repository
Q17. In a strictly layered architecture, each layer
a) Can call any layer above or below it freely
b) Must share a single global database with every layer
c) Is deployed on a separate physical machine
d) Uses only the services of the layer immediately below it
Q18. Hiding design decisions that are likely to change inside a module, exposing only a stable interface, is the principle of
a) Polymorphism
b) Stepwise refinement
c) Information hiding
d) Normalisation
Quick revision notes
- Good design: high cohesion, low coupling.
- Coupling (best to worst): data, stamp, control, external, common, content.
- Cohesion (best to worst): functional, sequential, communicational, procedural, temporal, logical, coincidental.
- Information hiding (Parnas): hide design decisions likely to change behind stable interfaces.
- High fan-in indicates reuse; very high fan-out suggests a module doing too much.
- UML: filled diamond = composition, hollow diamond = aggregation, hollow triangle = generalisation.
- Sequence diagram shows time-ordered messages; state machine shows states and event-driven transitions.
- Pipe-and-filter suits stream processing such as compilers and Unix pipelines.
Frequently asked questions
Why is low coupling desirable?
When modules depend on each other only through simple, explicit interfaces, a change in one rarely forces changes in others. This makes the system easier to understand, test, reuse and maintain.
What is the difference between aggregation and composition in UML?
Both are whole-part relationships. In composition the part's lifetime is bound to the whole and it cannot be shared, while in aggregation the part can exist independently and may belong to several wholes.
What is the difference between cohesion and coupling?
Cohesion measures how closely the elements inside a single module belong together. Coupling measures how strongly different modules depend on one another. Designers aim for high cohesion and low coupling.
Comments
Post a Comment