Software Design MCQs for NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

Software design turns requirements into a plan for the code: which modules exist, what each one is responsible for, and how they talk to each other. Good design means high cohesion, low coupling and well-chosen patterns. It is topic 6 of the Software Engineering area, which carries 10% of the NSCT according to HEC's Areas of Competencies. In 2026 candidates averaged 50.1% in Software Engineering, per the HEC NSCT report and APP.

Pressman lists the core design concepts as abstraction, modularity, information hiding, functional independence, refinement and refactoring. Functional independence is measured by two things: cohesion and coupling. Large-scale structure (layers, MVC, microservices) is covered under software architecture.

Cohesion

Cohesion is how closely the elements inside one module belong together. The classic scale (from Yourdon and Constantine, repeated by Pressman) runs from worst to best:

Cohesion Elements are grouped because… Example
Coincidental No real reason misc.py with unrelated helpers
Logical They belong to one category, chosen by a flag handle_input(type) for keyboard, file and network input
Temporal They run at the same time init() that opens logs and resets counters
Procedural They follow a fixed order of steps Steps of a checklist that act on different data
Communicational They use the same data Computing balance and credit score from one customer record
Sequential One element's output is the next one's input parse → validate → store
Functional All contribute to one task compute_gpa()

Exam angle: "one reason to change" (the single responsibility principle) is the modern way of saying functional cohesion.

Coupling

Coupling is how much modules depend on each other. From loosest (best) to tightest (worst):

Coupling What is shared Example
Data Only the needed values, as parameters area(width, height)
Stamp A whole structure when only part is used print_label(student) uses only roll_no
Control A flag that steers the other module's logic report(data, mode=2)
External An imposed external format, protocol or device Two modules bound to one file format
Common Global data Several modules writing current_user
Content Another module's internals Changing a private field of another class directly

Exam angle: to reduce coupling, replace globals and flags with explicit parameters, and depend on interfaces rather than concrete classes.

UML diagrams

UML (Unified Modeling Language) 2 has structural diagrams (class, object, component, deployment, package, composite structure, profile) and behavioural ones (use case, activity, state machine, plus the interaction diagrams: sequence, communication, timing and interaction overview).

In class diagrams, learn the relationship symbols:

Relationship Meaning Notation
Association Objects are linked Solid line, with multiplicities such as 1..*
Aggregation Whole-part; the part can live on its own Hollow diamond at the whole
Composition Whole-part; the part dies with the whole Filled diamond at the whole
Generalisation "Is-a" inheritance Hollow triangle pointing to the parent
Dependency Uses temporarily Dashed arrow

Exam angle: multiplicity is read at the far end. Library 1 —— 0..* Book means a library has zero or more books and each book belongs to exactly one library. Full coverage is on the UML diagrams page.

Design patterns

A design pattern is a named, reusable solution to a recurring design problem. The Gang of Four (GoF) book by Gamma, Helm, Johnson and Vlissides catalogues 23, grouped by purpose:

Category Purpose Patterns to know (GoF intent in brief)
Creational Object creation Singleton (one instance, global access), Factory Method (subclasses decide which class to create), Abstract Factory (families of related objects), Builder, Prototype
Structural Composing classes and objects Adapter (convert an interface), Decorator (add responsibilities dynamically), Facade (simple interface to a subsystem), Composite (part-whole trees), Proxy (control access), Bridge (separate abstraction from implementation)
Behavioural Responsibilities and algorithms Observer (one-to-many notification), Strategy (interchangeable algorithms), Command (a request as an object), State, Template Method, Iterator

Exam angle: questions describe a problem and ask for the pattern. Look for the key phrase: "incompatible interface" means Adapter, "notify many" means Observer, "swap algorithm at run time" means Strategy, and "add features without subclass explosion" means Decorator.

Common traps

Worked examples

Understanding. Which GoF category does Factory Method belong to? Answer: creational. Its intent is to define an interface for creating an object but let subclasses decide which class to instantiate, so it concerns object creation.

Application. A function send(msg, use_sms) checks use_sms to decide whether to send an email or an SMS. Name the coupling, and say how to remove it. Answer: control coupling. The caller steers the callee's internal logic with a flag. Two functions, or a Notifier interface with EmailNotifier and SmsNotifier classes (Strategy), remove the flag.

Analysis. A stock app must update a chart, a price table and an alert service whenever a price changes. More displays will be added later. Which design keeps the price feed unaware of the displays? Answer: Observer. The feed (subject) keeps a list of observers and calls update() on each one. New displays just register, so the feed never changes. Direct calls from the feed to each display would tie it to every concrete class.

Practise

The quiz below has 98 Software Design questions, which you can filter by tier and difficulty.

Practise: 98 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. In software design, what does cohesion measure?

    1. How closely the elements inside a single module belong together and work towards one purpose
    2. How many modules call a given module
    3. How strongly one module depends on other modules
    4. How many lines of code a module contains
    Show answer

    Answer: A. How closely the elements inside a single module belong together and work towards one purpose

    Cohesion is an intra-module property: the degree to which the elements of one module are functionally related. High cohesion means a module does one well-defined job. Dependence between modules is coupling, and the number of callers is fan-in.

  2. In software design, what does coupling measure?

    1. The degree to which elements inside one module are related
    2. The number of classes in the system
    3. The speed at which modules exchange messages
    4. The degree of interdependence between modules
    Show answer

    Answer: D. The degree of interdependence between modules

    Coupling is an inter-module property: how much one module relies on another's data, control or internals. Low coupling means a change in one module rarely forces changes in others. Relatedness inside a module is cohesion.

  3. Which combination do Pressman and Sommerville recommend for a good modular design?

    1. High cohesion and high coupling
    2. High cohesion and low coupling
    3. Low cohesion and low coupling
    4. Low cohesion and high coupling
    Show answer

    Answer: B. High cohesion and low coupling

    Each module should do one clear job (high cohesion) and depend on others as little as possible (low coupling). This makes modules easier to understand, test, reuse and change, because effects of a change stay local.

  4. Which type of cohesion is considered the strongest (best)?

    1. Functional cohesion
    2. Sequential cohesion
    3. Communicational cohesion
    4. Logical cohesion
    Show answer

    Answer: A. Functional cohesion

    In the classic scale from worst to best (coincidental, logical, temporal, procedural, communicational, sequential, functional), functional cohesion is the best: every element contributes to a single, well-defined task such as computing a square root. Sequential is the second best.

  5. Which type of cohesion is considered the weakest (worst)?

    1. Temporal cohesion
    2. Logical cohesion
    3. Procedural cohesion
    4. Coincidental cohesion
    Show answer

    Answer: D. Coincidental cohesion

    Coincidental cohesion means the elements are grouped for no meaningful reason, as in a 'misc utilities' module. It is at the bottom of the scale. Logical cohesion (elements of the same general category, picked by a flag) is the next worst.

  6. Which type of coupling is considered the tightest (worst)?

    1. Data coupling
    2. Stamp coupling
    3. Control coupling
    4. Content coupling
    Show answer

    Answer: D. Content coupling

    The classic coupling scale from loosest to tightest is data, stamp, control, external, common, content. Content coupling, where one module directly reads or changes another module's internal data or jumps into its code, is the worst because any internal change breaks the other module.

  7. Which type of coupling is the loosest (best) of these?

    1. Common coupling
    2. Control coupling
    3. Data coupling
    4. Stamp coupling
    Show answer

    Answer: C. Data coupling

    Data coupling means modules communicate only by passing the elementary data items they need as parameters. Stamp coupling passes a whole data structure when only part is used, control coupling passes flags that steer the other module's logic, and common coupling shares global data. All three are tighter than data coupling.

  8. The Gang of Four (GoF) book groups its 23 design patterns into which three categories?

    1. Creational, structural and behavioural
    2. Creational, functional and procedural
    3. Static, dynamic and hybrid
    4. Architectural, structural and deployment
    Show answer

    Answer: A. Creational, structural and behavioural

    Gamma, Helm, Johnson and Vlissides classify patterns by purpose. Creational patterns deal with object creation (Singleton, Factory Method), structural patterns with composing classes and objects (Adapter, Decorator), and behavioural patterns with algorithms and responsibilities between objects (Observer, Strategy).

  9. According to the GoF, what is the intent of the Singleton pattern?

    1. Create families of related objects without naming their concrete classes
    2. Ensure a class has only one instance and provide a global point of access to it
    3. Let a class have exactly one method
    4. Allow only one thread to run at a time
    Show answer

    Answer: B. Ensure a class has only one instance and provide a global point of access to it

    Singleton is a creational pattern whose intent is to ensure a class has only one instance and provide a global point of access to it, typically via a static method and a private constructor. Creating families of related objects is Abstract Factory. Restricting threads is a concurrency mechanism such as a lock.

  10. According to the GoF, what is the intent of the Observer pattern?

    1. Provide a surrogate that controls access to another object
    2. Define a family of algorithms and make them interchangeable
    3. Convert the interface of a class into another interface clients expect
    4. Define a one-to-many dependency so that when one object changes state, all its dependents are notified and updated automatically
    Show answer

    Answer: D. Define a one-to-many dependency so that when one object changes state, all its dependents are notified and updated automatically

    Observer is a behavioural pattern. A subject keeps a list of observers and notifies them when its state changes, so the subject does not need to know their concrete classes. A surrogate is Proxy, interchangeable algorithms is Strategy, and interface conversion is Adapter.

FAQs

What is the difference between cohesion and coupling?

Cohesion is about the inside of a module: how strongly its elements serve one purpose. Coupling is about the links between modules: how much one depends on another. You want high cohesion and low coupling, and the two often improve together, because a module that does one job usually needs less from others.

How many design patterns are in the GoF book?

The Gang of Four book (1994) describes 23 patterns: 5 creational, 7 structural and 11 behavioural. You do not need all of them in detail. Singleton, Factory Method, Abstract Factory, Adapter, Decorator, Facade, Composite, Observer and Strategy cover most exam questions.

Is MVC a design pattern or an architecture?

Both labels appear. MVC (Model-View-Controller) is usually taught as an architectural pattern because it structures a whole application. The GoF book describes it as a combination of Observer, Composite and Strategy. If a question lists it alongside layered and client-server styles, treat it as an architecture.

What is the difference between aggregation and composition?

Both are whole-part relationships. In composition the whole owns the part and the part's lifetime depends on it, like an order and its order lines; the UML symbol is a filled diamond. In aggregation the part can exist on its own, like a team and its players; the symbol is a hollow diamond.

Next step

Continue with Software Architecture MCQs, go back to the Software Engineering hub, or try a timed NSCT mock test.